一、说明
OAI Compatible Provider for Copilot 插件的作用是将 Copilot/Copilot Chat 发出的类似 OpenAI API 的请求,转发到指定的 OpenAI-Compatible 服务端(例如 ModelScope 推理网关、自建的兼容网关等)。
注意
账号类型可能影响模型管理功能,建议确认 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"



