feat(llm): add named OrcaRouter provider for backend LLM routing - #942
Open
Marc-oss-hub wants to merge 1 commit into
Open
feat(llm): add named OrcaRouter provider for backend LLM routing#942Marc-oss-hub wants to merge 1 commit into
Marc-oss-hub wants to merge 1 commit into
Conversation
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>
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
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 onthe 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
Related Issues
N/A
What this changes
backend/services/globalModelConfigService.ts: adds theorcarouterblock(
baseUrl+model) to thellmServiceconfig, its sanitize/merge logic andthe provider allowlist
backend/services/llmService.ts: addsgetOrcaRouterConfig,generateViaOrcaRouter,parseOrcaRouterModeland routing when the provideris
orcarouteror the model carries anorcarouter/prefixfrontend/src/components/admin/GlobalIntegrations.tsx: adds OrcaRouter to theBackend LLM Provider picker with Base URL + Model fields
.env.example: documentsORCAROUTER_API_KEY/ORCAROUTER_BASE_URLbackend/__tests__/unit/services/globalModelConfigService.test.js: coversOrcaRouter 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
sk-orca-).ORCAROUTER_API_KEY.openai/gpt-5.5,anthropic/claude-sonnet-5ordeepseek/deepseek-v4-flash. The full catalog is athttps://www.orcarouter.ai/models.
Test Plan
cd backend && npm test) —globalModelConfigServiceunit suite and
admin.globalIntegrationsroute suite green; see Notes for thefull-suite caveat in this sandbox
cd frontend && npm test)tsc --noEmitclean, frontendeslint src/.../GlobalIntegrations.tsxclean, frontendtsc --noEmitclean./dev.sh upNotes for Reviewer
Verified live through the new code path:
generateTextwith anorcarouter/-prefixed model returns a normal completion fromhttps://api.orcarouter.ai/v1/chat/completions.
In this Windows sandbox the full backend
npm testrun hangs on an unrelatedopen-handle test after the changed-file suites pass; the suites covering the
changed code (
globalModelConfigService.test.js,admin.globalIntegrations.test.js)are green.