Deepseek V4 for Copilot
翻譯準備中
外掛JavaScript · TypeScriptGitHub @Laurent00TT自行安裝營運者未確認
試用過了嗎? 點一下就好,不需要登入。
正在載入完整 README。 以下為已儲存的摘錄。
Use DeepSeek V4 Pro and V4.1 Flash as native models in VS Code Copilot Chat — extended thinking, agent-mode tool calling, image input, and your real DeepSeek bill in the status bar.
You need VS Code 1.106+, the GitHub Copilot Chat extension signed in (this extension only adds models to its picker), and a DeepSeek account with API balance.檢視完整 README ↗Use DeepSeek V4 Pro and V4.1 Flash as native models in VS Code Copilot Chat — extended thinking, agent-mode tool calling, image input, and your real DeepSeek bill in the status bar.
中文文档 · Changelog · Architecture (contributor docs)
You need VS Code 1.106+, the GitHub Copilot Chat extension signed in (this extension only adds models to its picker), and a DeepSeek account with API balance.
Manage DeepSeek V4 Provider → paste your DeepSeek API key.| Picker entry | API model | Thinking | Images | Input budget | Output budget |
|---|---|---|---|---|---|
| DeepSeek V4 Pro (thinking) | deepseek-v4-pro | ✓ | — | 640K | 384K |
| DeepSeek V4 Pro | deepseek-v4-pro | — | — | 960K | 64K |
| DeepSeek V4.1 Flash (thinking) | deepseek-flash | ✓ | ✓ | 640K | 384K |
| DeepSeek V4.1 Flash | deepseek-flash | — | ✓ | 960K | 64K |
(thinking) variants reason in a hidden chain of thought before answering — slower and more tokens, but stronger on hard and agentic tasks; the plain variants answer directly. All variants share a 1M-token context (input + output); thinking variants reserve 384K for output so long reasoning chains are never truncated.
DeepSeek V4.1 Flash (released 2026-09-10) replaced V4 Flash and the V4 Flash Vision preview, and reads images natively. Upgrading keeps a selected Flash entry selected; if you had a Flash Vision entry selected, pick DeepSeek V4.1 Flash instead.
low / high / max), and the reasoning chain carried across multi-turn agent loopsPick a DeepSeek V4.1 Flash variant and attach images in Copilot Chat; thinking and tool calling work as usual. V4 Pro is text-only.
Two things a generic OpenAI-compatible bridge cannot do for DeepSeek V4:
reasoning_content back on the next request — a hard 400 without it until a 2026-08-22 live check found the server lenient (the docs still define the rule) — and VS Code's chat history has no field for it. This extension caches it locally and re-attaches it on every request, so the model keeps its own chain of thought across agent turns and every request stays byte-identical to what DeepSeek already cached, keeping the discounted cache-hit input price./user/balance; cache-hit / miss tokens come from the real usage data.| Command | Description |
|---|---|
Manage DeepSeek V4 Provider | Set or update your API key |
Refresh DeepSeek V4 Balance | Fetch the latest account balance |
Show DeepSeek V4 Log | Open the runtime log channel |
Show DeepSeek V4 Reasoning Cache Stats | Reasoning-cache diagnostics |
Clear DeepSeek V4 Reasoning Cache | Purge cached reasoning_content (e.g. before sharing a log) |
Clear DeepSeek V4 Session Counter | Reset the session spend display |
Compact Copilot Chat | Run Copilot Chat's /compact when context is near the cap |
| Setting | Values | Default | Description |
|---|---|---|---|
deepseekv4.reasoningEffort | low | high | max | max | Reasoning depth for the (thinking) variants; ignored by the others. high is faster with shorter chains; low is the fastest and lightest. Applies to the next message. |
deepseekv4.logRawReasoning | boolean | false | Stream raw reasoning_content to the log (only useful when debugging cache breakdowns). May capture private code — keep off when sharing logs. |
Every request goes to api.deepseek.com with your key and bills your prepaid DeepSeek balance (pay-as-you-go — see DeepSeek pricing), never your Copilot quota.
Since 2026-08-16 the rate also depends on when you send the request — DeepSeek bills peak and off-peak differently, and off-peak is half price. The extension deliberately does not encode those windows; they are vendor policy and have already changed once. Read the current schedule on the pricing page linked above. What the status bar shows is the one thing that cannot go stale: your real balance, straight from /user/balance.
One exception comes from Copilot Chat itself: in agent mode it can spawn sub-agents (the agent / runSubagent tool — notably the Explore Agent) on a Copilot-hosted model regardless of the model you picked, and those calls do consume premium requests. This affects every bring-your-own-key (BYOK) provider (community#197840, #16). To avoid it:
agent / runSubagent — most reliable.github.copilot.chat.exploreAgent.model to a DeepSeek V4 model.The reasoning_content in the thinking mode must be passed back to the API (400).
Not seen since a 2026-08-22 live check (the API accepted every history shape without reasoning), but the docs still define the rule. If it appears, some assistant turn has no cached reasoning (pre-extension history, a cleared cache, or eviction in a very long session): start a new chat; Show DeepSeek V4 Reasoning Cache Stats diagnoses.
Thinking mode does not support this tool_choice (400).
Older versions failed this way on the (thinking) variants whenever a request required a tool call (VS Code's Required tool mode), and the error toast wrongly blamed a missing reasoning chain. DeepSeek's thinking mode cannot force a tool call, so the extension now sends such requests without forcing one: the model sees the same tools but may answer without calling one. If something needs a guaranteed tool call, pick a variant without (thinking).
"prompt cache hit rate dropped" warning. Your conversation's cached prefix on DeepSeek's side broke, so further turns bill at the full (cache-miss) input price instead of the discounted cache-hit price. The extension cannot tell why — a turn cancelled or failed mid-stream, eviction in a very long session, or an editor restart are all possible. Start New Chat cuts losses; Show Cache Stats diagnoses. Background: #19.
Copilot's context indicator shows 0 / 0%. Update to VS Code 1.120+ — earlier hosts don't display usage for extension-provided models (#18, microsoft/vscode#315394).
Cannot have more than 128 tools per request (shown as a 502 after 5 retries).
Older versions failed this way when a chat offered more than 128 tools (#27). The extension now sends at most 128 tools per request instead: when the chat offers more (built-in + MCP + extension tools), it keeps the tools the conversation already used, fills the rest in the order VS Code lists them, and warns once; Show DeepSeek V4 Log lists what was left out. To choose which tools DeepSeek gets, turn some off with Configure Tools in the chat input.
My image attachment is ignored. Only the V4.1 Flash variants send images — V4 Pro is text-only. Check the format and the 48 MiB / 32 MiB limits above.
No OpenRouter / custom base URL?
Deliberate (#4): OpenRouter reshapes DeepSeek's thinking protocol (reasoning_details instead of reasoning_content, a different thinking switch, no cache-hit accounting) — exactly what this extension depends on. For OpenRouter use a dedicated provider such as ostash/openrouter-chat-provider.
api.deepseek.com; images go only there.deepseekv4.logRawReasoning is off by default.MIT. See LICENSE. Forked from huggingface-vscode-chat; the protocol layer was rewritten for DeepSeek V4.