Skip to content

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

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

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

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Summary

Adds OrcaRouter as a named model provider in the ADK core.

OrcaRouter is an OpenAI-compatible model gateway that routes each request to a
model hosted by one of its upstream providers (Gemini, Claude, DeepSeek, Qwen,
etc.). 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.

Changes

  • New OrcaRouterLlm (core/.../models/OrcaRouterLlm.java): a BaseLlm that
    calls the gateway's /v1/chat/completions endpoint through the existing
    ChatCompletionsHttpClient, supporting both non-streaming and streaming
    responses (the same wiring ApigeeLlm uses for its chat-completions mode).
    • API key: ORCAROUTER_API_KEY (required).
    • Base URL: https://api.orcarouter.ai/v1 by default, overridable via
      ORCAROUTER_BASE_URL.
    • Model format: orcarouter/<model> (e.g. orcarouter/auto for smart
      routing, orcarouter/fusion). The orcarouter/ prefix is passed through
      as-is.
  • LlmRegistry: registers the orcarouter/.* pattern so agents can select the
    provider by model name: .model("orcarouter/auto").
  • OrcaRouterLlmTest: 8 unit tests mirroring the ApigeeLlm chat-completions
    coverage (model validation, request/streaming routing, request-level override,
    registry wiring, unsupported live connections).
  • README: short section on using the OrcaRouter gateway.

Verification

  • mvn -pl core test: 1757 tests, 0 failures, 0 errors (includes the 8 new
    OrcaRouter tests).
  • mvn -pl core com.spotify.fmt:fmt-maven-plugin:2.27:check: clean.
  • L3 live test with a real ORCAROUTER_API_KEY through the production
    OrcaRouterLlm code path:
    • orcarouter/auto, orcarouter/fusion, orcarouter/fusion-flash,
      orcarouter/fusion-mini: HTTP 200, model returned ORCA-LIVE-OK.
    • Streaming path: 4 SSE chunks emitted, no errors.

Disclosure: I'm an engineer on the OrcaRouter team.

Adds OrcaRouterLlm, a BaseLlm that calls the OrcaRouter model gateway's
OpenAI-compatible /v1/chat/completions endpoint via ChatCompletionsHttpClient,
supporting both non-streaming and streaming responses. The API key is read from
ORCAROUTER_API_KEY (default base URL https://api.orcarouter.ai/v1, overridable
via ORCAROUTER_BASE_URL). Registers the orcarouter/.* pattern in LlmRegistry so
agents can use models like orcarouter/auto or orcarouter/fusion directly.

Includes unit tests mirroring the existing ApigeeLlm chat-completions coverage
and a short README section.

Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>
@google-cla

google-cla Bot commented Aug 20, 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.

@hemasekhar-p hemasekhar-p self-assigned this Aug 21, 2026
@hemasekhar-p

Copy link
Copy Markdown
Contributor

Hi @XiaoHuo888-hue, thank you for your contribution and We appreciate you taking the time to submit this pull request. Since this is your first contribution, could you please complete the Google CLA so that we can proceed with the review?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants