Skip to content

feat: add OrcaRouter as an LLM provider#12439

Open
zhenjunchen-png wants to merge 4 commits into
continuedev:mainfrom
zhenjunchen-png:add-orcarouter-provider
Open

feat: add OrcaRouter as an LLM provider#12439
zhenjunchen-png wants to merge 4 commits into
continuedev:mainfrom
zhenjunchen-png:add-orcarouter-provider

Conversation

@zhenjunchen-png
Copy link
Copy Markdown

@zhenjunchen-png zhenjunchen-png commented May 19, 2026

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, DeepSeek
V4, Grok, Qwen, MiniMax and ~120 other chat models across 9 vendors. There's also
an orcarouter/auto virtual model that adaptively routes each request based on
a configurable cheapest / balanced / quality / contextual-bandit / difficulty-gated
strategy.

Disclosure: I'm an engineer on the OrcaRouter team.

Followed the same patterns as CometAPI (#7809), ClawRouter (#11751), and
Tensorix (#11184), including the User-Agent: Continue/IDE and
X-Continue-Provider: orcarouter attribution headers introduced by ClawRouter.

What's in the PR

Core (core/)

  • core/llm/llms/OrcaRouter.ts — provider class extending OpenAI; injects
    attribution headers and reuses the existing Anthropic cache_control
    pass-through for Claude models
  • core/llm/llms/index.ts — register in LLMClasses
  • core/llm/autodetect.ts — added to PROVIDER_HANDLES_TEMPLATING and
    PROVIDER_SUPPORTS_IMAGES
  • core/llm/toolSupport.ts — per-model tool-calling whitelist; skips image-only
    models that occasionally appear in orcarouter/auto's default routing pool
  • core/control-plane/schema.ts — schema validation for Continue Hub

Adapter package (packages/openai-adapters/)

  • packages/openai-adapters/src/apis/OrcaRouter.ts — adapter class exporting
    ORCAROUTER_HEADERS
  • packages/openai-adapters/src/apis/AiSdk.ts — register in PROVIDER_MAP
  • packages/openai-adapters/src/index.ts / src/types.ts — factory wiring and
    zod literal

UI (extensions/vscode/, gui/)

  • extensions/vscode/config_schema.json — provider enum + description
  • gui/src/pages/AddNewModel/configs/{providers,models}.ts — provider card
    with 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 calls
    GET /v1/models against the user's apiBase
  • gui/public/logos/orcarouter.png — logo (1024×1024)

Docs (docs/)

  • docs/customize/model-providers/more/orcarouter.mdx — usage docs with
    reasoning_effort / Anthropic thinking block / extra_body fallback chain
    examples plus the AUTO router tool-calling caveat
  • docs/customize/model-providers/overview.mdx — Hosted Services table row
  • docs/docs.json — sidebar entry under "More Providers"

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

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 covering
    default apiBase, custom apiBase override, attribution headers, and standard
    OpenAI headers (patterned on ClawRouter.test.ts).
  • Manually smoke tested inside the VS Code dev host with a real sk-orca- key
    across chat / agent / edit flows; screencast attached above.

@zhenjunchen-png zhenjunchen-png requested a review from a team as a code owner May 19, 2026 12:49
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@zhenjunchen-png
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 18 files

Re-trigger cubic

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).
@zhenjunchen-png zhenjunchen-png force-pushed the add-orcarouter-provider branch from a616288 to 3976f4e Compare May 19, 2026 13:07
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant