Add OrcaRouter as a named LLM provider - #162
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
Conversation
Wire OrcaRouter the same way the OpenRouter provider is: a thin OpenAI-compatible wrapper pointed at https://api.orcarouter.ai/v1, registered from ORCAROUTER_API_KEY ahead of the OpenRouter fallback, with model-id translation to OrcaRouter's catalog ids (claude-sonnet-4-6 -> anthropic/claude-sonnet-4.6, auto -> orcarouter/auto). Co-Authored-By: Claude <noreply@anthropic.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.
Adds OrcaRouter as a named LLM provider, wired the same way the existing
OpenRouter provider is — so the provider registry, model selection and docs
stay consistent.
What's in the change
OrcaRouterProviderincrates/chidori/src/providers/orcarouter.rs— athin wrapper over the OpenAI-compatible client pointed at
https://api.orcarouter.ai/v1/chat/completions.ProviderRegistry::from_env()registers it wheneverORCAROUTER_API_KEYisset, ahead of the OpenRouter fallback, so an explicit OrcaRouter key wins
over the zero-setup OAuth sign-in.
to_orcarouter_slug()translates Chidori model ids to OrcaRouter's catalogids on the way out:
claude-sonnet-4-6→anthropic/claude-sonnet-4.6,auto→orcarouter/auto,gpt-4o→openai/gpt-4o, and explicitcatalog ids (anything containing
/) pass through untouched.ORCAROUTER_API_KEYis surfaced wherever a provider key is documented(CLI demo,
inithelp text, README, docs).This registers OrcaRouter the same way the
existing
OpenRouterprovider is wired, so the provider registry, configreference and docs stay consistent. OrcaRouter is an OpenAI-compatible
gateway: one
ORCAROUTER_API_KEY(keys start withsk-orca-) unlocks 150+models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax and xAI behind
a single
https://api.orcarouter.ai/v1endpoint. 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.
Verification
cargo test -p chidori --lib providers::orcarouter— 5/5 pass (new slugtranslation tests).
cargo test -p chidori --lib: 445 pass / 29 fail on this branch vs440 pass / 29 fail on
main— the 29 failures are byte-for-byte identicalon both, pre-existing Windows temp-path issues in
host_actor,host_branchandtypescript::loadertests that this PR does not touch.The PR adds 5 new passing tests and no new failures. (Three replay tests
additionally fail only when an
ANTHROPIC_MODELenv var is set in theshell — this dev session runs via a gateway; with it unset they pass.)
https://api.orcarouter.ai/v1with a real key:GET /models→ 200 (189 models); chat completion onanthropic/claude-sonnet-4.6→ 200;orcarouter/autosmart routing → 200;invalid key → 401.
cargo fmt --checkand clippy are clean on the changed files (the repoalready has unrelated fmt diffs and three clippy warnings on
mainhead).I'm an engineer on the OrcaRouter team.