feat(models): add OrcaRouter as a named model provider - #1445
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
feat(models): add OrcaRouter as a named model provider#1445XiaoHuo888-hue wants to merge 1 commit into
XiaoHuo888-hue wants to merge 1 commit into
Conversation
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>
|
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. |
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
OrcaRouterLlm(core/.../models/OrcaRouterLlm.java): aBaseLlmthatcalls the gateway's
/v1/chat/completionsendpoint through the existingChatCompletionsHttpClient, supporting both non-streaming and streamingresponses (the same wiring ApigeeLlm uses for its chat-completions mode).
ORCAROUTER_API_KEY(required).https://api.orcarouter.ai/v1by default, overridable viaORCAROUTER_BASE_URL.orcarouter/<model>(e.g.orcarouter/autofor smartrouting,
orcarouter/fusion). Theorcarouter/prefix is passed throughas-is.
LlmRegistry: registers theorcarouter/.*pattern so agents can select theprovider by model name:
.model("orcarouter/auto").OrcaRouterLlmTest: 8 unit tests mirroring the ApigeeLlm chat-completionscoverage (model validation, request/streaming routing, request-level override,
registry wiring, unsupported live connections).
Verification
mvn -pl core test: 1757 tests, 0 failures, 0 errors (includes the 8 newOrcaRouter tests).
mvn -pl core com.spotify.fmt:fmt-maven-plugin:2.27:check: clean.ORCAROUTER_API_KEYthrough the productionOrcaRouterLlmcode path:orcarouter/auto,orcarouter/fusion,orcarouter/fusion-flash,orcarouter/fusion-mini: HTTP 200, model returnedORCA-LIVE-OK.Disclosure: I'm an engineer on the OrcaRouter team.