Skip to content

feat: add OrcaRouter as a named provider - #111

Open
XiaoHuo888-hue wants to merge 1 commit into
1rgs:mainfrom
XiaoHuo888-hue:feat/add-orcarouter-provider
Open

feat: add OrcaRouter as a named provider#111
XiaoHuo888-hue wants to merge 1 commit into
1rgs:mainfrom
XiaoHuo888-hue:feat/add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Summary

Adds a dedicated orcarouter provider to the proxy, mirroring how the existing openai, google, and anthropic providers 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: new ORCAROUTER_API_KEY / ORCAROUTER_BASE_URL env vars (base defaults to https://api.orcarouter.ai/v1). PREFERRED_PROVIDER=orcarouter maps haiku/sonnet to anthropic/claude-haiku-4.5 / anthropic/claude-sonnet-4.6 by default (overridable via BIG_MODEL/SMALL_MODEL) and routes the resulting openai/* models through OrcaRouter's endpoint. The 16384 max_tokens cap is skipped for OrcaRouter so Claude output limits are not truncated.
  • README.md: documents the orcarouter provider, its env vars and mapping logic, and an Example 5 config block.
  • .env.example: adds ORCAROUTER_API_KEY, ORCAROUTER_BASE_URL, and an OrcaRouter mapping example.

Verification

  • Mapping unit checks: 11/11 pass (including a regression guard that the openai provider still caps max_tokens at 16384).
  • L3 live test against the running proxy with a real OrcaRouter key: non-streaming and streaming /v1/messages requests both return 200 — claude-sonnet-4-5 maps to openai/anthropic/claude-sonnet-4.6 and is routed to https://api.orcarouter.ai/v1.
  • Documented model ids are all present in OrcaRouter's catalog (anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.5, openai/gpt-4o, google/gemini-2.5-flash); orcarouter/auto verified 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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant