Skip to content

feat: add OrcaRouter as a built-in OpenAI-compatible provider - #941

Open
Marc-oss-hub wants to merge 1 commit into
modelscope:mainfrom
Marc-oss-hub:feat/orcarouter-provider
Open

feat: add OrcaRouter as a built-in OpenAI-compatible provider#941
Marc-oss-hub wants to merge 1 commit into
modelscope:mainfrom
Marc-oss-hub:feat/orcarouter-provider

Conversation

@Marc-oss-hub

Copy link
Copy Markdown

Adds OrcaRouter as a built-in OpenAI-compatible provider, mirroring how OpenRouter is wired into the data-driven provider layer.

OrcaRouter is an OpenAI-compatible gateway that reaches 100+ model providers through a single 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.

Changes

  • ms_agent/llm/spec.py: new orcarouter ProviderSpec (openai_compat transport, ORCAROUTER_API_KEY / ORCAROUTER_BASE_URL env chain, default base https://api.orcarouter.ai/v1), mirroring the openrouter entry — one data-driven spec, no new class
  • tests/llm/test_provider_layer.py: orcarouter added to EXPECTED_PROVIDERS + spec-shape test test_orcarouter_uses_orca_env
  • tests/llm/test_provider_router_live.py: orcarouter in PROVIDERS (orcarouter/auto) + test_orcarouter live test (skips without ORCAROUTER_API_KEY, same pattern as OpenRouter)
  • webui/backend/tests/test_providers.py: orcarouter added to _EXPECTED_BUILTINS (WebUI "fill an API key" catalog)
  • webui/backend/.env.example: orcarouter listed among known registry ids

Verification

  • Registry check (isolated spec import): orcarouter resolves with the expected transport / env chain / default base URL; list_providers() includes it; case-insensitive lookup works
  • Live probe against https://api.orcarouter.ai/v1 with orcarouter/auto: non-stream completion and a tool call (mkdir{"dir_name":"demo"}) both returned (auto-routed to deepseek-v4-pro / MiniMax-M2.7 across probes)
  • py_compile + flake8 clean on changed files; formatting matches the adjacent openrouter entry

I'm an engineer on the OrcaRouter team.

Add a data-driven ProviderSpec entry for OrcaRouter, mirroring the
OpenRouter entry: ORCAROUTER_API_KEY / ORCAROUTER_BASE_URL env chain,
default base https://api.orcarouter.ai/v1, OpenAI-compatible transport.
Covers the registry-catalog unit test, a live provider test (skips without
a key), and the WebUI built-in catalog + provider-id docs.
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