Skip to content

feat: add OrcaRouter provider preset for DeepSeek V4 - #239

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

feat: add OrcaRouter provider preset for DeepSeek V4#239
Marc-oss-hub wants to merge 1 commit into
Vizards:mainfrom
Marc-oss-hub:feat/orcarouter-provider

Conversation

@Marc-oss-hub

Copy link
Copy Markdown

Summary

Adds a deepseek-copilot.provider setting (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

  • New deepseek-copilot.provider setting. deepseek (default) keeps today's behavior; orcarouter switches the extension to the OrcaRouter gateway.
  • When orcarouter is selected:
    • requests go to https://api.orcarouter.ai/v1
    • model IDs are namespaced automatically (deepseek/deepseek-v4-flash, deepseek/deepseek-v4-pro) — OrcaRouter rejects bare model names, so this is what makes the gateway route correctly
    • 401 / 402 error links point at the OrcaRouter console
  • The model picker refreshes when the setting changes; baseUrl / modelIdOverrides are ignored while orcarouter is active (they describe the DeepSeek / third-party proxy path).
  • Docs updated: README (EN + 中文), package nls localization, marketplace keywords.

Why a provider preset

The extension already ships baseUrl + modelIdOverrides as 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.tsgetProvider(), provider-aware getBaseUrl() / getApiModelId()
  • src/endpoint.ts — OrcaRouter base URL + host matcher
  • src/client/error/index.ts, src/client/consts.ts, src/client/types.ts — OrcaRouter error-link provider mapping
  • src/provider/index.ts — react to the provider setting change
  • src/consts.ts — OrcaRouter external URLs
  • package.json, package.nls.json, package.nls.zh-cn.json — the new setting + localization
  • README.md, README.zh-cn.md — usage docs

Getting started

  1. Set "deepseek-copilot.provider": "orcarouter" in settings.
  2. Run DeepSeek: Set API Key and paste an OrcaRouter API key.
  3. Pick DeepSeek V4 Pro or DeepSeek V4 Flash in Copilot Chat as usual — thinking mode, vision, and tools all route through the gateway.

Verification

  • npm run compile (tsc) clean; npm run lint (oxlint) 0 errors; npm run format:check clean.
  • Live test against the gateway using the extension's exact request shape: POST https://api.orcarouter.ai/v1/chat/completions for deepseek/deepseek-v4-flash (stream + thinking/reasoning_effort) and deepseek/deepseek-v4-pro (stream + tools) both returned valid completions. Both model IDs are present in the gateway's /v1/models catalog.

I'm an engineer on the OrcaRouter team.

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>
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