Skip to content

feat: add OrcaRouter as a built-in OpenAI-compatible provider - #4007

Open
JinhaoSong322 wants to merge 1 commit into
docker:mainfrom
JinhaoSong322:add-orcarouter-provider
Open

feat: add OrcaRouter as a built-in OpenAI-compatible provider#4007
JinhaoSong322 wants to merge 1 commit into
docker:mainfrom
JinhaoSong322:add-orcarouter-provider

Conversation

@JinhaoSong322

Copy link
Copy Markdown

Summary

Adds OrcaRouter as a first-class built-in OpenAI-compatible provider, mirroring the existing openrouter alias.

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 — register orcarouter alias: API type openai, base URL https://api.orcarouter.ai/v1, token env var ORCAROUTER_API_KEY.
  • pkg/config/auto.go — register orcarouter in cloudProviders (so it participates in auto-selection) and in DefaultModels (orcarouter/auto, the gateway's adaptive router).
  • pkg/model/provider/openai/client.go — treat orcarouter as 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.
  • Tests in pkg/model/provider/aliases_test.go and pkg/config/auto_test.go covering the alias config, auto-selection, default model, and max-tokens defaults.

Usage

agents:
  root:
    model: orcarouter/orcarouter/auto
    description: Assistant using OrcaRouter
    instruction: You are a helpful assistant.

orcarouter/auto is 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 ./... — clean
  • go vet ./pkg/model/provider/... ./pkg/config/... ./pkg/modelinfo/... — clean
  • go test ./pkg/model/provider/... ./pkg/config/... ./pkg/modelinfo/... ./pkg/httpclient/... ./pkg/fake/... ./pkg/modelsdev/... — all pass, including new orcarouter cases
  • go run ./lint . — 1814 files inspected, no offenses
  • gofmt -l on changed files — clean
  • L3 live test: built a provider via providers.NewDefaultRegistry().New with provider: orcarouter, model: orcarouter/auto, real ORCAROUTER_API_KEY, and streamed a chat completion against https://api.orcarouter.ai/v1 — returned ORCA-OK.

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

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>
@JinhaoSong322
JinhaoSong322 requested a review from a team as a code owner August 20, 2026 09:10
@Sayt-0 Sayt-0 self-assigned this Aug 20, 2026
@aheritier aheritier added area/config For configuration parsing, YAML, environment variables area/docs Documentation changes area/models LLM model integrations and model providers area/providers For features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.) area/providers/openai For features/issues/fixes related to the usage of OpenAI models kind/feat PR adds a new feature (maps to feat:). Use on PRs only. status/needs-signed-commits Some commits in the PR are signed with a valid SSH/GPG key labels Aug 20, 2026
@aheritier

Copy link
Copy Markdown
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: d30e380

See GitHub's guide on signing commits for setup instructions. I've added status/needs-signed-commits; it will be removed automatically once every commit in this PR carries a valid GitHub-verified signature.

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

Labels

area/config For configuration parsing, YAML, environment variables area/docs Documentation changes area/models LLM model integrations and model providers area/providers/openai For features/issues/fixes related to the usage of OpenAI models area/providers For features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.) kind/feat PR adds a new feature (maps to feat:). Use on PRs only. status/needs-signed-commits Some commits in the PR are signed with a valid SSH/GPG key

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants