feat(agent): add OrcaRouter as a named LLM provider preset - #130
Open
putraperdana1207-pixel wants to merge 1 commit into
Open
feat(agent): add OrcaRouter as a named LLM provider preset#130putraperdana1207-pixel wants to merge 1 commit into
putraperdana1207-pixel wants to merge 1 commit into
Conversation
Adds orcarouter to the LLM_PROVIDER_PRESETS registry as an openai-compatible provider mirroring the existing OpenRouter preset: same protocol, proxy routing, and settings auto-generation. The preset wires the provider through the settings UI, the server keystore, and the model-selection catalog; users save their OrcaRouter key and pick orcarouter/auto (or any vendor/model id) like any other provider. - shared/llm-providers.ts: register the orcarouter preset (https://api.orcarouter.ai/v1, default orcarouter/auto) - server/keystore.ts: whitelist LLM_ORCAROUTER_{API_KEY,BASE_URL,MODEL} - src/components/settings: provider label + vendor icon monogram - src/agent/ai-sdk.verify.ts: coverage for normalize/default/path/CLM - README(.md/_ZH.md): list OrcaRouter in the Agent provider row Verified: npx tsc -b, npm run lint, targeted verifies, npm run build, and a live 200 round-trip through the /llm proxy to api.orcarouter.ai.
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
OpenChatCut's built-in agent is powered by the Vercel AI SDK, and its Agent LLM settings expose each model vendor as a named provider preset in
shared/llm-providers.ts. Every preset is picked up automatically by the settings UI, the server-side keystore, model selection, and the/llmproxy — so adding a new OpenAI-compatible gateway is a small, well-defined wiring change.This PR adds OrcaRouter as a first-class named provider preset, mirroring the existing OpenRouter wiring exactly: same
openai-compatibleprotocol, same/chat/completionsproxy path, same Bearer-key handling, same settings-page auto-generation.OrcaRouter is an OpenAI-compatible AI gateway built for both models and agents. Like OpenRouter, it exposes a provider/model namespace across many models — but it also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint. Adding
orcarouteras a first-class provider means OpenChatCut users can use that stack directly, without treating OrcaRouter as an anonymous custom base URL.What changed
shared/llm-providers.tsorcarouterpreset:protocol: 'openai-compatible',baseUrl: 'https://api.orcarouter.ai/v1',defaultModel: 'orcarouter/auto'— directly beside theopenrouterpreset it mirrorsserver/keystore.tsLLM_ORCAROUTER_API_KEY,LLM_ORCAROUTER_BASE_URL,LLM_ORCAROUTER_MODEL(same three slots as every other provider)src/components/settings/VisionModelPane.tsxOrcaRouterlabel in the vision-provider pickersrc/components/settings/vendorIcons.tsxorcaroutervendor id + a monogram mark (no official SVG vendored yet, same treatment as xAI/BytePlus)src/agent/ai-sdk.verify.tsnormalizeLlmProvider,defaultModelForProvider,providerApiPath, andgetLanguageModelprovider id (orcarouter.chat)README.md/README_ZH.mdThe runtime path needs no new code:
createProviderFactory's default branch already constructscreateOpenAICompatible({ name: provider })for non-dedicated providers, soorcarouterresolves to theorcarouter.chatadapter exactly likeopenrouter.chatdoes, andserver/plugins/llm-proxy.tsroutesx-openchatcut-provider: orcarouterto the preset base URL with aBearerkey from the keystore.How the provider is used
In Settings → Agent 模型 → Agent 大脑, OrcaRouter now appears as its own vendor page. Save an OrcaRouter API key, and the model picker offers
orcarouter/auto(the adaptive default) or anyvendor/modelid the gateway exposes (e.g.anthropic/claude-opus-4.8,deepseek/deepseek-v4-pro).Verification
npx tsc -b --force— passesnpm run lint— passessrc/agent/ai-sdk.verify.ts,shared/model-capabilities.verify.ts,server/keystore.verify.ts,server/llm-proxy.verify.ts,src/agent/settings/agent-settings.verify.ts,server/key-probes.verify.ts) — all passnpm run build— passes/llmproxy helpers tohttps://api.orcarouter.ai/v1/chat/completionswithmodel: orcarouter/autoreturned HTTP 200 with a valid completionThe full
npm testsuite runs locally except the Remotion headless-browser segment, which needs a systemlibnspr4/libnss3that this sandbox cannot install; the remaining suite (including every provider-path verify) is green, and CI's ubuntu runner installs those libraries.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.
Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter
I'm an engineer on the OrcaRouter team.