feat: add OrcaRouter as a named model provider - #449
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
XiaoHuo888-hue wants to merge 1 commit into
XiaoHuo888-hue wants to merge 1 commit into
Conversation
Registers OrcaRouter (OpenAI-compatible gateway, 150+ models behind one key) on the same direct-override path already defined for openrouter in getConfigurationForModel. Adds the orcarouter/auto model to MODELS_MASTER, the ORCAROUTER_API_KEY env/binding, a vault secret template, setup-provider and docs entries, and a unit test for the direct-override wiring. 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
OrcaRouter is an OpenAI-compatible model routing gateway that brings 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax and xAI behind a single endpoint and API key. Beyond routing, it 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. This PR registers it as a named provider so users can opt in directly.
OrcaRouter joins the same direct-override path the codebase already defines for
openrouter(getConfigurationForModel), so the model picker, provider list, secrets, and docs stay consistent.Changes
worker/agents/inferutils/config.types.ts: addORCAROUTER_AUTO(orcarouter/auto) toMODELS_MASTERas adirectOverridemodel.worker/agents/inferutils/core.ts: addcase 'orcarouter'to the direct-override switch →baseURL https://api.orcarouter.ai/v1, key fromORCAROUTER_API_KEY(keys start withsk-orca-).worker/types/env.d.ts: declareORCAROUTER_API_KEY..dev.vars.example: documentORCAROUTER_API_KEY.worker/types/secretsTemplates.ts: add an OrcaRouter API key template (vault).worker/api/controllers/modelConfig/byokHelper.ts: recognizeorcarouteras an env-key-enabled platform provider so the model shows in the picker.worker/database/services/ModelTestService.ts: maporcarouter→orcarouter/autofor provider connection tests.scripts/setup.ts+docs/setup.md: add OrcaRouter to the setup provider selection list.worker/agents/inferutils/core.test.ts: add a direct-override test asserting the OrcaRouter base URL and key.Testing
bunx vitest run worker/agents/inferutils/core.test.ts— 8 passed (includes the new OrcaRouter direct-override case).bun run typecheck— passed (tsc -b --incremental --noEmit).bun run lint— 0 errors (2 pre-existing warnings insrc/components/layout/header-context.tsx).GET /v1/models+POST /v1/chat/completionswithorcarouter/auto, Bearer key) → 200, routed upstream, response received.I'm an engineer on the OrcaRouter team.