feat: add OrcaRouter as an LLM provider#12439
Open
zhenjunchen-png wants to merge 4 commits into
Open
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
OrcaRouter (https://www.orcarouter.ai) is an OpenAI-compatible API gateway that aggregates ~120 chat models from OpenAI, Anthropic, Google, DeepSeek, xAI, Qwen, Kimi, MiniMax, Z-AI and others behind a single sk-orca- key. It also exposes an orcarouter/auto virtual model with configurable adaptive routing (cheapest / balanced / quality / contextual bandit / difficulty-gated). Provider class extends OpenAI and injects attribution headers (HTTP-Referer, X-Title, User-Agent, X-Continue-Provider) and reuses the existing Anthropic cache_control pass-through for Claude models. Also registers orcarouter in the AI SDK provider map for use via `provider: ai-sdk`. Follows the same patterns as CometAPI (continuedev#7809), ClawRouter (continuedev#11751), and Tensorix (continuedev#11184). Disclosure: I am an engineer on the OrcaRouter team.
Documentation for the OrcaRouter provider with usage examples covering: - Quickstart YAML and JSON config - Pinning specific upstream models - Reasoning controls (OpenAI reasoning_effort, Anthropic thinking block, Gemini caveat) - extra_body fallback chain - Agent / tool-calling caveat for orcarouter/auto - Anthropic prompt caching Also adds the OrcaRouter row to the providers overview Hosted Services table and registers the page in the docs sidebar.
core/llm/llms/OrcaRouter.vitest.ts — seven cases covering provider name, default options, attribution header injection, user header override, and Anthropic prompt-caching pass-through (patterned on OpenRouter.vitest.ts). packages/openai-adapters/src/apis/OrcaRouter.test.ts — four cases covering default apiBase, custom apiBase override, attribution headers, and standard OpenAI headers (patterned on ClawRouter.test.ts).
a616288 to
3976f4e
Compare
The previous implementation merged attribution headers into the config's requestOptions.headers via the constructor, but the OpenAIApi base class reads headers from getHeaders() rather than that field. As a result the HTTP-Referer / X-Title / User-Agent / X-Continue-Provider headers were never sent on requests. Switching to the override-getHeaders pattern (the same pattern ClawRouter uses in this package) wires the headers correctly and makes the adapter unit tests in OrcaRouter.test.ts pass.
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.
Description
This PR adds OrcaRouter as a new OpenAI-compatible
provider — one
sk-orca-key gets you GPT-5, Claude Opus 4.7, Gemini 3, DeepSeekV4, Grok, Qwen, MiniMax and ~120 other chat models across 9 vendors. There's also
an
orcarouter/autovirtual model that adaptively routes each request based ona configurable cheapest / balanced / quality / contextual-bandit / difficulty-gated
strategy.
Followed the same patterns as CometAPI (#7809), ClawRouter (#11751), and
Tensorix (#11184), including the
User-Agent: Continue/IDEandX-Continue-Provider: orcarouterattribution headers introduced by ClawRouter.What's in the PR
Core (
core/)core/llm/llms/OrcaRouter.ts— provider class extending OpenAI; injectsattribution headers and reuses the existing Anthropic
cache_controlpass-through for Claude models
core/llm/llms/index.ts— register inLLMClassescore/llm/autodetect.ts— added toPROVIDER_HANDLES_TEMPLATINGandPROVIDER_SUPPORTS_IMAGEScore/llm/toolSupport.ts— per-model tool-calling whitelist; skips image-onlymodels that occasionally appear in
orcarouter/auto's default routing poolcore/control-plane/schema.ts— schema validation for Continue HubAdapter package (
packages/openai-adapters/)packages/openai-adapters/src/apis/OrcaRouter.ts— adapter class exportingORCAROUTER_HEADERSpackages/openai-adapters/src/apis/AiSdk.ts— register inPROVIDER_MAPpackages/openai-adapters/src/index.ts/src/types.ts— factory wiring andzod literal
UI (
extensions/vscode/,gui/)extensions/vscode/config_schema.json— provider enum + descriptiongui/src/pages/AddNewModel/configs/{providers,models}.ts— provider cardwith 8 vendor-prefixed presets (
OrcaRouter Auto,OpenAI: GPT-5.5,Anthropic: Claude Opus 4.7,Google: Gemini 3 Flash Preview,DeepSeek: DeepSeek V4 Pro,xAI: Grok 4.3,Alibaba: Qwen 3.6 Flash,MiniMax: MiniMax M2.7) plus an AUTODETECT fallback that callsGET /v1/modelsagainst the user'sapiBasegui/public/logos/orcarouter.png— logo (1024×1024)Docs (
docs/)docs/customize/model-providers/more/orcarouter.mdx— usage docs withreasoning_effort/ Anthropicthinkingblock /extra_bodyfallback chainexamples plus the AUTO router tool-calling caveat
docs/customize/model-providers/overview.mdx— Hosted Services table rowdocs/docs.json— sidebar entry under "More Providers"AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
continue-v2-compressed.mp4
Tests
core/llm/llms/OrcaRouter.vitest.ts— 7 cases covering provider name,default options, attribution header injection, user header override, and
Anthropic prompt-caching pass-through (patterned on
OpenRouter.vitest.ts).packages/openai-adapters/src/apis/OrcaRouter.test.ts— 4 cases coveringdefault apiBase, custom apiBase override, attribution headers, and standard
OpenAI headers (patterned on
ClawRouter.test.ts).sk-orca-keyacross chat / agent / edit flows; screencast attached above.