feat: add OrcaRouter as a built-in OpenAI-compatible provider - #4007
Open
JinhaoSong322 wants to merge 1 commit into
Open
feat: add OrcaRouter as a built-in OpenAI-compatible provider#4007JinhaoSong322 wants to merge 1 commit into
JinhaoSong322 wants to merge 1 commit into
Conversation
Adds orcarouter as a first-class built-in alias provider, mirroring the existing openrouter entry: - aliases.go: register orcarouter with base_url https://api.orcarouter.ai/v1 and ORCAROUTER_API_KEY - config/auto.go: register orcarouter in cloudProviders (auto-selection) and DefaultModels (orcarouter/auto adaptive router) - openai client: treat orcarouter as an open-model host so consecutive system messages are merged before sending - docs: new providers/orcarouter page, plus rows in the provider overview, concepts/models table, and configuration/models provider list - agent-schema.json: document the new alias in the provider description - tests: cover the alias config, auto-selection, default model, and max tokens for orcarouter Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>
Collaborator
|
👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push. Commits that are not verified: See GitHub's guide on signing commits for setup instructions. I've added |
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 first-class built-in OpenAI-compatible provider, mirroring the existing
openrouteralias.OrcaRouter is a unified gateway that routes to models from many providers (Anthropic, OpenAI, DeepSeek, Qwen, Google, and more) through a single OpenAI-compatible endpoint. 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.
What changed
pkg/model/provider/aliases.go— registerorcarouteralias: API typeopenai, base URLhttps://api.orcarouter.ai/v1, token env varORCAROUTER_API_KEY.pkg/config/auto.go— registerorcarouterincloudProviders(so it participates in auto-selection) and inDefaultModels(orcarouter/auto, the gateway's adaptive router).pkg/model/provider/openai/client.go— treatorcarouteras an open-model host so consecutive system messages are merged before sending (it fronts open-weight models from many vendors).docs/providers/orcarouter/index.md— new provider page (setup, inline + named model usage, how it works).docs/providers/overview/index.md,docs/concepts/models/index.md,docs/configuration/models/index.md— OrcaRouter rows in the provider tables/lists.agent-schema.json— document the new alias in the provider description.pkg/model/provider/aliases_test.goandpkg/config/auto_test.gocovering the alias config, auto-selection, default model, and max-tokens defaults.Usage
orcarouter/autois OrcaRouter's adaptive router; any gateway-served model can be referenced with its upstream prefix (e.g.orcarouter/anthropic/claude-sonnet-4-5).Verification
go build ./...— cleango vet ./pkg/model/provider/... ./pkg/config/... ./pkg/modelinfo/...— cleango test ./pkg/model/provider/... ./pkg/config/... ./pkg/modelinfo/... ./pkg/httpclient/... ./pkg/fake/... ./pkg/modelsdev/...— all pass, including new orcarouter casesgo run ./lint .— 1814 files inspected, no offensesgofmt -lon changed files — cleanproviders.NewDefaultRegistry().Newwithprovider: orcarouter,model: orcarouter/auto, realORCAROUTER_API_KEY, and streamed a chat completion againsthttps://api.orcarouter.ai/v1— returnedORCA-OK.Disclosure: I'm an engineer on the OrcaRouter team.