Repository navigation
feat: add OrcaRouter as a first-class LLM provider - #582
Open
armyluki-wq wants to merge 1 commit into
Open
armyluki-wq wants to merge 1 commit into
armyluki-wq wants to merge 1 commit into
Conversation
Signed-off-by: armyluki-wq <armyluki-wq@users.noreply.github.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
This adds OrcaRouter as a named provider next to the existing ones. OrcaRouter is an OpenAI-compatible AI gateway that routes many providers behind one 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.
Buttercup reaches every model through the LiteLLM proxy, so the integration lands in three places, all under the OrcaRouter name rather than as a generic custom base URL:
Provider registration (
litellm/litellm_config.yaml, mirrored indeployment/k8s/values.yaml)orcarouter-orcacyber-zero→orcacyber-zero, the recommended default, withorcarouter/fusionas the fallback for deployments where the cyber tier is not unlocked yet.orcarouter-auto,orcarouter-deepseek-v4-pro,orcarouter-deepseek-v4-flashfor general traffic.api_base(https://api.orcarouter.ai/v1) and its ownapi_key: os.environ/ORCAROUTER_API_KEY. Nothing is derived fromOPENAI_API_KEYor the OpenAI base URL, so a deployment that does not use OrcaRouter behaves exactly as before.OrcaCyber Zero is aimed at security teams that have completed business verification, and it allows authorized security work that general-purpose gateways often refuse.
Model catalog (
common/src/buttercup/common/orcarouter.py)GET https://api.orcarouter.ai/v1/models?capability=chatwith a bound on response size and a short timeout, then filters out records whosesupported_endpoint_typescontain no dialect the client speaks. Modality metadata is parsed strictly and fails closed, so the multimodal selector can never offer a model that does not declare image input.ORCAROUTER_API_KEY. A masking helper renders it as a prefix plus the last four characters for display; the full value is never logged, returned by an endpoint or written anywhere.create_orcarouter_llmbuilds the LangChain chat model against the gateway for callers that need a client rather than the proxy.Dashboard (
orchestrator/src/.../ui/competition_api,static/index.html,static/script.js,static/styles.css)GET /v1/providers/orcarouterreturns the provider identity, authentication method, key environment variable name, masked key and the capability/catalog summary.GET /v1/providers/orcarouter/models?capability=chat|multimodalreturns the selectable models.not configuredinstead of an error, and a malformed catalog response returns HTTP 400 rather than a stack trace.Tests
common/tests/test_orcarouter.pycovers catalog parsing, endpoint-dialect filtering, multimodal selection, seed fallback, error paths, key masking and the LangChain factory.orchestrator/test/test_orcarouter_provider_api.pycovers both API routes, the capability filtering, the unconfigured-key path and that the existing dashboard routes are unchanged.orchestrator/test/test_orcarouter_ui_evidence.pyboots the real dashboard with uvicorn and drives it with Playwright and headless Chromium to record the auth panel and both model dropdowns from the live catalog; it is the source of the UI screenshots attached to this PR.ruff checkandruff format --checkpass on every changed Python file.I'm an engineer on the OrcaRouter team.
🤖 Generated with Claude Code