feat(model): add OrcaRouter as a named model provider - #3731
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
feat(model): add OrcaRouter as a named model provider#3731XiaoHuo888-hue wants to merge 1 commit into
XiaoHuo888-hue wants to merge 1 commit into
Conversation
Add OrcaRouter as a first-class named provider in the model catalog so users can batch-import the gateway's model list with one click instead of manually filling an OpenAI-compatible base URL. - Backend: ProviderEnum.ORCAROUTER + ORCAROUTER_BASE_URL/GET_URL constants, OrcaRouterModelProvider fetching the gateway catalog from https://api.orcarouter.ai/v1/models, and dispatch wiring in get_provider_models / batch_create_models_for_tenant. - Frontend: OrcaRouter option in the batch-add provider selector, useOrcaRouterModelList hook, provider icon/detection/labels, and grouped display in the model list. - Docs: OrcaRouter in the supported-providers list for en/zh. - Tests: unit tests for the new provider and dispatch paths. Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>
XiaoHuo888-hue
requested review from
Dallas98,
WMC001 and
jeffwu-1999
as code owners
August 21, 2026 07:19
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.
Add OrcaRouter as a named model provider
This PR adds OrcaRouter as a first-class, named model provider in the Nexent model catalog, so users can batch-import the gateway's model list with one click instead of manually filling in an OpenAI-compatible base URL.
What changed
Backend
backend/consts/provider.py: newProviderEnum.ORCAROUTER+ORCAROUTER_BASE_URL(https://api.orcarouter.ai/v1/) andORCAROUTER_GET_URL(https://api.orcarouter.ai/v1/models) constants.backend/services/providers/orcarouter_provider.py(new):OrcaRouterModelProviderfetches the gateway chat-model catalog fromGET /v1/modelsand returns canonical model rows (model_tag=chat, defaultmax_tokens). OrcaRouter is a chat-only gateway, so non-chat model types return an empty list.backend/services/model_provider_service.py+model_management_service.py: dispatch wiring soprovider=orcarouterresolves to the new provider and batch-created models default to the OrcaRouter base URL.backend/services/model_gateway_service.py+model_capacity_suggestion_service.py:orcarouteradded to provider-by-URL detection so icons/capacity suggestions stay consistent.backend/services/providers/__init__.py: export the new provider.Frontend
useOrcaRouterModelListhook fetches the gateway catalog (mirrors the TokenPony hook).frontend/public/orcarouter.svg), detection hints, source labels, grouping, and en/zh i18n strings.Docs
Tests
test_orcarouter_provider.py(10 unit tests: fetch, capacity hints, chat-only filtering, empty/error/auth-header/unknown-type cases).test_model_provider_service.pyand updatedconsts.providerstub intest_model_management_service.py.How it was verified
pytest test/backend/services/providers/→ 187 passed (incl. 10 new OrcaRouter tests).pytest test/backend/services/test_model_provider_service.py→ 75 passed.pytest test/backend/services/test_model_management_service.py→ 76 passed.npm run type-check(the repo's frontend CI gate) → clean.sk-orca-…key,OrcaRouterModelProvider.get_models()returned 208 models fromhttps://api.orcarouter.ai/v1/models(incl.orcarouter/auto), each taggedchat/llm.OrcaRouter is an OpenAI-compatible model gateway. 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.
Disclosure: I'm an engineer on the OrcaRouter team.