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 聊天窗口,选择对应模型后就可以对话了

相关推荐
zhangfeng11331 天前
WebIDE 容器中 AtomCode 报 `ATOMCODE_SIG_STALE` 排查实录:一次由 8 小时时钟偏差引发的“悬案”
编辑器·ai编程·atomcode
witton1 天前
MacOS中在目录或者文件右键菜单中添加“使用VSCode打开”
vscode·macos·文件·目录·服务·automator·右键菜单
wabil1 天前
[AI-Talk] codx制作xmind文件技巧
ide·ai编程·myeclipse·xmind
大衛說2 天前
02 · 环境搭建:uv 包管理与现代 IDE
ide·uv
山峰哥2 天前
数据库工程与查询优化案例深度复盘‌
数据库·sql·oracle·编辑器·深度优先·宽度优先
cndes2 天前
安装Miniconda+Jupyter notebook
ide·python·jupyter
码上暴富2 天前
Cursor / VS Code 自定义文件颜色
前端·vscode
洛兮银儿2 天前
pycharm选中同一个词的标记颜色的修改
ide·python·pycharm
2601_962381582 天前
VSCode如何配置LlamaIndex RAG(检索增强生成)应用开发环境
vscode·开发环境·rag·llamaindex·检索增强生成
javgo.cn2 天前
Markweave:开源 Markdown-first WYSIWYG 编辑器
开源·编辑器