feat: add OrcaRouter as a named OpenAI-compatible provider - #622
Open
JinhaoSong322 wants to merge 1 commit into
Open
feat: add OrcaRouter as a named OpenAI-compatible provider#622JinhaoSong322 wants to merge 1 commit into
JinhaoSong322 wants to merge 1 commit into
Conversation
Add OrcaRouter (https://www.orcarouter.ai) as a first-class model provider alongside OpenAI, Anthropic, and Gemini. - backend/llm.py: register 'orcarouter/auto' as an OrcaRouter model and expose ORCAROUTER_MODELS. - backend/agent/providers/factory.py: dispatch OrcaRouter models to the existing OpenAI-compatible Responses session against https://api.orcarouter.ai/v1. - backend/routes/generate_code.py: accept ORCAROUTER_API_KEY from env or the settings dialog; when set, use the OrcaRouter gateway model for all variants. - backend/evals/core.py, config.py, agent/engine.py, tools/runtime.py: thread the OrcaRouter key/base URL through the agent pipeline. - frontend: add OrcaRouter key/base URL fields to the Settings dialog and register the model in lib/models.ts. Verified: backend pytest (276 passed), frontend tsc + eslint + jest pass, and a live request through the new provider path returns a 200 response from the OrcaRouter Responses API. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OrcaRouter as a named OpenAI-compatible provider
Adds OrcaRouter as a first-class model provider alongside OpenAI, Anthropic, and Gemini. OrcaRouter is an OpenAI-compatible gateway that routes each request to the best available model automatically via
orcarouter/auto. 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.What changed
backend/llm.py— registerorcarouter/autoand exposeORCAROUTER_MODELS.backend/agent/providers/factory.py— dispatch OrcaRouter models to the existing OpenAI-compatible Responses session, pointed athttps://api.orcarouter.ai/v1.backend/routes/generate_code.py— acceptORCAROUTER_API_KEYfrombackend/.envor the settings dialog; when set, use the OrcaRouter gateway model for every variant.backend/config.py,backend/evals/core.py,backend/agent/engine.py,backend/agent/tools/runtime.py— thread the OrcaRouter key/base URL through the agent pipeline and eval runner.frontend— add OrcaRouter API key + base URL fields to the Settings dialog, and registerorcarouter/autoinlib/models.ts.README.md— document the new key.How it works
The app already has an OpenAI-compatible code path that talks to the Responses API with configurable
base_url. OrcaRouter exposes the same endpoint shape, so this reuses that proven session — no new transport or streaming code.Verification
pytest— 276 passed.tsc --noEmitclean,eslintclean on changed files,jest— 42 passed.create_provider_sessionfororcarouter/auto) returned a streaming 200 response fromhttps://api.orcarouter.ai/v1/responses.Disclosure: I'm an engineer on the OrcaRouter team.