Skip to content

feat(llm): add named OrcaRouter provider for backend LLM routing - #942

Open
Marc-oss-hub wants to merge 1 commit into
Team-Commonly:mainfrom
Marc-oss-hub:feat/orcarouter-provider
Open

feat(llm): add named OrcaRouter provider for backend LLM routing#942
Marc-oss-hub wants to merge 1 commit into
Team-Commonly:mainfrom
Marc-oss-hub:feat/orcarouter-provider

Conversation

@Marc-oss-hub

Copy link
Copy Markdown

Summary

Adds OrcaRouter as a named model provider for the
backend LLM service, mirroring the existing OpenRouter wiring. OrcaRouter is an
OpenAI-compatible model routing gateway exposing 190+ models from OpenAI,
Anthropic, Google, DeepSeek and others behind a single endpoint and one
sk-orca- key. 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.

I'm an engineer on the OrcaRouter team.

Type

  • New feature
  • Agent integration

Related Issues

N/A

What this changes

  • backend/services/globalModelConfigService.ts: adds the orcarouter block
    (baseUrl + model) to the llmService config, its sanitize/merge logic and
    the provider allowlist
  • backend/services/llmService.ts: adds getOrcaRouterConfig,
    generateViaOrcaRouter, parseOrcaRouterModel and routing when the provider
    is orcarouter or the model carries an orcarouter/ prefix
  • frontend/src/components/admin/GlobalIntegrations.tsx: adds OrcaRouter to the
    Backend LLM Provider picker with Base URL + Model fields
  • .env.example: documents ORCAROUTER_API_KEY / ORCAROUTER_BASE_URL
  • backend/__tests__/unit/services/globalModelConfigService.test.js: covers
    OrcaRouter defaults and the apiKey drop on save

Why a separate provider rather than the OpenAI-compatible escape hatch

This mirrors how OpenRouter is wired in this repo, so the model picker, config
reference and env docs stay consistent for users.

How to use it

  1. Get an API key at https://www.orcarouter.ai/console (keys start with sk-orca-).
  2. Set ORCAROUTER_API_KEY.
  3. Pick a model id such as openai/gpt-5.5, anthropic/claude-sonnet-5 or
    deepseek/deepseek-v4-flash. The full catalog is at
    https://www.orcarouter.ai/models.

Test Plan

  • Backend tests pass (cd backend && npm test) — globalModelConfigService
    unit suite and admin.globalIntegrations route suite green; see Notes for the
    full-suite caveat in this sandbox
  • Frontend tests pass (cd frontend && npm test)
  • Linting / typecheck passes — backend tsc --noEmit clean, frontend
    eslint src/.../GlobalIntegrations.tsx clean, frontend tsc --noEmit clean
  • Tested locally with ./dev.sh up
  • Added/updated tests for new behavior

Notes for Reviewer

Verified live through the new code path: generateText with an
orcarouter/-prefixed model returns a normal completion from
https://api.orcarouter.ai/v1/chat/completions.

In this Windows sandbox the full backend npm test run hangs on an unrelated
open-handle test after the changed-file suites pass; the suites covering the
changed code (globalModelConfigService.test.js, admin.globalIntegrations.test.js)
are green.

Mirrors the existing OpenRouter wiring for OrcaRouter, the OpenAI-compatible
gateway at https://api.orcarouter.ai (sk-orca- keys).

- globalModelConfigService: add orcarouter block (baseUrl + model) to the
  llmService config, sanitize/merge logic, and provider allowlist
- llmService: add generateViaOrcaRouter (no attribution headers), config
  resolution from llmService.orcarouter + ORCAROUTER_* env, model prefix
  stripping, and routing when provider is 'orcarouter' or the model is
  prefixed with orcarouter/
- GlobalIntegrations admin UI: add OrcaRouter backend provider option with
  base URL + model fields
- .env.example: document ORCAROUTER_API_KEY / ORCAROUTER_BASE_URL
- unit tests: cover orcarouter defaults and key-drop on save

Co-Authored-By: Claude <noreply@anthropic.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