DeepSeek V4 for Copilot Chat

repository·main·Indexed 19 days ago

https://github.com/vizards/deepseek-v4-for-copilot

A VS Code extension that integrates DeepSeek V4 Pro and Flash models into the GitHub Copilot Chat interface. It supports native Copilot features including Agent mode, tool calling, MCP, and a Transparent Vision Proxy for image processing. Users can configure reasoning effort (Thinking Mode) and customize API endpoints, token limits, and tool stabilization settings via settings.json.

Tokens
12.4K
Snippets
39
Records
61
Agent score
78%

What's inside deepseek-v4-for-copilot

  1. Configure Reasoning Effort (Thinking Mode)

    main

    DeepSeek V4 supports reasoning_content. You can control the depth of reasoning directly via the Copilot Chat model picker menu for each DeepSeek model.

    Available modes:

    • 停用 (Disabled): Standard response without reasoning.
    • 标准 (Standard): Balanced reasoning (default).
    • 深度 (Deep): Intensive reasoning, best suited for complex Agent tasks.
  2. How the Transparent Vision Proxy works

    main

    DeepSeek V4 is a text-only model and cannot natively process images. This extension implements a Transparent Vision Proxy to enable vision capabilities:

    1. When you drop an image into Copilot Chat, the extension intercepts it.
    2. It automatically hands the image to a configured Copilot vision model (e.g., Claude or GPT-4o).
    3. It retrieves a text description of the image.
    4. It feeds that description to DeepSeek as part of the prompt.

    Setup: This is zero-config by default, but you can select your preferred vision model by running the command DeepSeek: Configure Vision Proxy in the Command Palette.

  3. How Transparent Vision Proxy works

    main

    Since DeepSeek V4 is a text-only model, this extension provides a Transparent Vision Proxy to enable image support.

    When you drag an image into the chat:

    1. The extension automatically sends the image to a vision-capable model you have already installed in Copilot (e.g., Claude or GPT-4o).
    2. That model generates a text description of the image.
    3. The description is then fed to DeepSeek V4 as text.

    Configuration: You can select your preferred vision proxy model by running the command DeepSeek: 配置视觉代理.

  4. How DeepSeek integrates with Copilot capabilities

    main

    This extension uses the native Copilot provider API, meaning it inherits all existing GitHub Copilot features without requiring a separate UI or reimplementation. Supported features include:

    • Agent Mode: Autonomous multi-step task execution.
    • Tool Calling: Ability to perform file edits, terminal commands, workspace searches, Git operations, and running tests.
    • Instructions & Skills: Full support for .instructions.md, AGENTS.md, and custom Copilot skills.
    • Prompt Caching: DeepSeek's cache hit rates are logged in the VS Code output channel to help monitor cost savings.
  5. Stabilize Tool List (Experimental)

    main

    The deepseek-copilot.experimental.stabilizeToolList setting is an experimental feature designed to improve DeepSeek API cache hits by making the tools parameter more complete and stable across chat turns.

    When to use this setting:

    • 64 or fewer enabled tools: Do not enable this unless the tool list is inconsistently changing across turns.
    • Between 64 and 128 enabled tools: Consider enabling this if the tools list changes between turns and you are experiencing poor DeepSeek context-cache hits.
    • More than 128 enabled tools: Not recommended. DeepSeek supports a maximum of 128 functions in a single tools request. If you have more than 128 tools, disable rarely used tools first before attempting to use this setting.

    Trade-offs:

    • Pros: May improve cache hits and stabilize the tool list.
    • Cons: Increases input token usage because more function definitions are included in every request.
    // Setting ID to search for in VS Code Settings
    @id:deepseek-copilot.experimental.stabilizeToolList
  6. Install DeepSeek V4 for Copilot Chat

    main

    To use DeepSeek V4 models within your existing GitHub Copilot Chat interface, install the extension from your editor's registry:

    1. Microsoft VS Code: Install from the VS Code Marketplace.
    2. Open VSX compatible editors: Install from Open VSX.

    Prerequisites

    • VS Code: Version 1.116 or later.
    • GitHub Copilot Subscription: Free, Pro, or Enterprise tiers are all supported.
    • DeepSeek API Key: Obtain a key from platform.deepseek.com or use a compatible provider token.
  7. Stabilize the tool list for DeepSeek API

    main

    The deepseek-copilot.experimental.stabilizeToolList setting can be used to improve DeepSeek context cache hit rates by ensuring the tools parameter in the DeepSeek API remains complete and stable across multiple conversation turns.

    When to enable this setting:

    • If you have 64 or fewer enabled tools: You usually do not need to enable this, unless you notice the tool list changing between conversation turns.
    • If you have between 64 and 128 enabled tools: Consider enabling this only if the tool list is changing across turns or if DeepSeek context cache hit rates are suboptimal.
    • If you have more than 128 enabled tools: It is not recommended to enable this. DeepSeek supports a maximum of 128 functions per tools request. If you exceed this number, the extension cannot guarantee a stable tool list. You should disable unused tools before enabling this setting.

    Trade-offs: Enabling this may increase input token usage because each request might include more function tool definitions.

    [Open Plugin Settings](command:workbench.action.openSettings?%5B%22%40id%3Adeepseek-copilot.experimental.stabilizeToolList%22%5D)
  8. Configure DeepSeek API Key

    main

    After installation, you must provide an API key to authenticate with DeepSeek:

    1. Open the VS Code Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux).
    2. Run the command: DeepSeek: Set API Key.
    3. Paste your key (official DeepSeek keys typically start with sk-) or your compatible provider token.

    Security Note: Your API key is stored securely in the OS keychain via VS Code's SecretStorage and is never saved in settings.json or your Git history.

  9. Use DeepSeek V4 models in Copilot Chat

    main

    Once configured, you can use DeepSeek models directly in the standard Copilot Chat UI:

    1. Open the Copilot Chat panel.
    2. Click the model picker (the dropdown menu used to switch between GPT-4o, Claude, etc.).
    3. Select either DeepSeek V4 Pro or DeepSeek V4 Flash.
    4. Start chatting. You can switch models mid-conversation without losing chat history.

    Model Selection Guide

    ModelBest For
    DeepSeek V4 FlashFast everyday coding, quick edits, cheap iteration
    DeepSeek V4 ProComplex refactors, agent tasks, deep reasoning

    Thinking Mode (Reasoning Effort)

    For models supporting reasoning_content, you can control the reasoning effort directly from the Copilot Chat model picker menu. Options include:

    • none: Thinking mode is off.
    • high: Balanced reasoning (default).
    • max: Deep reasoning for complex agent tasks.
  10. Use DeepSeek V4 in Copilot Chat

    main

    Once configured, you can use DeepSeek models directly within the standard Copilot Chat interface:

    1. Open the Copilot Chat panel.
    2. Click the Model Picker (the dropdown menu used to switch between GPT-4o, Claude, etc.).
    3. Select DeepSeek V4 Pro or DeepSeek V4 Flash.
    4. Start chatting. You can switch models mid-conversation without losing chat history.
  11. Reference: DeepSeek Copilot Settings

    main

    The following settings are available in settings.json to customize the extension behavior:

    SettingDefaultDescription
    deepseek-copilot.baseUrlhttps://api.deepseek.comAPI endpoint. Can be changed to a self-hosted or proxy address.
    deepseek-copilot.maxTokens0Maximum output tokens (0 = no limit).
    deepseek-copilot.modelIdOverrides(Official mappings)Map DeepSeek V4 Flash/Pro to specific API model IDs (useful for third-party providers).
    deepseek-copilot.debugModeminimalDiagnostic mode: minimal (token usage only), metadata (privacy-safe logs), verbose (full request/pipeline dump to global storage).
    deepseek-copilot.visionModel(Automatic)The VS Code vision model used for image proxying. Set via DeepSeek: 配置视觉代理
    deepseek-copilot.visionPrompt(Built-in)The prompt used to describe image attachments.
    deepseek-copilot.experimental.stabilizeToolListfalseExperimental: Attempts to pre-activate virtual tools to stabilize the tools parameter in multi-turn conversations. Recommended only if tool lists change across turns and you have < 64 tools. Do not use if > 128 tools are enabled.
    {
      "deepseek-copilot.modelIdOverrides": {
        "deepseek-v4-flash": "your-flash-model-id",
        "deepseek-v4-pro": "your-pro-model-id"
      }
    }