概述
OAI Compatible Provider for Copilot 的作用是将 Copilot/Copilot Chat 发出的'类似 OpenAI API 的请求',转发到指定的 OpenAI-Compatible 服务端(例如 ModelScope 推理网关、自建的兼容网关等)。
⚠️ 注意 登录 GitHub Copilot 的账号需具备管理模型的权限。建议确认账号状态正常以确保功能可用。
插件安装
在 VS Code 扩展市场安装并启用以下插件:
- GitHub Copilot
- GitHub Copilot Chat
- OAI Compatible Provider for Copilot (johnny-zhao.oai-compatible-copilot)
安装后请执行 Developer: Reload Window 重载窗口一次。确保已在 VS Code 中登录 GitHub,并且 Copilot 正常可用。
配置示例
建议将配置放置在项目内的 .vscode/settings.json 文件中。
1. 单模型示例
{
"oaicopilot.baseUrl": "https://api.soraharu.com/v1",
"oaicopilot.delay": 0,
"oaicopilot.readFileLines": 0,
"oaicopilot.retry": {
"enabled": true,
"max_attempts": 3,
"interval_ms": 1000,
"status_codes": []
},
"oaicopilot.commitLanguage":


