Copilot Model BridgeEnglish | 简体中文 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
📋 Requirements
🚀 Installation
🎯 Quick StartMethod 1: Using Model Groups (Recommended)
Method 2: Using Configuration UI
🔧 ConfigurationModel Groups (
|
| 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.groupsis configured or legacycmb.modelsis 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.