feat: add OrcaRouter provider preset for DeepSeek V4 - #239
Open
Marc-oss-hub wants to merge 1 commit into
Open
Conversation
Adds a deepseek-copilot.provider setting (deepseek | orcarouter) that routes DeepSeek V4 through the OrcaRouter model gateway when selected: - config: getProvider() + provider-aware getBaseUrl()/getApiModelId(); orcarouter sends namespaced model IDs (deepseek/deepseek-v4-flash, deepseek/deepseek-v4-pro) that the gateway requires - endpoint: ORCAROUTER_API_BASE + isOrcaRouterBaseUrl() - client errors: 401 links to the OrcaRouter API-key page, 402 to the console, when the active base URL is api.orcarouter.ai - provider: model picker refresh on provider setting change - settings/docs: package.json + en/zh-cn nls + README/README.zh-cn 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 a
deepseek-copilot.providersetting (deepseek|orcarouter) so DeepSeek V4 Pro & Flash can be served through the OrcaRouter model gateway instead of (or alongside) the official DeepSeek API. 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.What this changes
deepseek-copilot.providersetting.deepseek(default) keeps today's behavior;orcarouterswitches the extension to the OrcaRouter gateway.orcarouteris selected:https://api.orcarouter.ai/v1deepseek/deepseek-v4-flash,deepseek/deepseek-v4-pro) — OrcaRouter rejects bare model names, so this is what makes the gateway route correctlybaseUrl/modelIdOverridesare ignored whileorcarouteris active (they describe the DeepSeek / third-party proxy path).nlslocalization, marketplace keywords.Why a provider preset
The extension already ships
baseUrl+modelIdOverridesas a generic escape hatch, but that expects users to know OrcaRouter's endpoint and its namespaced model-ID convention. A named preset makes the gateway a first-class option in the Settings UI — one toggle, correct model IDs, correct error links — the same treatment the official API gets. OrcaRouter is OpenAI-compatible on/v1/chat/completions, so the existing DeepSeek request path (streaming,thinking/reasoning_effort, tools) works unchanged; only the endpoint and model IDs differ.Files changed
src/config.ts—getProvider(), provider-awaregetBaseUrl()/getApiModelId()src/endpoint.ts— OrcaRouter base URL + host matchersrc/client/error/index.ts,src/client/consts.ts,src/client/types.ts— OrcaRouter error-link provider mappingsrc/provider/index.ts— react to theprovidersetting changesrc/consts.ts— OrcaRouter external URLspackage.json,package.nls.json,package.nls.zh-cn.json— the new setting + localizationREADME.md,README.zh-cn.md— usage docsGetting started
"deepseek-copilot.provider": "orcarouter"in settings.Verification
npm run compile(tsc) clean;npm run lint(oxlint) 0 errors;npm run format:checkclean.POST https://api.orcarouter.ai/v1/chat/completionsfordeepseek/deepseek-v4-flash(stream +thinking/reasoning_effort) anddeepseek/deepseek-v4-pro(stream +tools) both returned valid completions. Both model IDs are present in the gateway's/v1/modelscatalog.I'm an engineer on the OrcaRouter team.