Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>Copilot Model BridgeNew to Visual Studio Code? Get it now.
Copilot Model Bridge

Copilot Model Bridge

btsd321

|
4 installs
| (0) | Free
Integrate OpenAI / Anthropic / Gemini / Ollama API providers into GitHub Copilot Chat
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copilot Model Bridge

GitHub stars VS Code Marketplace License: MIT

English | 简体中文


Integrate OpenAI, Anthropic, Gemini, Ollama, and other OpenAI-compatible API providers into GitHub Copilot Chat. Use your preferred AI models directly within VS Code's native Copilot interface.

✨ Features

  • 🔌 Multiple API Providers - Support for OpenAI, Anthropic (Claude), Google Gemini, Ollama, and any OpenAI-compatible API
  • 📦 Model Groups - Organize models by provider with shared configuration (API key, base URL, headers)
  • 🎨 Configuration UI - Comprehensive webview-based interface for managing providers, models, and settings
  • 🌍 Multi-language Support - English and Simplified Chinese UI
  • 🔐 Secure Storage - API keys stored securely using VS Code SecretStorage
  • 🤖 Git Commit Generation - AI-powered commit message generation in 14 languages
  • ⚙️ Advanced Parameters - Full control over temperature, top_p, top_k, thinking modes, vision support, and more
  • 🔄 Automatic Retry - Built-in retry mechanism for transient API errors
  • 📊 Token Counting - Real-time token usage display in status bar

📋 Requirements

  • VS Code: Version 1.104.0 or higher
  • GitHub Copilot Chat: Required extension dependency

🚀 Installation

  1. Install from VS Code Marketplace
  2. Or search for "Copilot Model Bridge" in VS Code Extensions panel
  3. Ensure GitHub Copilot Chat extension is installed

🎯 Quick Start

Method 1: Using Model Groups (Recommended)

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Run CopilotModelBridge: Add Model Group
  3. Follow the wizard:
    • Enter group name (e.g., "DeepSeek", "Claude", "Local-Ollama")
    • Select API mode (openai, anthropic, gemini, ollama, openai-responses)
    • Enter API key (optional, can be set later)
    • Enter base URL
  4. Run CopilotModelBridge: Add Model to Group
  5. Select the group and configure model details

Method 2: Using Configuration UI

  1. Open Command Palette
  2. Run CopilotModelBridge: Open Configuration UI
  3. Configure global settings, providers, and models in the webview interface

🔧 Configuration

Model Groups (cmb.groups)

The recommended way to configure models. Each group represents one API provider:

{
  "cmb.groups": [
    {
      "name": "DeepSeek",
      "apiMode": "openai",
      "baseUrl": "https://api.deepseek.com/v1",
      "models": [
        {
          "id": "deepseek-chat",
          "displayName": "DeepSeek Chat",
          "context_length": 128000,
          "max_tokens": 4096
        }
      ]
    },
    {
      "name": "Claude",
      "apiMode": "anthropic",
      "baseUrl": "https://api.anthropic.com",
      "models": [
        {
          "id": "claude-sonnet-4-20250514",
          "displayName": "Claude Sonnet 4",
          "context_length": 200000,
          "max_tokens": 8192,
          "vision": true
        }
      ]
    }
  ]
}

API Keys

Set API keys securely via commands:

  • Global API Key: CopilotModelBridge: Set API Key
  • Per-Provider Key: CopilotModelBridge: Set Multi-Provider API Key

Keys are stored in VS Code SecretStorage and never written to settings files.

Language Settings

Switch UI language:

{
  "cmb.language": "en"  // "en" or "zh-cn"
}

Or use command: CopilotModelBridge: Switch Display Language

Git Commit Generation

Configure commit message generation:

{
  "cmb.commitLanguage": "English",  // 14 languages supported
  "cmb.commitMessagePrompt": ""     // Custom system prompt (optional)
}

Mark one model with "useForCommitGeneration": true in your configuration.

📚 Supported API Modes

Mode Endpoint Use Case
openai /chat/completions OpenAI and compatible APIs (default)
openai-responses /responses OpenAI Responses API
anthropic /v1/messages Anthropic Claude API
gemini /v1beta/models/{model}:streamGenerateContent Google Gemini API
ollama /api/chat Ollama local models

🎛️ Advanced Model Parameters

Configure per-model or per-group:

  • Context & Output: context_length, max_tokens, max_completion_tokens
  • Sampling: temperature, top_p, top_k, min_p
  • Penalties: frequency_penalty, presence_penalty, repetition_penalty
  • Thinking Modes: enable_thinking, thinking_budget, reasoning_effort
  • Vision: vision (boolean)
  • Custom: headers (HTTP headers), extra (request body parameters)
  • Delay: delay (ms between requests)

📖 Commands

Command Description
CopilotModelBridge: Open Configuration UI Open webview configuration panel
CopilotModelBridge: Add Model Group Create new model group via wizard
CopilotModelBridge: Add Model to Group Add model to existing group
CopilotModelBridge: Set API Key Set global API key
CopilotModelBridge: Set Multi-Provider API Key Set provider-specific API key
CopilotModelBridge: Switch Display Language Switch between English and Chinese
CopilotModelBridge: Generate Commit Message Generate AI commit message (SCM toolbar)

🔄 Retry Configuration

Automatic retry for transient errors:

{
  "cmb.retry": {
    "enabled": true,
    "max_attempts": 3,
    "interval_ms": 1000,
    "status_codes": [429, 500, 502, 503, 504]
  }
}

🐛 Troubleshooting

Models not appearing in Copilot Chat?

  • Ensure cmb.groups is configured or legacy cmb.models is set
  • Check API keys are set via commands (not in settings.json)
  • Verify base URLs are correct and accessible

API errors?

  • Check Output panel: "Copilot Model Bridge" for detailed logs
  • Verify API key has correct permissions
  • Check retry configuration if seeing transient errors

Configuration UI not loading?

  • Reload VS Code window (Developer: Reload Window)
  • Check for conflicting extensions

📝 Example Configurations

OpenAI Compatible (DeepSeek, OpenRouter, etc.)
{
  "cmb.groups": [
    {
      "name": "DeepSeek",
      "apiMode": "openai",
      "baseUrl": "https://api.deepseek.com/v1",
      "models": [
        {
          "id": "deepseek-chat",
          "context_length": 128000,
          "max_tokens": 4096,
          "temperature": 0.7
        }
      ]
    }
  ]
}
Anthropic Claude
{
  "cmb.groups": [
    {
      "name": "Claude",
      "apiMode": "anthropic",
      "baseUrl": "https://api.anthropic.com",
      "models": [
        {
          "id": "claude-sonnet-4-20250514",
          "context_length": 200000,
          "max_tokens": 8192,
          "vision": true
        }
      ]
    }
  ]
}
Local Ollama
{
  "cmb.groups": [
    {
      "name": "Local-Ollama",
      "apiMode": "ollama",
      "baseUrl": "http://localhost:11434",
      "models": [
        {
          "id": "qwen2.5-coder:32b",
          "context_length": 32768,
          "max_tokens": 4096
        }
      ]
    }
  ]
}

🤝 Contributing

Contributions welcome! Please open issues or pull requests on GitHub.

📄 License

MIT License - see LICENSE file for details.

🔗 Links

  • GitHub Repository
  • VS Code Marketplace
  • Report Issues
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft