Add OrcaRouter as a named provider - #255
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
Conversation
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>
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.
Add OrcaRouter as a named provider
This registers OrcaRouter the same way the existing
openrouterprovider is wired, so the provider picker, config reference and docs stay consistent. OrcaRouter is an OpenAI-compatible gateway: oneORCAROUTER_API_KEY(keys start withsk-orca-) unlocks 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax and xAI behind a singlehttps://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.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 publicregister_provider()API at startup. Registration is idempotent: if a future chuk-llm release shipsorcarouternatively, mcp-cli leaves it untouched.src/mcp_cli/model_management/model_manager.py— callregister_gateway_providers()when initializing the chuk_llm config manager, soorcaroutershows up in/providers listout of the box.src/mcp_cli/auth/provider_tokens.py— maporcarouter→ORCAROUTER_API_KEYinPROVIDER_ENV_VAR_MAP(first-class status alongsideopenrouter).README.md— document the provider in the provider table, the env var in prerequisites, and add a/provider orcarouterexample.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 routerorcarouter/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 intests/cli/test_main_coverage.py/test_run_command_extended.pyare pre-existing onmain(confirmed via clean-checkout repro, unrelated to this change)mypyon changed modules — no issuesruff format --check— clean (the onlyruff checkfindings are pre-existingBLE001/I001/SIM118/UP037in unchanged code)get_client('orcarouter', 'openai/gpt-4o-mini')→ 200,PONGreply;ModelManagersurfacesorcarouter(16 providers) and returnsopenai/gpt-4o-minias the default