Add OrcaRouter generator#470
Conversation
Adds OrcaRouterGenerator as a new Generator option. OrcaRouter is an OpenAI-compatible meta-router that exposes 150+ upstream LLMs through a single API key, with a virtual orcarouter/auto model that picks an upstream per-request based on a configurable routing policy. Modeled after AtlasCloudGenerator: httpx streaming, env-var fallback for API key (ORCAROUTER_API_KEY) and base URL (ORCAROUTER_API_BASE_URL), auto-fetch of model list from GET /v1/models with a curated default list as fallback. Standard meta-router attribution headers (HTTP-Referer / X-Title) are included. Disclosure: I'm an engineer on the OrcaRouter team.
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
Hi maintainers, thanks for the review! CLA: I have read and I agree to the terms of the Weaviate Contributor License Agreement. This contribution is my own work and I have the right to submit it under the project's license. Disclosure: For full transparency, I'm an engineer on the OrcaRouter team. This PR adds OrcaRouter as an additional LLM provider option following the same pattern as the existing AtlasCloudGenerator — it introduces no new dependencies, is fully opt-in (requires the user to configure ORCAROUTER_API_KEY), and doesn't alter any existing generator behavior. Happy to adjust naming, attribution headers, or the fallback model list if you'd prefer a different approach. Let me know if there's anything else you'd like me to change before merge. 🙏 |
Summary
Adds OrcaRouter as a new Generator option in Verba.
OrcaRouter is an OpenAI-compatible meta-router that exposes 150+ upstream LLMs from OpenAI, Anthropic, Google, DeepSeek, xAI, Qwen, MiniMax and others through a single API key. The virtual
orcarouter/automodel picks an upstream per-request based on a configurable routing policy (cheapest / balanced / quality / adaptive bandit).Inspired by the existing
AtlasCloudGenerator/NovitaGeneratorimplementations — samehttpxasync streaming loop, sameInputConfigshape, same env-var fallback approach.Disclosure: I'm an engineer on the OrcaRouter team.
Changes
goldenverba/components/generation/OrcaRouterGenerator.pychat/completionsviahttpx.AsyncClientORCAROUTER_API_KEYenv var or in-UI configORCAROUTER_API_BASE_URLenv var (defaults tohttps://api.orcarouter.ai/v1)GET /v1/modelswhen an API key is present; falls back to a curated default list (8 flagship models incl.orcarouter/auto) when no key is configured, so the dropdown is never empty on first launchHTTP-Referer: https://verba.weaviate.io/andX-Title: Verbaattribution headers (standard meta-router convention; OrcaRouter accepts but does not require them)OrcaRouterGenerator()in both the dev and production generator lists ingoldenverba/components/managers.pyHow to use
ORCAROUTER_API_KEYenv var, or paste it into the Verba UI's "API Key" field after selecting OrcaRouter in the Generator dropdownorcarouter/auto,openai/gpt-5,anthropic/claude-opus-4.7)Docs: https://docs.orcarouter.ai · Model catalog: https://www.orcarouter.ai/models
Testing
pytest goldenverba/tests— 8 passed (no regressions)OrcaRouterGenerator, verified it registers inmanagers.generatorsalongside the other generatorsGET https://api.orcarouter.ai/v1/modelsis reachable and returns the expected 150+ model list, used by the dropdown population logicorcarouter/autoandopenai/gpt-4o-minivia the Verba UINotes for reviewers
AtlasCloudGeneratorto minimize cognitive loadhttpx/requests/dotenv/wasabiwhich are already insetup.pygeneratorslist