Skip to content

feat(model): add OrcaRouter as a named model provider - #3731

Open
XiaoHuo888-hue wants to merge 1 commit into
ModelEngine-Group:developfrom
XiaoHuo888-hue:add-orcarouter-provider
Open

feat(model): add OrcaRouter as a named model provider#3731
XiaoHuo888-hue wants to merge 1 commit into
ModelEngine-Group:developfrom
XiaoHuo888-hue:add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

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: new ProviderEnum.ORCAROUTER + ORCAROUTER_BASE_URL (https://api.orcarouter.ai/v1/) and ORCAROUTER_GET_URL (https://api.orcarouter.ai/v1/models) constants.
  • backend/services/providers/orcarouter_provider.py (new): OrcaRouterModelProvider fetches the gateway chat-model catalog from GET /v1/models and returns canonical model rows (model_tag=chat, default max_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 so provider=orcarouter resolves 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: orcarouter added to provider-by-URL detection so icons/capacity suggestions stay consistent.
  • backend/services/providers/__init__.py: export the new provider.

Frontend

  • Batch-add dialog now offers OrcaRouter in the model-provider dropdown.
  • New useOrcaRouterModelList hook fetches the gateway catalog (mirrors the TokenPony hook).
  • Provider icon (frontend/public/orcarouter.svg), detection hints, source labels, grouping, and en/zh i18n strings.

Docs

  • OrcaRouter added to the supported-providers list and a batch-add note in the en/zh model-configuration pages.

Tests

  • New test_orcarouter_provider.py (10 unit tests: fetch, capacity hints, chat-only filtering, empty/error/auth-header/unknown-type cases).
  • New dispatch tests in test_model_provider_service.py and updated consts.provider stub in test_model_management_service.py.

How it was verified

  • Backend: pytest test/backend/services/providers/187 passed (incl. 10 new OrcaRouter tests). pytest test/backend/services/test_model_provider_service.py75 passed. pytest test/backend/services/test_model_management_service.py76 passed.
  • Frontend: npm run type-check (the repo's frontend CI gate) → clean.
  • L3 live: with a real sk-orca-… key, OrcaRouterModelProvider.get_models() returned 208 models from https://api.orcarouter.ai/v1/models (incl. orcarouter/auto), each tagged chat/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.

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