Skip to content

feat: add OrcaRouter as a first-class LLM provider - #1

Open
nissrin2020ali-ux wants to merge 1 commit into
DanMo661:mainfrom
nissrin2020ali-ux:feat/add-orcarouter-provider
Open

feat: add OrcaRouter as a first-class LLM provider#1
nissrin2020ali-ux wants to merge 1 commit into
DanMo661:mainfrom
nissrin2020ali-ux:feat/add-orcarouter-provider

Conversation

@nissrin2020ali-ux

Copy link
Copy Markdown

Why this helps you

AI DailyPulse is a fully automated AI/tech morning digest pipeline: collect → LLM-curate → blog-style digest + cover → multi-channel publish. Its LLM layer has always been a single provider — DeepSeek — wired through DEEPSEEK_API_KEY / DEEPSEEK_BASE_URL and the OpenAI SDK.

If you self-host this pipeline (or want to), you may have run into the same two frictions: DeepSeek's single endpoint locks the pipeline to one model family, and there's no built-in way to add routing, failover, or per-prompt guarding without forking the code. OrcaRouter is an OpenAI-compatible AI gateway — like OpenRouter, it exposes a provider/model namespace across many models — but it also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint. Adding orcarouter as a first-class provider means this project's users can use that stack directly, without treating OrcaRouter as an anonymous custom base URL.

What changed

This PR mirrors the existing DeepSeek wiring in src/config.py with a named OrcaRouter provider. The pipeline's LLM entry point now resolves like this:

  • Set ORCAROUTER_API_KEY → the pipeline runs entirely on OrcaRouter (https://api.orcarouter.ai/v1, default model orcarouter/auto), exactly like it runs on DeepSeek today. src/process.py is untouched — it only ever reads the resolved LLM_API_KEY / LLM_BASE_URL / LLM_MODEL.
  • Leave it unset → DeepSeek remains the default, byte-for-byte the current behavior.

It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.

Files touched:

  • src/config.py — named ORCAROUTER_* env vars and provider selection (empty-safe, consistent with the existing env_str fallback rule).
  • src/main.py — docstring lists the new env vars.
  • .env.example — documents the OrcaRouter option alongside DeepSeek.
  • CLAUDE.md — notes ORCAROUTER_API_KEY as the alternative provider secret.

Verification

  • python -m py_compile clean on all modules; full pipeline imports clean under both provider branches.
  • Live-tested against OrcaRouter through the real code path (src/config.pysrc/process.py → OpenAI SDK): plain chat completion returned 200 with pong, and JSON-mode completion (what DIGEST_PROMPT / FINALIZE_PROMPT use) parsed cleanly with _parse_json.
  • DeepSeek-default branch verified via a second run with ORCAROUTER_API_KEY unset.

Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter

I'm an engineer on the OrcaRouter team.

Adds ORCAROUTER_API_KEY / ORCAROUTER_BASE_URL / ORCAROUTER_MODEL env
vars so the pipeline can run entirely on OrcaRouter, an OpenAI-compatible
AI gateway. When ORCAROUTER_API_KEY is set it takes over all LLM calls
(config resolution only, process.py is untouched); otherwise DeepSeek
remains the default. Also documents the new provider in .env.example,
CLAUDE.md, and the main.py docstring.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant