Skip to content
| Marketplace
Sign in
Visual Studio Code>AI>KaiCCNew to Visual Studio Code? Get it now.
KaiCC

KaiCC

suisrc

|
1 install
| (0) | Free
Model config sync component (standalone, no KaiCE install needed). Writes kaicustomendpoint.models / kaicustomendpoint.secrets from settings.json into the official Copilot Custom Endpoint (customendpoint) chatLanguageModels.json, with the API key delivered via model requestHeaders (persisted in Inde
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

KaiCC

模型配置的同步组件(独立扩展,无需依赖 KaiCE 安装)。

将 settings.json 中的 kaicustomendpoint.models / kaicustomendpoint.secrets(自定义模型配置与密钥)同步到 VS Code 官方 Copilot 扩展的 Copilot Custom Endpoint(customendpoint) 的 chatLanguageModels.json,使官方 Copilot 扩展也能使用这些模型。

解决的问题

  • 模型配置与 API Key 常以明文保存在 settings.json(kaicustomendpoint.models / kaicustomendpoint.secrets),刷新不丢。
  • 但这类 kaicustomendpoint.* 配置通常仅供对应 provider 自己使用。
  • KaiCC 把配置同步到官方 customendpoint,让官方 Copilot 扩展自带的 Custom Endpoint provider 也能读取并调用这些模型。

使用方式

扩展激活后在 VS Code 右下角状态栏出现一个小电线图标($(plug)):

  1. 点击图标弹出选择对话框:
    • 「写入模型」:把 kaicustomendpoint.models 中的每个分组写入官方 customendpoint 的 chatLanguageModels.json(vendor=customendpoint)。若分组 apiKey 能从 kaicustomendpoint.secrets 解析出明文,会自动把认证头注入各模型的 requestHeaders(见下文),模型即可直接调用。
    • 「清除模型」:从 chatLanguageModels.json 移除所有 customendpoint 分组。
  2. 也可通过命令面板(Ctrl+Shift+P)执行:
    • KaiCC: write or clear Copilot Custom Endpoint model config(带弹窗)
    • kaicc.writeModels:直接写入
    • kaicc.clearModels:直接清除

有失败项时会弹出警告并可跳转 OUTPUT 面板的「KaiCC」日志通道查看详情。

认证头注入(requestHeaders)

VS Code 官方的 ${input:chat.lm.secret.<id>} 密钥机制在 Web 版有两个先天限制:

  • 官方命令每次写入都会随机生成新 id,同一 key 反复同步会导致引用漂移;
  • Web 版密钥存储是每个窗口各自独立的内存态,而 chatLanguageModels.json 是多窗口共享的持久文件——第二个窗口一同步,引用被换成只有它自己能解析的新 id,第一个窗口随即失效;刷新页面后密钥也丢失。

KaiCC 的解法:「写入模型」时若能解析出明文 apiKey,将其以认证头形式写入各模型的 requestHeaders:

  • 模型已配置任意已知认证头 → 不注入(尊重用户配置);
  • apiType === 'messages' → 注入 x-api-key: <key>;
  • URL 含 openai.azure → 注入 api-key: <key>;
  • 其余 → 注入 Authorization: Bearer <key>。

requestHeaders 不走密钥机制、原样透传,官方 provider 检测到用户自带认证头后会自动抑制默认认证。因此凭据随文件持久化、多窗口一致:刷新页面不掉 key、多窗口互不影响、不覆盖用户已有认证头。

写入的分组不含 apiKey 字段、不走 ${input:...} 引用机制。

同步机制说明

  • 数据源:kaicustomendpoint.models(分组)+ kaicustomendpoint.secrets(密钥映射)。
  • 同步目标:官方 customendpoint vendor 的 chatLanguageModels.json(固定默认 profile 路径 vscode-userdata:///User/chatLanguageModels.json)。
  • 写入策略:读现有文件 → 移除同名分组 → 追加新分组 → 写回(不依赖官方命令)。模型级 toolCalling 未配置时默认 true。
  • 清除策略:移除所有 vendor === 'customendpoint' 的分组(含用户此前通过官方界面手工添加的)。Web 版残留密钥为内存态,刷新页面即清空。

前置条件

  • 无需安装 KaiCE(copilot-kai-ce)。KaiCC 只读取 settings.json 中名为 kaicustomendpoint.models / kaicustomendpoint.secrets 的配置项(可与 KaiCE 共享,也可直接手写)。
  • 官方 Copilot 扩展需处于激活状态(customendpoint vendor 已注册)。

已知限制

  • 仅面向默认 profile:固定写入 vscode-userdata:///User/chatLanguageModels.json,不支持多 profile。
  • 清除范围是全量 customendpoint:无法区分 KaiCC 写入的和用户手工添加的分组,一并移除(属有意设计)。

安全提示

密钥以明文保存在 settings.json(kaicustomendpoint.secrets),同步后以认证头形式随 chatLanguageModels.json 持久化。请勿将含密钥的配置提交到代码仓库或分享给他人。

配置示例(settings.json)

{
  // 密钥映射表,建议使用 user-data 存储,与 models 分开存储
  "kaicustomendpoint.secrets": {
    "alibaba": "sk-xxxxxxxxxxxx",
    "deepseek": "sk-xxxxxxxxxxxx",
    "bigmodel": "sk-xxxxxxxxxxxx"
  },
  // 模型配置中引用
  "kaicustomendpoint.models": [
    {
      "name": "alibaba",
      "vendor": "customendpoint",
      "apiKey": "${input:chat.lm.secret.alibaba}",
      "apiType": "messages",
      "models": [
        {
          "id": "qwen3.8-plus",
          "name": "kai-qwen3.8-plus",
          "url": "https://dashscope.aliyuncs.com/apps/anthropic",
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 256000,
          "maxOutputTokens": 16000,
          "defaultReasoningEffort": "high",
          "supportsReasoningEffort": ["none", "low", "medium", "high", "xhigh", "max"]
        }
      ]
    },
    {
      "name": "deepseek",
      "vendor": "customendpoint",
      "apiKey": "${input:chat.lm.secret.deepseek}",
      "apiType": "messages",
      "models": [
        {
          "id": "deepseek-v4-flash",
          "name": "kai-deepseek-v4-flash",
          "url": "https://api.deepseek.com/anthropic",
          "toolCalling": true,
          "vision": false,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 100000,
          "defaultReasoningEffort": "high",
          "supportsReasoningEffort": ["none", "low", "high", "max"]
        },
        {
          "id": "deepseek-v4-pro",
          "name": "kai-deepseek-v4-pro",
          "url": "https://api.deepseek.com/anthropic",
          "toolCalling": true,
          "vision": false,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 100000,
          "defaultReasoningEffort": "high",
          "supportsReasoningEffort": ["none", "low", "high", "max"]
        },
        {
          "id": "deepseek-v4-flash-vision-exp",
          "name": "kai-deepseek-v4-vision",
          "url": "https://api.deepseek.com/anthropic",
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 100000,
          "defaultReasoningEffort": "high",
          "supportsReasoningEffort": ["none", "low", "high", "max", "high-op"]
        }
      ]
    },
    {
      "name": "bigmodel",
      "vendor": "customendpoint",
      "apiKey": "${input:chat.lm.secret.bigmodel}",
      "apiType": "messages",
      "models": [
        {
          "id": "glm-5.3-flash",
          "name": "kai-glm-5.3-flash",
          "url": "https://open.bigmodel.cn/api/anthropic",
          "toolCalling": true,
          "vision": true,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 100000,
          "defaultReasoningEffort": "high",
          "supportsReasoningEffort": ["low", "high", "max"]
        },
        {
          "id": "glm-5.3",
          "name": "kai-glm-5.3",
          "url": "https://open.bigmodel.cn/api/anthropic",
          "toolCalling": true,
          "vision": false,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 100000,
          "defaultReasoningEffort": "high",
          "supportsReasoningEffort": ["low", "high", "max"]
        },
        {
          "id": "glm-5.2",
          "name": "kai-glm-5.2",
          "url": "https://open.bigmodel.cn/api/anthropic",
          "toolCalling": true,
          "vision": false,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 100000,
          "defaultReasoningEffort": "high",
          "supportsReasoningEffort": ["none", "low", "medium", "high", "xhigh", "max"]
        }
      ]
    },
    {
      "name": "deepseek-openai",
      "vendor": "customendpoint",
      "apiKey": "${input:chat.lm.secret.deepseek}",
      "apiType": "chat-completions",
      "models": [
        {
          "id": "deepseek-v4-flash",
          "name": "kai-deepseek-v4-openai",
          "url": "https://api.deepseek.com",
          "toolCalling": true,
          "vision": false,
          "maxInputTokens": 1000000,
          "maxOutputTokens": 100000,
          "defaultReasoningEffort": "high",
          "supportsReasoningEffort": ["none", "low", "high", "max", "high-op"],
          "metadata": {"user_id": "user-0001"}
        }
      ]
    }
  ]
}

点击右下角 KaiCC → 「写入模型」,即可把上述分组同步到官方 customendpoint,官方 Copilot 扩展即可(在模型选择器中)使用这些模型。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft