Skip to content

feat: add OrcaRouter as a named AI channel provider - #272

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

feat: add OrcaRouter as a named AI channel provider#272
JinhaoSong322 wants to merge 1 commit into
Ed1s0nZ:mainfrom
JinhaoSong322:add-orcarouter-provider

Conversation

@JinhaoSong322

Copy link
Copy Markdown

Summary

Add OrcaRouter as a first-class named AI-channel provider. OrcaRouter is an OpenAI-compatible gateway at https://api.orcarouter.ai/v1 whose model IDs such as orcarouter/auto are 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: add OrcaRouterBaseURL const and IsOrcaRouterProvider / IsOrcaRouterProviderName / OrcaRouterBaseURLFor helpers, plus unit tests.
  • internal/handler: default the OpenAI-compatible base URL to https://api.orcarouter.ai/v1 when provider is orcarouter in TestOpenAI, ListModels, and TestVision; update the OpenAPI spec provider description.
  • web: add OrcaRouter to the AI-channel, vision, and HITL-audit provider dropdowns; channel label display; i18n keys (en-US, zh-CN).
  • docs: document the orcarouter provider and a sample channel in config.example.yaml, README.md, README_CN.md, and the EN/CN configuration references.

How it was verified

  • go build ./... and go vet pass.
  • go test ./internal/config/... passes (including the new OrcaRouter helper tests). Handler-package tests can't run in this container because go-sqlite3 requires cgo and there is no gcc; the failures are pre-existing environment issues unrelated to this change.
  • gofmt clean; frontend JSON validated and settings.js passes node --check.
  • Live check against the gateway with the provider path (provider=orcarouter, empty base URL → https://api.orcarouter.ai/v1):
    • POST /chat/completions with orcarouter/auto → HTTP 200, assistant reply ORCA-OK.
    • GET /models → HTTP 200, 205 models.

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

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>
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.

1 participant