
# OAI Compatible Provider for Copilot
**A VSCode extension to use OpenAI/Ollama/Anthropic/Gemini API Providers in GitHub Copilot Chat** 🔥
English | [ç®€ä½“ä¸æ–‡](README.zh-CN.md)
[](https://github.com/JohnnyZ93/oai-compatible-copilot/actions)
[](https://github.com/JohnnyZ93/oai-compatible-copilot/blob/main/LICENSE)
## ✨ Features
- **Multi-API support**: OpenAI/Ollama/Anthropic/Gemini APIs (ModelScope, SiliconFlow, DeepSeek...)
- **Vision models**: Full support for image understanding capabilities
- **Advanced configuration**: Flexible chat request options with thinking/reasoning control
- **Multi-provider management**: Configure models from multiple providers simultaneously with automatic API key management
- **Multi-config per model**: Define different settings for the same model (e.g., GLM-4.6 with/without thinking)
- **Visual configuration UI**: Intuitive interface for managing providers and models
- **Auto-retry**: Handles API errors (429, 500, 502, 503, 504) with exponential backoff
- **Token usage**: Real-time token counting and provider API key management from status bar
- **Git integration**: Generate commit messages directly from source control
- **Import/export**: Easily share and backup configurations
- **Tools optimization**: Optimize agent `read_file` tool handling, avoid to read small chunks for large file.
## Requirements
- VS Code 1.104.0 or higher.
- OpenAI-compatible provider API key.
## âš¡ Quick Start
1. Install the OAI Compatible Provider for Copilot extension [here](https://marketplace.visualstudio.com/items?itemName=johnny-zhao.oai-compatible-copilot).
2. Open VS Code Settings and configure `oaicopilot.baseUrl` and `oaicopilot.models`.
3. Open GitHub Copilot Chat interface.
4. Click the model picker and select "Manage Models...".
5. Choose "OAI Compatible" provider.
6. Enter your API key — it will be saved locally.
7. Select the models you want to add to the model picker.
### Settings Example
```json
"oaicopilot.baseUrl": "https://api-inference.modelscope.cn/v1",
"oaicopilot.models": [
{
"id": "Qwen/Qwen3-Coder-480B-A35B-Instruct",
"owned_by": "modelscope",
"context_length": 256000,
"max_tokens": 8192,
"temperature": 0,
"top_p": 1
}
]
```
## ✨ Configuration UI
The extension provides a visual configuration interface that makes it easy to manage global settings, providers, and models without editing JSON files manually.
### Opening the Configuration UI
There are two ways to open the configuration interface:
1. **From the Command Palette**:
- Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS)
- Search for "OAICopilot: Open Configuration UI"
- Select the command to open the configuration panel
2. **From the Status Bar**:
- Click on the "OAICopilot" status bar item in the bottom-right corner of VS Code