Visual Studio Code添加自定义大模型API

Visual Studio Code 添加自定义大模型baseUrl和apiKey的操作步骤

步骤1:安装扩展

推荐安装第三方扩展:OAI Compatible Provider for Copilot

打开 Visual Studio Code,Ctrl+Shift+X 打开 Visual Studio Code 的扩展(应用商店),输入OAI Compatible Provider for Copilot,检索出来后并安装

步骤2:配置 settings.json

打开 Visual Studio Code,Ctrl+Shift+P 后输入 Preferences: Open User Settings (JSON)

增加OAI Compatible 插件专用格式,baseUrl、apiKey、model一定要确保准确无法,配置内容可参考如下:

bash 复制代码
{
    "typescript.locale": "zh-CN",
    "editor.unicodeHighlight.nonBasicASCII": false,
    "workbench.editorAssociations": {
        "*.etnd": "default"
    },
    "terminal.integrated.initialHint": false,

    // 👇 OAI Compatible 插件核心配置(必须写这里)
    "oaicopilot.models": [
        {
            "id": "内网glm-5.1",
            "label": "内网glm-5.1",
            "apiKey": "sk-xxxx-242e-43db-xxxx-xxxx",
            "model": "glm-5.1",
            "baseUrl": "https://aigw.example.com/glm-5/v1/"
        },
        {
            "id": "内网glm-5",
            "label": "内网glm-5",
            "apiKey": "sk-xxxx-242e-43db-xxxx-xxxx",
            "model": "glm-5",
            "baseUrl": "https://aigw.in.example.com/glm-5/v1/"
        }
    ]
}

步骤3:验证并使用

打开 Copilot 聊天窗口,看左上角,有个模型下拉框,点击设置按钮

可以看到我们刚配置的两个内网模型,推荐可以点击右侧的固定模型按钮,方便对话时选择

回到Copilot 聊天窗口,选择对应模型后就可以对话了

相关推荐
宝桥南山1 天前
Visual Studio 2026新特性 - 可以直接连接DeepSeek(使用Custom Endpoint Provider配置项)
ide·microsoft·微软·aigc·.net·visual studio
wangqiaowq2 天前
Protégé 开源本体(Ontology)编辑器
编辑器
张紫娃3 天前
idea 如何看一个类的 .class 文件
java·ide·intellij-idea
NoteDeep 深度笔记4 天前
DOM 被改乱了怎么办?Notedeep 编辑器的 normalize 设计
前端·javascript·编辑器
顧棟4 天前
组件生命周期设计:从硬编码初始化到状态机
java·ide
jianqiang.xue4 天前
Espressif-IDE进入维护模式:乐鑫把ESP32开发的宝押给VS Code
前端·css·ide
Solange__6 天前
Blender 3D模型优化:普通复制、共享网格、实例、合并怎么选?
人工智能·3d·ai·自然语言处理·编辑器·blender·材质
2601_967980117 天前
世界上最好的Python编辑器是什么?我投PyCharm一票
ide·python·pycharm·数据科学·jupyter notebook