Skip to content

Add OrcaRouter as a named provider - #255

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

Add OrcaRouter as a named provider#255
XiaoHuo888-hue wants to merge 1 commit into
IBM:mainfrom
XiaoHuo888-hue:feat/orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Add OrcaRouter as a named provider

This registers OrcaRouter the same way the existing openrouter provider is wired, so the provider picker, config reference and docs stay consistent. OrcaRouter is an OpenAI-compatible gateway: one ORCAROUTER_API_KEY (keys start with sk-orca-) unlocks 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax and xAI behind a single https://api.orcarouter.ai/v1 endpoint. 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.

I'm an engineer on the OrcaRouter team.

Changes

  • src/mcp_cli/model_management/gateway_providers.py (new) — built-in gateway provider definitions, registered into chuk_llm through its public register_provider() API at startup. Registration is idempotent: if a future chuk-llm release ships orcarouter natively, mcp-cli leaves it untouched.
  • src/mcp_cli/model_management/model_manager.py — call register_gateway_providers() when initializing the chuk_llm config manager, so orcarouter shows up in /providers list out of the box.
  • src/mcp_cli/auth/provider_tokens.py — map orcarouterORCAROUTER_API_KEY in PROVIDER_ENV_VAR_MAP (first-class status alongside openrouter).
  • README.md — document the provider in the provider table, the env var in prerequisites, and add a /provider orcarouter example.
  • tests/model_management/test_gateway_providers.py (new) — unit tests for registration behavior and the env var mapping.

Default model is openai/gpt-4o-mini (a fixed, tool-calling-safe model) rather than the smart router orcarouter/auto, so agentic/tool workflows are reliable out of the box.

Verification

  • pytest tests/model_management tests/auth — 176 passed (includes 6 new gateway-provider tests)
  • pytest tests/llm tests/config tests/cli — 446 passed, 8 skipped; the 8 failures in tests/cli/test_main_coverage.py / test_run_command_extended.py are pre-existing on main (confirmed via clean-checkout repro, unrelated to this change)
  • mypy on changed modules — no issues
  • ruff format --check — clean (the only ruff check findings are pre-existing BLE001/I001/SIM118/UP037 in unchanged code)
  • Live test against the real OrcaRouter gateway through the registered provider path: get_client('orcarouter', 'openai/gpt-4o-mini') → 200, PONG reply; ModelManager surfaces orcarouter (16 providers) and returns openai/gpt-4o-mini as the default

Register OrcaRouter (https://www.orcarouter.ai) into chuk_llm at startup
so users can select it by name via /provider orcarouter with their own
ORCAROUTER_API_KEY. Registration is idempotent: if a future chuk-llm
release ships the provider natively, mcp-cli leaves it untouched.

- gateway_providers.py: built-in gateway provider definitions registered
  through chuk_llm's public register_provider() API
- model_manager.py: register gateway providers when initializing chuk_llm
- provider_tokens.py: map orcarouter -> ORCAROUTER_API_KEY
- README.md: document the provider, env var, and /provider example
- tests: unit tests for registration and env var mapping

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