feat: add OrcaRouter as a named provider - #111
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
Conversation
Add PREFERRED_PROVIDER=orcarouter, mapping haiku/sonnet to anthropic/claude-haiku-4.5 and anthropic/claude-sonnet-4.6 by default and routing them through OrcaRouter's OpenAI-compatible endpoint (ORCAROUTER_API_KEY + ORCAROUTER_BASE_URL, default https://api.orcarouter.ai/v1). Skips the 16384 max_tokens cap for OrcaRouter models so Claude output limits are not truncated. Documents the provider in the README and .env.example. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: XiaoHuo888 <sjh00112233@outlook.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.
Summary
Adds a dedicated
orcarouterprovider to the proxy, mirroring how the existingopenai,google, andanthropicproviders are wired.OrcaRouter is an OpenAI-compatible model routing gateway that brings 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax and xAI behind a single endpoint and API key. Beyond routing, it 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. This PR registers it as a named provider so users can opt in directly.
I'm an engineer on the OrcaRouter team.
Changes
server.py: newORCAROUTER_API_KEY/ORCAROUTER_BASE_URLenv vars (base defaults tohttps://api.orcarouter.ai/v1).PREFERRED_PROVIDER=orcaroutermapshaiku/sonnettoanthropic/claude-haiku-4.5/anthropic/claude-sonnet-4.6by default (overridable viaBIG_MODEL/SMALL_MODEL) and routes the resultingopenai/*models through OrcaRouter's endpoint. The 16384max_tokenscap is skipped for OrcaRouter so Claude output limits are not truncated.README.md: documents theorcarouterprovider, its env vars and mapping logic, and an Example 5 config block..env.example: addsORCAROUTER_API_KEY,ORCAROUTER_BASE_URL, and an OrcaRouter mapping example.Verification
openaiprovider still capsmax_tokensat 16384)./v1/messagesrequests both return 200 —claude-sonnet-4-5maps toopenai/anthropic/claude-sonnet-4.6and is routed tohttps://api.orcarouter.ai/v1.anthropic/claude-sonnet-4.6,anthropic/claude-haiku-4.5,openai/gpt-4o,google/gemini-2.5-flash);orcarouter/autoverified live with a 200 response.Notes
No new dependencies — OrcaRouter speaks the OpenAI wire format, which LiteLLM already handles. This repo's only workflow publishes a Docker image on push to
main, so PRs do not trigger CI.