feat: add OrcaRouter as a named AI channel provider - #272
Open
JinhaoSong322 wants to merge 1 commit into
Open
Conversation
Add OrcaRouter as a first-class provider option for AI channels. OrcaRouter is an OpenAI-compatible gateway (https://api.orcarouter.ai/v1) whose model IDs such as orcarouter/auto are routed by the gateway to the best backend model. - config: add OrcaRouterBaseURL + IsOrcaRouterProvider helpers and unit tests - handler: default the OpenAI-compatible base URL to api.orcarouter.ai/v1 when provider is orcarouter in TestOpenAI / ListModels / TestVision - web: add OrcaRouter option to the AI-channel, vision, and HITL audit provider selects, plus i18n keys (en-US/zh-CN) - docs: document the orcarouter provider in config.example.yaml, README, README_CN, and configuration references (EN/CN) Co-Authored-By: jinhao.song <jinhao.song@myflashcloud.com> Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>
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
Add OrcaRouter as a first-class named AI-channel provider. OrcaRouter is an OpenAI-compatible gateway at
https://api.orcarouter.ai/v1whose model IDs such asorcarouter/autoare routed by the gateway to the best available backend model. 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.Since OrcaRouter is OpenAI-compatible, channels pointing at it route through the existing OpenAI-compatible runtime path; this PR makes it a named, selectable provider instead of requiring a manually-entered base URL.
What changed
internal/config: addOrcaRouterBaseURLconst andIsOrcaRouterProvider/IsOrcaRouterProviderName/OrcaRouterBaseURLForhelpers, plus unit tests.internal/handler: default the OpenAI-compatible base URL tohttps://api.orcarouter.ai/v1whenproviderisorcarouterinTestOpenAI,ListModels, andTestVision; update the OpenAPI spec provider description.web: addOrcaRouterto the AI-channel, vision, and HITL-audit provider dropdowns; channel label display; i18n keys (en-US,zh-CN).orcarouterprovider and a sample channel inconfig.example.yaml,README.md,README_CN.md, and the EN/CN configuration references.How it was verified
go build ./...andgo vetpass.go test ./internal/config/...passes (including the new OrcaRouter helper tests). Handler-package tests can't run in this container becausego-sqlite3requires cgo and there is nogcc; the failures are pre-existing environment issues unrelated to this change.gofmtclean; frontend JSON validated andsettings.jspassesnode --check.provider=orcarouter, empty base URL →https://api.orcarouter.ai/v1):POST /chat/completionswithorcarouter/auto→ HTTP 200, assistant replyORCA-OK.GET /models→ HTTP 200, 205 models.Disclosure: I'm an engineer on the OrcaRouter team.