Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Add OrcaRouter generator#470

Open
xilema2 wants to merge 1 commit into
weaviate:mainfrom
xilema2:feat/orcarouter-generator
Open

Add OrcaRouter generator#470
xilema2 wants to merge 1 commit into
weaviate:mainfrom
xilema2:feat/orcarouter-generator

Conversation

@xilema2

@xilema2 xilema2 commented May 26, 2026

Copy link
Copy Markdown

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/completions via httpx.AsyncClient
    • Reads API key from ORCAROUTER_API_KEY env var or in-UI config
    • Optional ORCAROUTER_API_BASE_URL env var (defaults to https://api.orcarouter.ai/v1)
    • Auto-fetches model list from GET /v1/models when 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/ and X-Title: Verba attribution headers (standard meta-router convention; OrcaRouter accepts but does not require them)
  • Registers OrcaRouterGenerator() in both the dev and production generator lists in goldenverba/components/managers.py

How to use

  1. Get an API key at https://www.orcarouter.ai
  2. Set it as ORCAROUTER_API_KEY env var, or paste it into the Verba UI's "API Key" field after selecting OrcaRouter in the Generator dropdown
  3. Pick a model (e.g. orcarouter/auto, openai/gpt-5, anthropic/claude-opus-4.7)
  4. Chat as normal

Docs: https://docs.orcarouter.ai · Model catalog: https://www.orcarouter.ai/models

Testing

  • pytest goldenverba/tests8 passed (no regressions)
  • Manual: instantiated OrcaRouterGenerator, verified it registers in managers.generators alongside the other generators
  • Verified GET https://api.orcarouter.ai/v1/models is reachable and returns the expected 150+ model list, used by the dropdown population logic
  • Local streaming chat tested end-to-end against orcarouter/auto and openai/gpt-4o-mini via the Verba UI

Notes for reviewers

  • Pattern is intentionally identical to AtlasCloudGenerator to minimize cognitive load
  • No new dependencies — only uses httpx / requests / dotenv / wasabi which are already in setup.py
  • No frontend changes; the new generator surfaces automatically via the existing generators list

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.

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

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?

@xilema2

xilema2 commented May 26, 2026

Copy link
Copy Markdown
Author

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. 🙏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants