Add OrcaRouter generator
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/auto model picks an upstream per-request based on a configurable routing policy (cheapest / balanced / quality / adaptive bandit).
Inspired by the existing AtlasCloudGenerator / NovitaGenerator implementations — same httpx async streaming loop, same InputConfig shape, same env-var fallback approach.
Disclosure: I'm an engineer on the OrcaRouter team.
Changes
- New file:
goldenverba/components/generation/OrcaRouterGenerator.py- Streams
chat/completionsviahttpx.AsyncClient - Reads API key from
ORCAROUTER_API_KEYenv var or in-UI config - Optional
ORCAROUTER_API_BASE_URLenv var (defaults tohttps://api.orcarouter.ai/v1) - Auto-fetches model list from
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 launch - Adds
HTTP-Referer: https://verba.weaviate.io/andX-Title: Verbaattribution headers (standard meta-router convention; OrcaRouter accepts but does not require them)
- Streams
- Registers
OrcaRouterGenerator()in both the dev and production generator lists ingoldenverba/components/managers.py
How to use
- Get an API key at https://www.orcarouter.ai
- Set it as
ORCAROUTER_API_KEYenv var, or paste it into the Verba UI's "API Key" field after selecting OrcaRouter in the Generator dropdown - Pick a model (e.g.
orcarouter/auto,openai/gpt-5,anthropic/claude-opus-4.7) - Chat as normal
Docs: https://docs.orcarouter.ai · Model catalog: https://www.orcarouter.ai/models
Testing
pytest goldenverba/tests— 8 passed (no regressions)- Manual: instantiated
OrcaRouterGenerator, verified it registers inmanagers.generatorsalongside the other generators - Verified
GET https://api.orcarouter.ai/v1/modelsis reachable and returns the expected 150+ model list, used by the dropdown population logic - Local streaming chat tested end-to-end against
orcarouter/autoandopenai/gpt-4o-minivia the Verba UI
Notes for reviewers
- Pattern is intentionally identical to
AtlasCloudGeneratorto minimize cognitive load - No new dependencies — only uses
httpx/requests/dotenv/wasabiwhich are already insetup.py - No frontend changes; the new generator surfaces automatically via the existing
generatorslist
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.
beep boop - the Weaviate bot 👋🤖
PS:
Are you already a member of the Weaviate Forum?
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.beep boop - the Weaviate bot 👋🤖PS:Are you already a member of the Weaviate Forum?
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. 🙏