copilot-custom-endpoint 3.7.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,7 @@ If [OpenRouter](https://openrouter.ai) is blocked by your network or too generic
13
13
  1. **Pick a model** from the table below.
14
14
  2. **Add it to your VS Code config** — copy the snippet from the model's doc.
15
15
  3. **Set the API key** through VS Code's UI (it goes to your OS keychain, not the file).
16
- 4. **Configure the Utility Small Model** — VS Code now requires a fast fallback model for built-in utility flows. Open Settings → search **"Chat: Utility Small Model"** → pick your fastest custom-endpoint model (or "Default" if you have native Copilot models available). Without this, chat may not function correctly.
16
+ 4. **Check the utility models (optional)** — with a GitHub Copilot token, VS Code already uses Copilot's built-in utility models. Only if you use BYOK without Copilot sign-in do you need to set **Chat: Utility Model** / **Chat: Utility Small Model** (or point `chat.byokUtilityModelDefault` at _Main Agent Model_).
17
17
  5. **Open chat** and pick the model from the model picker.
18
18
 
19
19
  That's it. No code, no servers to manage (unless the model specifically needs the local proxy — the table tells you).
@@ -34,6 +34,19 @@ That's it. No code, no servers to manage (unless the model specifically needs th
34
34
 
35
35
  ## Setup
36
36
 
37
+ ### 0. Know which harness you are on
38
+
39
+ VS Code 1.146 runs chat sessions on one of two harnesses, and custom endpoints behave the same on both in our measurements — but the setup path differs:
40
+
41
+ | Harness | Status | BYOK setup |
42
+ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
43
+ | **Copilot harness** | Default for new sessions since VS Code 1.143. Custom-endpoint BYOK is an **experimental** route. | Enable `chat.agentHost.byokModels.enabled`, then configure the provider normally. |
44
+ | **Local harness** | Deprecated; [scheduled for removal in February 2027](https://code.visualstudio.com/updates/v1_146#_copilot-harness-and-deprecation-of-the-local-harness). | No extra setting — custom endpoints are picked up directly. |
45
+
46
+ If a model does not appear in the picker on the Copilot harness, check that setting before editing `chatLanguageModels.json`. Details: [harness research](docs/research/vscode-1.146-copilot-harness.md#1-harness-transition).
47
+
48
+ > **The session target resets per chat.** Measured on 1.146: a new chat always starts on the Copilot harness even after a Local session, so pick the target again for every new chat. Changing the _model_ inside a live chat keeps the session — and its history — so switching provider mid-conversation carries the earlier turns across.
49
+
37
50
  ### 1. Find (or create) your config file
38
51
 
39
52
  | OS | Path |
@@ -48,29 +61,32 @@ If the file doesn't exist yet, create it with `[]` inside.
48
61
 
49
62
  Open the setup guide for the model you picked (links in the table above) and copy its JSON snippet into the file. Each snippet is a single provider object inside the array.
50
63
 
51
- > **⚠️ Leave `apiKey` as `""`** — never paste the key into the JSON file.
64
+ > **⚠️ Leave `apiKey` as `""`** — a key pasted into this file is **not** used. Measured on VS Code 1.146: an entry with a literal `apiKey` produced `Authorization: Bearer` with an empty token, so the provider answered `401` / "request failed". Use the UI step below.
65
+
66
+ > **The models don't appear in the picker yet.** After editing the file, open **Chat: Manage Language Models** once (or the picker's **Add Models…**) and close it. Measured on 1.146: until the editor has been opened in that window, the picker lists only extension-provided models while the editor already shows your provider.
67
+
68
+ > **Name collision hides your models.** If your provider's `name` matches an installed extension's group (for example `GLM`, when the Z.ai extension is installed), the picker merges them and your models sit behind the extension's group. Give the provider a distinct name (`GLM Relay`, `Qwen (proxy)`, …).
52
69
 
53
70
  ### 3. Set the API key
54
71
 
55
72
  1. Open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`).
56
73
  2. Run **Chat: Manage Language Models**.
57
74
  3. Find your provider in the list, right-click the group name → **Update API Key**.
58
- 4. Paste your key. It's stored in your OS keychain.
75
+ 4. Paste your key. It's stored in your OS keychain, and VS Code resolves it into the request's `Authorization` header — the only path that works.
59
76
 
60
- ### 4. Configure the Utility Small Model
77
+ ### 4. Utility models (usually nothing to do)
61
78
 
62
- > **⚠️ Required for BYOK/custom-endpoint users.** VS Code's latest update mandates that you explicitly set which model handles built-in small/fast utility flows. Without this, custom-endpoint models may not function correctly in chat or agent mode.
79
+ > **You only need this when running BYOK without GitHub sign-in.** With a Copilot token available, VS Code defaults both utility settings to Copilot's built-in utility models.
63
80
 
64
81
  1. Open VS Code Settings (`Ctrl+,` / `Cmd+,`).
65
- 2. Search for **"Chat: Utility Small Model"** (setting ID: `chat.lm.utilitySmallModel`).
66
- 3. Pick the **fastest, cheapest model** available to you from the dropdown. Good choices:
67
- - **GLM 5.3 Flash** — if you have [GLM configured](docs/models/glm.md) (cheapest custom-endpoint option, ~$0.13/session).
68
- - **GPT-6 Luna** — if it is available through your native Copilot models (fast, ~$0.10/session).
69
- - **MiMo V2.6 Flash** — if you already have Xiaomi MiMo configured (low-cost multimodal option, ~$0.10/session).
82
+ 2. Set **Chat: Utility Model** (`chat.utilityModel`) and **Chat: Utility Small Model** (`chat.utilitySmallModel`) — or set `chat.byokUtilityModelDefault` to **Main Agent Model**.
83
+ 3. Pick the **fastest, cheapest model** available to you. Good choices:
84
+ - **GLM 5.3 Flash** — if you have [GLM configured](docs/models/glm.md) (cheapest custom-endpoint option).
85
+ - **MiMo V2.6 Flash** — if you already have Xiaomi MiMo configured (low-cost multimodal option).
70
86
  - **Default** — if you still have native Copilot model access, this lets VS Code use its built-in fast model.
71
87
  4. The setting takes effect immediately — no restart needed.
72
88
 
73
- > **Why this matters:** VS Code uses a small utility model for quick background tasks (token counting, prompt truncation, lightweight completions). When you switch to custom-endpoint models, the framework still needs a fast model for these utility flows. If left unset, some features may silently degrade or fail.
89
+ > **Why this matters:** utility flows (titles, summaries, intent detection, commit messages, PR descriptions) need a small model. Without a Copilot token and without these settings, those features are unavailable. The [VS Code documentation](https://code.visualstudio.com/docs/agent-customization/language-models#_change-the-model-for-utility-tasks) does not list token counting or prompt truncation among them.
74
90
 
75
91
  ### 5. Chat
76
92
 
@@ -123,10 +139,14 @@ The current AA values are **Artificial Analysis Intelligence Index v5.0** compos
123
139
 
124
140
  **Every pricing cell comes from first-party provider pricing or GitHub Copilot’s official billing table, never OpenRouter.** The Qwen 3.8 Max row scores **33.6** under v5.0, and Qwen Cloud PAYG pricing remains **$2 / $0.25 implicit cache / $6**.
125
141
 
126
- This snapshot records Gemini 3.8 Flash, Gemini 4 Argon, Grok 4.7, GPT-6 Sol, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna, Claude Fable 5.2, Claude Opus 5.5, Claude Sonnet 5.5, and Claude Haiku 5.5 as **Copilot-native** models.
142
+ This snapshot records Gemini 3.8 Flash, Gemini 4 Argon, Gemini 4 Carbon, Grok 4.7, GPT-6 Sol, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna, Claude Fable 5.2, Claude Opus 5.5, Claude Sonnet 5.5, and Claude Haiku 5.5 as **Copilot-native** models.
127
143
 
128
144
  **GPT-6.1 Terra** (released October 2026, in Copilot since October 26) enters at **51** on flat pricing of **$1 / $0.05 cache read / $5** per 1M tokens with vision and a 1M context, which puts it at **~$0.0196** per intelligence point — about half of GPT-6.1 Sol’s **~$0.0367**. Gemini 4 Argon (released October 13, 2026) scores **50.4** on Google’s introductory pricing of **$2 / $0.10 implicit cache / $10** per 1M tokens, which doubles to **$4 / $0.20 / $20** on December 1, 2026.
129
145
 
146
+ **Gemini 4 Carbon** (announced October 28, 2026; in Copilot since November 10) scores **60** — second overall behind Claude Fable 5.2 — on the same **$2 / $0.10 / $10** introductory rates as Argon, which also double to **$4 / $0.20 / $20** on December 1. That puts it at **~$0.0333** per intelligence point at roughly **$2.00** per modeled session, but Google notes Carbon spends more tokens per task than Argon, so a real Carbon session costs more at identical rates. Its **60** is Artificial Analysis' current v5.0.1 value; Google's launch post listed **59** under v5.0.
147
+
148
+ **Gemini 4 Hydrogen** (released November 12, 2026) is Google's cheap everyday-execution counterpart to Carbon and Argon, at a flat **$1.50 / $0.075 implicit cache / $7.50** per 1M tokens across the full 1M window — cheaper than Carbon's intro rates and unaffected by the December 1 price step on Argon and Carbon. It scores **54** at its `xhigh` thinking level (**51** at the default `high`), which puts it at **~$0.0278** per intelligence point at roughly **$1.50** per modeled session. It is API-only for now: Google ships it in AI Studio and the Gemini API, including a free tier, but it is not in Copilot, so reaching it means a custom endpoint. Hydrogen always thinks across `low` / `medium` / `high` / `xhigh`, so real token spend tracks the thinking level.
149
+
130
150
  Claude Haiku 5.5 (released October 7, 2026) scores **36.2** and, at **~$0.0028** per intelligence point, is still the lowest cost per intelligence in the table; MiMo V2.6 Flash (**26.7**) is still the cheapest custom-endpoint option at **~$0.0037**.
131
151
 
132
152
  Muse Spark 1.3 (Meta, released September 2, 2026) scores **36.4** on Meta Model API pricing of **$1.25 / $0.15 cached input / $4.25** per 1M tokens; its day-one `muse-spark-1.3-contributor` SKU is excluded from this snapshot because Meta may train future models on those prompts and completions.
@@ -144,7 +164,9 @@ DeepSeek’s **V4.1-Flash-1017** build (released October 17, 2026) scores **32**
144
164
  | **MiMo V2.6 Pro** | Xiaomi | **~$0.0102** | **29.9** | ~$0.30 | ✅ | 1M |
145
165
  | **GPT-6.1 Terra** | OpenAI | **~$0.0196** | **51** | ~$1.00 | ✅ | 1M |
146
166
  | **Gemini 3.8 Flash** | Google | **~$0.0246** | **30.5** | ~$0.75 | ✅ | 1M |
167
+ | **Gemini 4 Hydrogen** | Google | **~$0.0278** | **54** | ~$1.50 | ✅ | 1M |
147
168
  | **Muse Spark 1.3** | Meta | **~$0.0288** | **36.4** | ~$1.05 | ✅ | 1M |
169
+ | **Gemini 4 Carbon** | Google | **~$0.0333** | **60** | ~$2.00 | ✅ | 1M |
148
170
  | **GLM 5.3** | Z.ai | **~$0.0360** | **31.7** | ~$1.14 | ❌ | 1M |
149
171
  | **GPT-6.1 Sol** | OpenAI | **~$0.0367** | **54.5** | ~$2.00 | ✅ | 1M |
150
172
  | **Claude Sonnet 5.5** | Anthropic | **~$0.0369** | **54.2** | ~$2.00 | ✅ | 1M |
@@ -160,7 +182,7 @@ DeepSeek’s **V4.1-Flash-1017** build (released October 17, 2026) scores **32**
160
182
  | **Claude Fable 5.1** | Anthropic | **~$0.2012** | **49.7** | ~$10.00 | ✅ | 1M |
161
183
 
162
184
  > `MiMo V2.6 Pro UltraSpeed` uses the MiMo V2.6 Pro score (same quality, lower latency).
163
- > Plan access: GPT-6 Sol, GPT-6.1 Sol, Claude Opus 5.5, Claude Fable 5.2, and Gemini 4 Argon need Pro+ or higher; GPT-6 Luna and Claude Sonnet 5.5 are available from Pro; Claude Haiku 5.5 is on every paid plan.
185
+ > Plan access: GPT-6 Sol, GPT-6.1 Sol, Claude Opus 5.5, Claude Fable 5.2, Gemini 4 Argon, and Gemini 4 Carbon need Pro+ or higher; GPT-6 Luna and Claude Sonnet 5.5 are available from Pro; Claude Haiku 5.5 is on every paid plan.
164
186
  > Claude Haiku 5.5 is priced by prompt length; the table shows its sub-100K rates.
165
187
 
166
188
  > Detailed pricing, benchmark provenance, and model-specific notes live in [docs/pricing.md](docs/pricing.md) and [docs/benchmarks.md](docs/benchmarks.md). This page stays focused on setup and model selection. For a copy-paste config containing **all providers at once**, see [docs/example-config.md](docs/example-config.md).
@@ -210,7 +232,7 @@ VS Code's built-in `view_image` tool only accepts **static images** (PNG, JPG, G
210
232
  2. If the provider needs request rewriting, add a proxy under `proxy/`.
211
233
  3. Submit a PR.
212
234
 
213
- The current AA values are **Artificial Analysis Intelligence Index v5.0** composites taken from OpenRouter’s model metadata (re-based from v4.3.2 on October 31, 2026); **every pricing cell comes from first-party provider pricing or GitHub Copilot’s official billing table, never OpenRouter.** Qwen Cloud PAYG pricing remains **$2 / $0.25 implicit cache / $6** for Qwen3.8 Max; its separate Token Plan is not the PAYG rate table. This snapshot records Gemini 3.8 Flash, Gemini 4 Argon, Grok 4.7, GPT-6 Sol, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna, Claude Fable 5.2, Claude Opus 5.5, Claude Sonnet 5.5, and Claude Haiku 5.5 as **Copilot-native** models.
235
+ The current AA values are **Artificial Analysis Intelligence Index v5.0** composites taken from OpenRouter’s model metadata (re-based from v4.3.2 on October 31, 2026); **every pricing cell comes from first-party provider pricing or GitHub Copilot’s official billing table, never OpenRouter.** Qwen Cloud PAYG pricing remains **$2 / $0.25 implicit cache / $6** for Qwen3.8 Max; its separate Token Plan is not the PAYG rate table. This snapshot records Gemini 3.8 Flash, Gemini 4 Argon, Gemini 4 Carbon, Grok 4.7, GPT-6 Sol, GPT-6.1 Sol, GPT-6.1 Terra, GPT-6 Luna, Claude Fable 5.2, Claude Opus 5.5, Claude Sonnet 5.5, and Claude Haiku 5.5 as **Copilot-native** models.
214
236
 
215
237
  - **Chat only.** Inline completions, semantic search, and next-edit suggestions still need a GitHub-hosted model.
216
238
  - Each proxy is tuned for a specific provider family. Don't point the Kimi proxy at an arbitrary OpenAI-compatible endpoint.
@@ -2,11 +2,17 @@
2
2
 
3
3
  Here's a complete, real-world `chatLanguageModels.json` that combines **the `customendpoint` providers from the live `chatLanguageModels.json`**, plus the additional GLM models (`glm-5.3-flash`, `glm-5.3`, `glm-5.2`, `glm-5.1`) that are validated in [docs/models/glm.md](models/glm.md) but not present in every live config. Copy what you need, leave the rest out.
4
4
 
5
- > **⚠️ Reminder:** After adding models, you must also configure the **Utility Small Model** setting in VS Code. Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4.1 Flash or MiMo V2.6 Flash). Without this, custom-endpoint models may not function correctly. See the [main README](../README.md#4-configure-the-utility-small-model) for details.
6
- >
7
- > **Note:** The `apiKey` fields are left as empty strings — set them via the **Chat: Manage Language Models** UI (Command Palette → right-click provider group → **Update API Key**). After you set a key via the UI, VS Code replaces the empty string with a `${input:chat.lm.secret.<id>}` secret reference.
8
- >
9
- > The live config points Qwen at the local proxy (`:3458`) and MiMo at the local proxy (`:3459`). When using a proxy, align the model `requestBody` overrides with the proxy's behavior: Qwen sends no `requestBody` (the proxy manages `enable_thinking` dynamically); MiMo sends only `temperature` and `top_p` (the proxy injects `thinking: {"type": "disabled"}` when tool history is missing `reasoning_content` and leaves it absent on plain chat). This DashScope config uses the provider ID `qwen3.8-max`.
5
+ > **⚠️ Measured on VS Code 1.146 (both harnesses):** `modelOptions` is forwarded to the provider; **`requestBody` is silently dropped**. Provider-specific objects such as `thinking`, `reasoning_split`, `enable_thinking`, and `max_tokens` therefore cannot be set from this file — route those models through their proxy, or accept the provider defaults. See [the harness research](research/vscode-1.146-copilot-harness.md).
6
+
7
+ > **Harness check:** on the Copilot harness, custom-endpoint BYOK is experimental and requires `chat.agentHost.byokModels.enabled`; the Local harness is deprecated (removal planned February 2027) and needs no extra setting. See [README § Setup #0](../README.md#0-know-which-harness-you-are-on).
8
+
9
+ > **Utility models:** with a GitHub Copilot token, VS Code already uses its built-in utility models, so no extra setup is required. If you use BYOK without Copilot sign-in, set **Chat: Utility Model** and **Chat: Utility Small Model** (or `chat.byokUtilityModelDefault` → _Main Agent Model_). See the [main README](../README.md#4-configure-the-utility-small-model).
10
+
11
+ > **Note:** The `apiKey` fields are left as empty strings — set them via the **Chat: Manage Language Models** UI (Command Palette → right-click provider group → **Update API Key**). After you set a key via the UI, VS Code replaces the empty string with a `${input:chat.lm.secret.<id>}` secret reference. A key pasted directly into this file is not used: measured on 1.146, the request went out as `Authorization: Bearer` with an empty token and the provider rejected it.
12
+
13
+ > **After saving, open the Language Models editor once.** On 1.146 a provider added to this file stays invisible in the model picker until **Chat: Manage Language Models** (or the picker's **Add Models…**) has been opened in that window; the editor itself shows the provider immediately. If your provider's `name` matches an installed extension (for example `GLM` with the Z.ai extension installed), the picker merges them and your models hide behind the extension group — give the provider a distinct name.
14
+
15
+ > **Note:** The live config points Qwen at the local proxy (`:3458`) and MiMo at the local proxy (`:3459`). The proxies manage thinking dynamically, so no thinking-related configuration belongs in this file.
10
16
 
11
17
  ```json
12
18
  [
@@ -23,7 +29,7 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
23
29
  "toolCalling": true,
24
30
  "vision": true,
25
31
  "streaming": true,
26
- "maxInputTokens": 991000,
32
+ "maxInputTokens": 868928,
27
33
  "maxOutputTokens": 131072
28
34
  }
29
35
  ]
@@ -38,14 +44,14 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
38
44
  "id": "kimi-k3.1-pro",
39
45
  "name": "Kimi K3.1 Pro (vision)",
40
46
  "url": "http://127.0.0.1:3457/v1/chat/completions",
41
- "requestBody": {
42
- "temperature": 1,
43
- "max_tokens": 8192
44
- },
47
+ "modelOptions": { "temperature": 1 },
48
+ "supportsReasoningEffort": ["low", "high", "max"],
49
+ "reasoningEffortFormat": "chat-completions",
50
+ "thinking": true,
45
51
  "toolCalling": true,
46
52
  "vision": true,
47
53
  "streaming": true,
48
- "maxInputTokens": 1000000,
54
+ "maxInputTokens": 917504,
49
55
  "maxOutputTokens": 131072
50
56
  }
51
57
  ]
@@ -63,12 +69,9 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
63
69
  "toolCalling": true,
64
70
  "vision": true,
65
71
  "streaming": true,
66
- "maxInputTokens": 1048576,
72
+ "maxInputTokens": 917504,
67
73
  "maxOutputTokens": 131072,
68
- "requestBody": {
69
- "temperature": 1,
70
- "top_p": 0.95
71
- }
74
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
72
75
  },
73
76
  {
74
77
  "id": "mimo-v2.6-flash",
@@ -77,12 +80,9 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
77
80
  "toolCalling": true,
78
81
  "vision": true,
79
82
  "streaming": true,
80
- "maxInputTokens": 1048576,
83
+ "maxInputTokens": 917504,
81
84
  "maxOutputTokens": 131072,
82
- "requestBody": {
83
- "temperature": 1,
84
- "top_p": 0.95
85
- }
85
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
86
86
  },
87
87
  {
88
88
  "id": "mimo-v2.6-pro-ultraspeed",
@@ -91,12 +91,9 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
91
91
  "toolCalling": true,
92
92
  "vision": true,
93
93
  "streaming": true,
94
- "maxInputTokens": 1048576,
94
+ "maxInputTokens": 917504,
95
95
  "maxOutputTokens": 131072,
96
- "requestBody": {
97
- "temperature": 1,
98
- "top_p": 0.95
99
- }
96
+ "modelOptions": { "temperature": 1, "top_p": 0.95 }
100
97
  }
101
98
  ]
102
99
  },
@@ -113,15 +110,12 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
113
110
  "toolCalling": true,
114
111
  "vision": true,
115
112
  "streaming": true,
116
- "maxInputTokens": 1048576,
113
+ "maxInputTokens": 868928,
117
114
  "maxOutputTokens": 131072,
118
- "requestBody": {
119
- "thinking": { "type": "adaptive" },
120
- "reasoning_split": true,
121
- "reasoning_effort": "high",
122
- "temperature": 1,
123
- "top_p": 0.95
124
- }
115
+ "modelOptions": { "temperature": 1, "top_p": 0.95 },
116
+ "supportsReasoningEffort": ["low", "medium", "high", "xhigh", "max"],
117
+ "reasoningEffortFormat": "chat-completions",
118
+ "thinking": true
125
119
  }
126
120
  ]
127
121
  },
@@ -138,14 +132,12 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
138
132
  "toolCalling": true,
139
133
  "vision": true,
140
134
  "streaming": true,
141
- "maxInputTokens": 1048576,
135
+ "maxInputTokens": 917504,
142
136
  "maxOutputTokens": 131072,
143
- "requestBody": {
144
- "thinking": { "type": "enabled" },
145
- "reasoning_effort": "max",
146
- "temperature": 1.0,
147
- "top_p": 0.95
148
- }
137
+ "modelOptions": { "temperature": 1, "top_p": 0.95 },
138
+ "supportsReasoningEffort": ["low", "high", "max"],
139
+ "reasoningEffortFormat": "chat-completions",
140
+ "thinking": true
149
141
  },
150
142
  {
151
143
  "id": "glm-5.3",
@@ -154,14 +146,12 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
154
146
  "toolCalling": true,
155
147
  "vision": false,
156
148
  "streaming": true,
157
- "maxInputTokens": 1048576,
149
+ "maxInputTokens": 917504,
158
150
  "maxOutputTokens": 131072,
159
- "requestBody": {
160
- "thinking": { "type": "enabled" },
161
- "reasoning_effort": "max",
162
- "temperature": 1.0,
163
- "top_p": 0.95
164
- }
151
+ "modelOptions": { "temperature": 1, "top_p": 0.95 },
152
+ "supportsReasoningEffort": ["low", "high", "max"],
153
+ "reasoningEffortFormat": "chat-completions",
154
+ "thinking": true
165
155
  }
166
156
  ]
167
157
  }
@@ -170,12 +160,24 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
170
160
 
171
161
  ## Per-model snippets
172
162
 
163
+ > **Context limits follow one rule:** VS Code treats `maxInputTokens + maxOutputTokens` as the model's total context window, and the sum must not exceed the provider's advertised window. Every entry above therefore declares `maxInputTokens = window − maxOutputTokens`:
164
+ >
165
+ > | Model | Window (provider) | `maxOutputTokens` | `maxInputTokens` |
166
+ > | -------------------------- | ----------------- | ----------------- | ---------------- |
167
+ > | `qwen3.8-max` | 1,000,000 | 131,072 | 868,928 |
168
+ > | `kimi-k3.1-pro` | 1,048,576 | 131,072 | 917,504 |
169
+ > | `mimo-v2.6-*` | 1,048,576 | 131,072 | 917,504 |
170
+ > | `MiniMax-M3.1-Flash` | 1,000,000 | 131,072 | 868,928 |
171
+ > | `glm-5.3`, `glm-5.3-flash` | 1,048,576 | 131,072 | 917,504 |
172
+ >
173
+ > Trade-off: a smaller `maxInputTokens` makes VS Code compact the conversation slightly earlier than the provider's raw input cap (for example 868,928 instead of DashScope's 991,000-token input maximum), which is the safe side of the constraint. Alternatively set `contextWindow` to the provider's window and let VS Code derive `maxInputTokens = contextWindow − maxOutputTokens`. Sources and derivation: [harness research § 4](research/vscode-1.146-copilot-harness.md#4-utility-models-and-context-limits).
174
+
173
175
  If you only need one provider, jump straight to its setup guide:
174
176
 
175
- - [Kimi K3.1 Pro / K2.6 / K2.7 Code](kimi.md)
176
- - [Qwen 3.8 Max](qwen.md)
177
- - [Xiaomi MiMo (V2.6 Pro / Flash / Pro UltraSpeed)](mimo.md)
178
- - [MiniMax M3.1 Flash](minimax.md)
179
- - [GLM (5.3 Flash / 5.3 / 5.2 / 5.1)](glm.md)
177
+ - [Kimi K3.1 Pro / K2.6 / K2.7 Code](models/kimi.md)
178
+ - [Qwen 3.8 Max](models/qwen.md)
179
+ - [Xiaomi MiMo (V2.6 Pro / Flash / Pro UltraSpeed)](models/mimo.md)
180
+ - [MiniMax M3.1 Flash](models/minimax.md)
181
+ - [GLM (5.3 Flash / 5.3 / 5.2 / 5.1)](models/glm.md)
180
182
 
181
183
  > **DeepSeek V4.1 Flash 1017** uses the [DeepSeek for Copilot Chat extension](https://marketplace.visualstudio.com/items?itemName=Vizards.deepseek-v4-for-copilot). It appears in `chatLanguageModels.json` as `vendor: "deepseek"` (not as a `customendpoint` provider) and is configured via the extension's settings block.
@@ -12,20 +12,22 @@
12
12
  | **GLM Models for Copilot** (KiwiGaze) | [`yijiazhen-qi.glm-for-github-copilot-chat`](https://marketplace.visualstudio.com/items?itemName=yijiazhen-qi.glm-for-github-copilot-chat) | ✅ | ✅ | Quota dashboard, dual API |
13
13
  | **GLM Chat Provider** (zelosleone) | _(pending)_ | ❌ | ✅ | 14 models, per-model thinking tiers |
14
14
 
15
+ > **Live-validated 2026-11-13** (VS Code 1.146, both harnesses): `glm-5.3-flash` completed plain chat plus a multi-step tool loop with HTTP 200 on both harnesses, and `glm-5.3` (text) did the same on the Copilot harness. `reasoning_effort: "low"` and `max_completion_tokens: 131072` reached Z.ai with **no `thinking` object**, which is correct — the server forces deep thinking and `clear_thinking` handles history. No `reasoning_content` was replayed on the tool turn. Copilot sends 128 tools and Local sends 57; vision and long-context compaction were not tested. See [harness research § 9](../../research/vscode-1.146-copilot-harness.md#9-phase-3-live-provider-validation-2026-11-13).
16
+
15
17
  ## At a Glance
16
18
 
17
- | Field | Value |
18
- | ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
19
- | Mode | **Direct** (no proxy) |
20
- | Billing | **Pay-as-You-Go** (PaaS API) — Coding Plan subscription exists but is **not usable** from VS Code custom endpoints |
21
- | Vision | ✅ Yes (`glm-5.3-flash`) |
22
- | Tool calling | ✅ Yes (native multimodal tool use on `glm-5.3-flash`) |
23
- | Context | 1M (`glm-5.3-flash` / `glm-5.3` / `glm-5.2` Solid Lossless Context) |
24
- | Max output | 131072 |
25
- | Required `requestBody` | `thinking: { type: "enabled" }` + `reasoning_effort: "max"` (recommended) |
26
- | Endpoint (intl) | `https://api.z.ai/api/paas/v4/chat/completions` |
27
- | Endpoint (China) | `https://open.bigmodel.cn/api/paas/v4/chat/completions` |
28
- | Auth | `Authorization: Bearer $ZAI_API_KEY` |
19
+ | Field | Value |
20
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------ |
21
+ | Mode | **Direct** (no proxy) |
22
+ | Billing | **Pay-as-You-Go** (PaaS API) — Coding Plan subscription exists but is **not usable** from VS Code custom endpoints |
23
+ | Vision | ✅ Yes (`glm-5.3-flash`) |
24
+ | Tool calling | ✅ Yes (native multimodal tool use on `glm-5.3-flash`) |
25
+ | Context | 1M (`glm-5.3-flash` / `glm-5.3` / `glm-5.2` Solid Lossless Context) |
26
+ | Max output | 131072 |
27
+ | Supported config | `modelOptions` for sampling + `supportsReasoningEffort` + `reasoningEffortFormat: "chat-completions"` |
28
+ | Endpoint (intl) | `https://api.z.ai/api/paas/v4/chat/completions` |
29
+ | Endpoint (China) | `https://open.bigmodel.cn/api/paas/v4/chat/completions` |
30
+ | Auth | `Authorization: Bearer $ZAI_API_KEY` |
29
31
 
30
32
  ### Models
31
33
 
@@ -71,14 +73,12 @@
71
73
  "toolCalling": true,
72
74
  "vision": true,
73
75
  "streaming": true,
74
- "maxInputTokens": 1048576,
76
+ "maxInputTokens": 917504,
75
77
  "maxOutputTokens": 131072,
76
- "requestBody": {
77
- "thinking": { "type": "enabled" },
78
- "reasoning_effort": "max",
79
- "temperature": 1.0,
80
- "top_p": 0.95
81
- }
78
+ "modelOptions": { "temperature": 1, "top_p": 0.95 },
79
+ "supportsReasoningEffort": ["low", "high", "max"],
80
+ "reasoningEffortFormat": "chat-completions",
81
+ "thinking": true
82
82
  },
83
83
  {
84
84
  "id": "glm-5.3",
@@ -87,19 +87,19 @@
87
87
  "toolCalling": true,
88
88
  "vision": false,
89
89
  "streaming": true,
90
- "maxInputTokens": 1048576,
90
+ "maxInputTokens": 917504,
91
91
  "maxOutputTokens": 131072,
92
- "requestBody": {
93
- "thinking": { "type": "enabled" },
94
- "reasoning_effort": "max",
95
- "temperature": 1.0,
96
- "top_p": 0.95
97
- }
92
+ "modelOptions": { "temperature": 1, "top_p": 0.95 },
93
+ "supportsReasoningEffort": ["low", "high", "max"],
94
+ "reasoningEffortFormat": "chat-completions",
95
+ "thinking": true
98
96
  }
99
97
  ]
100
98
  }
101
99
  ```
102
100
 
101
+ > **Context budget:** `917504 + 131072 = 1048576`, the GLM 5.x window (input and output combined). VS Code uses that sum as the model's total context, so only raise `maxInputTokens` by lowering `maxOutputTokens`.
102
+
103
103
  > **Leave `apiKey` as `""`** — set it through the Language Models UI so VS Code stores it in the OS keychain (it will replace the empty string with a `${input:chat.lm.secret.<id>}` reference).
104
104
  > If you signed up on `bigmodel.cn` (China), swap the `url` values in the block above to the regional endpoint `https://open.bigmodel.cn/api/paas/v4/chat/completions`.
105
105
 
@@ -119,27 +119,27 @@
119
119
 
120
120
  ## Notes
121
121
 
122
- - **Sampling:** recommended `temperature: 1`, `top_p: 0.95`. Z.ai's `temperature` is **hard-capped at `1.0` server-side** — sending `> 1.0` will reject with a 400. Don't set `do_sample: false` from `requestBody` (it would make `temperature`/`top_p` be ignored).
122
+ - **Sampling:** recommended `temperature: 1`, `top_p: 0.95` in `modelOptions`. Z.ai's `temperature` is **hard-capped at `1.0` server-side** — sending `> 1.0` will reject with a 400. On VS Code 1.146 `requestBody` is dropped, so `do_sample` and other provider keys cannot be sent from this file.
123
123
  - **`tool_choice` only supports `auto`** — don't override it (VS Code's default is `auto`).
124
- - **`clear_thinking` defaults to `true` server-side**, which strips historical `reasoning_content` from prior turns before sending to the model. This is what makes multi-turn tool loops stable. **Do not** set `clear_thinking: false` from `requestBody` — VS Code can't forward `reasoning_content` and the request will fail. (Note: Z.ai's GLM-5.3-Flash docs recommend `thinking.clear_thinking: false` for clients that **do** preserve `reasoning_content` — e.g. Claude Code / agent SDKs — not for the VS Code custom-endpoint path.)
125
- - **GLM 5.3 and GLM 5.3 Flash are always-thinking** — `thinking.type` only supports `enabled`; disabling reasoning is **not supported**. `reasoning_effort` accepts `low`, `high`, or `max` (default `max`; `max` recommended for coding). If you previously sent `thinking.type: "disabled"` for other GLM models, switch it to `enabled` with `reasoning_effort: "low"` when moving to `glm-5.3` / `glm-5.3-flash`.
124
+ - **`clear_thinking` defaults to `true` server-side**, which strips historical `reasoning_content` from prior turns before sending to the model. This is what makes multi-turn tool loops stable. It cannot be changed from `chatLanguageModels.json` on 1.146 (`requestBody` is dropped) — leave it at the server default. Note: Z.ai's GLM-5.3-Flash docs recommend `thinking.clear_thinking: false` for clients that **do** preserve `reasoning_content` — e.g. Claude Code / agent SDKs — not for the VS Code custom-endpoint path.
125
+ - **GLM 5.3 and GLM 5.3 Flash are always-thinking** — `thinking.type` only supports `enabled`; disabling reasoning is **not supported**, and the provider thinks by default, so the dropped `requestBody.thinking` key changes nothing. `reasoning_effort` accepts `low`, `high`, or `max` (default `max`; `max` recommended for coding) and is exposed through the model picker via `supportsReasoningEffort`.
126
126
  - **Vision** is supported on `glm-5.3-flash` (native multimodal — the first in the GLM-5 series; text + image input, text output). `glm-5.3`, `glm-5.2` and `glm-5.1` are text-only. For turnkey VS Code video understanding, see [**Video Context MCP**](https://www.videocontextmcp.com/). **Validated 2026-08-28 on `glm-5.3-flash`:** both vision surfaces work through the custom endpoint — chat image attachments (base64 `image_url`) and the `view_image` tool on workspace files. Fine-grained text, layout, and image content were read correctly in both tests.
127
127
  - **Context caching** is automatic — `usage.prompt_tokens_details.cached_tokens` reports cache hits; cache writes are currently free. Cache reads for `glm-5.3-flash` are $0.03/M (list; $0.015/M during the launch promo).
128
128
 
129
129
  ## Troubleshooting
130
130
 
131
- | Symptom | Likely cause | Fix |
132
- | -------------------------------------------------------- | --------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
133
- | Model not in picker | Config not reloaded, or JSON syntax error | Restart VS Code; validate JSON |
134
- | HTTP 400 on the first turn | `requestBody` removed `do_sample` semantics or invalid `temperature` | Ensure `temperature ≤ 1.0` and `top_p ∈ [0.01, 1.0]` |
135
- | `invalid temperature: only values ≤ 1.0 are allowed` | Set `temperature > 1.0` | Lower it to `1.0` or below |
136
- | Tool call succeeds but follow-up turn degrades | `clear_thinking: false` set in `requestBody` | Remove the `clear_thinking` key and let the server default to `true` |
137
- | `tool_choice: required` rejected | GLM only supports `auto` | Don't override `tool_choice` (VS Code's default is `auto`) |
138
- | `thinking.type: disabled` rejected on `glm-5.3` | GLM 5.3 only supports enabled thinking; reasoning cannot be disabled | Use `thinking: { "type": "enabled" }` + `reasoning_effort: "low"` (or higher) |
139
- | `Failed to download multimodal content` on a vision call | Z.ai's servers couldn't reach the image URL | Use a base64 `data:image/...` URI instead |
140
- | 401 Unauthorized | Region mismatch (international key used on China URL, or vice versa) | Match your key to the regional endpoint |
141
- | Upstream complains about `reasoning_content is missing` | You set `clear_thinking: false` from a client that doesn't forward it | Drop `clear_thinking` from `requestBody` |
142
- | 429 / "concurrency limit exceeded" | Too many in-flight requests | Reduce concurrent agent sessions, or upgrade your Z.ai plan |
131
+ | Symptom | Likely cause | Fix |
132
+ | -------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------- |
133
+ | Model not in picker | Config not reloaded, or JSON syntax error | Restart VS Code; validate JSON |
134
+ | HTTP 400 on the first turn | Invalid `temperature` or `top_p` in `modelOptions` | Ensure `temperature ≤ 1.0` and `top_p ∈ [0.01, 1.0]` |
135
+ | `invalid temperature: only values ≤ 1.0 are allowed` | Set `temperature > 1.0` | Lower it to `1.0` or below |
136
+ | Tool call succeeds but follow-up turn degrades | Server-side `clear_thinking` behaviour with incomplete history | Leave `clear_thinking` at its default; it cannot be set from this file |
137
+ | `tool_choice: required` rejected | GLM only supports `auto` | Don't override `tool_choice` (VS Code's default is `auto`) |
138
+ | `thinking.type: disabled` rejected on `glm-5.3` | GLM 5.3 only supports enabled thinking; reasoning cannot be disabled | Don't send `thinking`; lower `reasoning_effort` in the model picker instead |
139
+ | `Failed to download multimodal content` on a vision call | Z.ai's servers couldn't reach the image URL | Use a base64 `data:image/...` URI instead |
140
+ | 401 Unauthorized | Region mismatch (international key used on China URL, or vice versa) | Match your key to the regional endpoint |
141
+ | Upstream complains about `reasoning_content is missing` | A client that sets `clear_thinking: false` without forwarding reasoning | Leave the server default (`true`); the key is not settable from this file |
142
+ | 429 / "concurrency limit exceeded" | Too many in-flight requests | Reduce concurrent agent sessions, or upgrade your Z.ai plan |
143
143
 
144
144
  ## Pricing
145
145
 
@@ -20,6 +20,10 @@
20
20
  | Proxy endpoint | `http://127.0.0.1:3457/v1/chat/completions` |
21
21
  | Auth | `Authorization: Bearer $KIMI_API_KEY` |
22
22
 
23
+ > **Live-validated 2026-11-13** (VS Code 1.146, both harnesses): plain chat plus a multi-step tool loop returned HTTP 200 on both turns through the local proxy, and the follow-up request **replayed
24
+ > `reasoning_content` on the assistant tool-call message** — the first direct evidence of reasoning replay on a custom endpoint.
25
+ > `reasoning_effort: "high"` and `max_completion_tokens: 131072` reached Moonshot. Copilot sends 128 tools and Local sends 57; vision and long-context compaction were not tested. See [harness research § 9](../../research/vscode-1.146-copilot-harness.md#9-phase-3-live-provider-validation-2026-11-13).
26
+
23
27
  ### Models
24
28
 
25
29
  | Model | Vision | Context | Max output | Notes |
@@ -58,18 +62,23 @@
58
62
  "id": "kimi-k3.1-pro",
59
63
  "name": "Kimi K3.1 Pro (Custom Endpoint)",
60
64
  "url": "http://127.0.0.1:3457/v1/chat/completions",
61
- "requestBody": { "temperature": 1, "max_tokens": 8192 },
65
+ "modelOptions": { "temperature": 1 },
66
+ "supportsReasoningEffort": ["low", "high", "max"],
67
+ "reasoningEffortFormat": "chat-completions",
68
+ "thinking": true,
62
69
  "toolCalling": true,
63
70
  "vision": true,
64
71
  "streaming": true,
65
- "maxInputTokens": 1000000,
72
+ "maxInputTokens": 917504,
66
73
  "maxOutputTokens": 131072
67
74
  }
68
75
  ]
69
76
  }
70
77
  ```
71
78
 
72
- > **K3.1 Pro note:** `max_tokens` is set to **8192** as a safe starting point. K3.1 Pro is always-thinking and very verbose (150M tokens generated on the AA Intelligence Index evaluation versus an 87M median). The API default for `max_completion_tokens` is 131072 and can go up to 1048576, but reasoning tokens inflate response size — monitor your usage and adjust upward if needed. K3.1 Pro uses `reasoning_effort` (`low` / `high` / `max`, default `max`), not the K2.x `thinking` parameter; add `"reasoning_effort": "low"` to `requestBody` if answers take too long. The proxy forwards the value untouched.
79
+ > **Context budget:** `917504 + 131072 = 1048576`, the K3.1 Pro window (input and output combined). VS Code uses that sum as the model's total context, so only raise `maxInputTokens` by lowering `maxOutputTokens`.
80
+
81
+ > **K3.1 Pro note:** `requestBody` is **not forwarded** on VS Code 1.146 (measured on both harnesses), so `max_tokens` and a `reasoning_effort` entry in the config have no effect. `modelOptions` handles sampling, and the `supportsReasoningEffort` metadata above adds the **Thinking Effort** picker so you can lower effort without editing JSON. K3.1 Pro is always-thinking and very verbose (150M tokens generated on the AA Intelligence Index evaluation versus an 87M median); the API default for `max_completion_tokens` is 131072 and can go up to 1048576, but reasoning tokens inflate response size — monitor usage. Because this entry declares `thinking: true`, `maxOutputTokens` **is** forwarded as `max_completion_tokens` (measured: 131072 reached Moonshot), so lower that value to cap output; entries without the `thinking` metadata do not get this forwarding.
73
82
 
74
83
  ### 2. API key
75
84
 
@@ -112,7 +121,7 @@ Set in `.env` at the repo root (the proxy `import 'dotenv/config'` automatically
112
121
 
113
122
  - Forwards your `Authorization` header upstream.
114
123
  - Rewrites plain-chat requests to `temperature: 1`, `top_p: 0.95`.
115
- - For **K2.5 / K2.6**: rewrites tool-enabled requests to `thinking: { type: "disabled" }`, `temperature: 0.6`, `top_p: 0.95`.
124
+ - For **K2.5 / K2.6**: rewrites tool-enabled requests to `thinking: { type: "disabled" }`, `temperature: 0.6`, `top_p: 0.95`. Tool activity means a `"tool"`-role message in history or a non-default `tool_choice`; a `tools` array alone, or `tool_choice: "none"`, is treated as plain chat.
116
125
  - For **K3.1 Pro**: keeps thinking enabled (always-thinking, uses `reasoning_effort`, not `thinking`); rewrites to `temperature: 1`, `top_p: 0.95`. Does **not** inject a `thinking` block — K3.1 Pro rejects it. Every `kimi-k3*` slug is handled this way, including `kimi-k3.1-pro` and `kimi-k3.1-pro-highspeed`.
117
126
  - Preserves streaming responses (SSE).
118
127
  - Writes redacted request summaries to `debug_log/kimi-proxy.ndjson`.