Skip to content

feat(models): add OrcaRouter as a named model provider - #6688

Open
XiaoHuo888-hue wants to merge 1 commit into
google:mainfrom
XiaoHuo888-hue:feat/orcarouter-provider
Open

feat(models): add OrcaRouter as a named model provider#6688
XiaoHuo888-hue wants to merge 1 commit into
google:mainfrom
XiaoHuo888-hue:feat/orcarouter-provider

Conversation

@XiaoHuo888-hue

@XiaoHuo888-hue XiaoHuo888-hue commented Aug 12, 2026

Copy link
Copy Markdown

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

No issue exists for this change.

2. Or, if no issue exists, describe the change:

Problem:
Model names routed through an OpenAI-compatible aggregator that ADK does not yet know about fall through to LiteLLM; if LiteLLM does not list the provider, resolution fails with Model not found.

Solution:
Adds OrcaRouter as a model provider. OrcaRouter is an OpenAI-compatible model routing gateway that exposes 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax, xAI and others behind a single endpoint and API key. It also provides gateway-level security controls for AI agents.

This PR registers a named OrcaRouterLlm provider that mirrors the existing Claude subclass of AnthropicLlm: it only overrides client construction so requests go to OrcaRouter's Anthropic-compatible /v1/messages endpoint at https://api.orcarouter.ai, reading the key from ORCAROUTER_API_KEY. Model names like orcarouter/anthropic/claude-haiku-4.5 now resolve directly to the named provider, and orcarouter:... prefix syntax is supported as well.

Testing Plan

Please describe the tests that you ran to verify your changes. This is required
for all PRs that are not small documentation or typo fixes.

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Added tests/unittests/models/test_orca_router_llm.py (supported models, default model, model-name prefix stripping, client construction with ORCAROUTER_API_KEY / base URL, and the missing-credential error) and a registry resolution test in tests/unittests/models/test_models.py.

$ python -m pytest tests/unittests/models/ -q
1022 passed, 36 warnings in 33.36s

Manual End-to-End (E2E) Tests:

Live smoke test against the real OrcaRouter endpoint (ORCAROUTER_API_KEY set to a placeholder) through OrcaRouterLlm.generate_content_async reached https://api.orcarouter.ai/v1/messages and returned an OrcaRouter-level 401 AuthenticationError (orcarouter_api_error), confirming the base URL and request path are wired correctly.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

Contributions to this project require a signed Google Contributor License Agreement; this change is submitted on that basis.

I'm an engineer on the OrcaRouter team.

Adds OrcaRouterLlm, a lean subclass of AnthropicLlm that points the
Anthropic-compatible client at OrcaRouter's /v1/messages endpoint
(https://api.orcarouter.ai) and reads the credential from the
ORCAROUTER_API_KEY env var. Model names such as
orcarouter/anthropic/claude-haiku-4.5 resolve to the named provider
through the lazy registry, and the orcarouter:... prefix syntax works
too, so OrcaRouter-hosted models no longer fall through to the LiteLLM
passthrough (which does not list the orcarouter provider).

Adds unit tests for resolution, model-name handling, and client
construction, and a registry resolution test in test_models.py.

Co-Authored-By: Claude <noreply@anthropic.com>
@google-cla

google-cla Bot commented Aug 12, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@adk-bot adk-bot added the models [Component] This issue is related to model support label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

models [Component] This issue is related to model support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants