copilot-custom-endpoint 3.1.2 → 3.3.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 +43 -39
- package/cli.mjs +1 -1
- package/docs/example-config.md +23 -9
- package/docs/models/glm.md +1 -1
- package/docs/models/kimi.md +1 -1
- package/docs/models/mimo.md +92 -65
- package/docs/models/minimax.md +1 -1
- package/docs/models/qwen.md +2 -2
- package/docs/pricing.md +29 -63
- package/lib/mimo-rewrite.mjs +77 -0
- package/package.json +2 -2
- package/proxy/mimo-proxy.mjs +13 -67
package/README.md
CHANGED
|
@@ -20,18 +20,19 @@ That's it. No code, no servers to manage (unless the model specifically needs th
|
|
|
20
20
|
|
|
21
21
|
## Pick a model
|
|
22
22
|
|
|
23
|
-
| Model
|
|
24
|
-
|
|
|
25
|
-
| **Kimi K3**
|
|
26
|
-
| **MiMo V2.
|
|
27
|
-
| **MiMo V2.
|
|
28
|
-
| **
|
|
29
|
-
| **Qwen 3.8 Max (
|
|
30
|
-
| **
|
|
31
|
-
| **
|
|
32
|
-
| **GLM 5.3**
|
|
33
|
-
| **
|
|
34
|
-
| **DeepSeek V4
|
|
23
|
+
| Model | Provider | Needs proxy? | Vision | Setup guide |
|
|
24
|
+
| ---------------------------- | ---------- | ----------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| **Kimi K3** | Moonshot | **Yes** | ✅ | [Manual setup](docs/models/kimi.md) |
|
|
26
|
+
| **MiMo V2.6 Pro** | Xiaomi | **Yes** | ✅ | [Extension](https://marketplace.visualstudio.com/items?itemName=sdmapvstool.xiaomimimo-for-copilot) / [Manual setup](docs/models/mimo.md) |
|
|
27
|
+
| **MiMo V2.6 Flash** | Xiaomi | **Yes** | ✅ | [Extension](https://marketplace.visualstudio.com/items?itemName=sdmapvstool.xiaomimimo-for-copilot) / [Manual setup](docs/models/mimo.md) |
|
|
28
|
+
| **MiMo V2.6 Pro UltraSpeed** | Xiaomi | **Yes** | ✅ | [Extension](https://marketplace.visualstudio.com/items?itemName=sdmapvstool.xiaomimimo-for-copilot) / [Manual setup](docs/models/mimo.md) |
|
|
29
|
+
| **Qwen 3.8 Max (0803)** | OpenRouter | Optional (experimental) | ✅ | [Snapshot/proxy setup](docs/models/qwen.md#optional-openrouter-snapshot-proxy) |
|
|
30
|
+
| **Qwen 3.8 Max (0902)** | DashScope | Optional (recommended) | ✅ | [Manual setup](docs/models/qwen.md) |
|
|
31
|
+
| **MiniMax M3** | MiniMax | No | ✅ | [Extension](https://github.com/tugudush/minimax-copilot) ★ / [Manual setup](docs/models/minimax.md) |
|
|
32
|
+
| **GLM 5.3 Flash** | Z.ai | No | ✅ | [Manual setup](docs/models/glm.md) |
|
|
33
|
+
| **GLM 5.3** | Z.ai | No | ❌ | [Manual setup](docs/models/glm.md) |
|
|
34
|
+
| **DeepSeek V4.1 Flash** | DeepSeek | No (uses an extension) | ✅ | [Extension](https://marketplace.visualstudio.com/items?itemName=Vizards.deepseek-v4-for-copilot) / [setup notes](docs/models/deepseek.md) |
|
|
35
|
+
| **DeepSeek V4 Pro 0813** | DeepSeek | No (uses an extension) | ❌ | [Extension](https://marketplace.visualstudio.com/items?itemName=Vizards.deepseek-v4-for-copilot) / [setup notes](docs/models/deepseek.md) |
|
|
35
36
|
|
|
36
37
|
## Setup
|
|
37
38
|
|
|
@@ -67,7 +68,7 @@ Open the setup guide for the model you picked (links in the table above) and cop
|
|
|
67
68
|
3. Pick the **fastest, cheapest model** available to you from the dropdown. Good choices:
|
|
68
69
|
- **GLM 5.3 Flash** — if you have [GLM configured](docs/models/glm.md) (cheapest custom-endpoint option, ~$0.13/session).
|
|
69
70
|
- **GPT-5.6 Luna** — if it is available through your native Copilot models (fast, ~$0.22/session).
|
|
70
|
-
- **MiMo V2.
|
|
71
|
+
- **MiMo V2.6 Flash** — if you already have Xiaomi MiMo configured (low-cost multimodal option, ~$0.10/session).
|
|
71
72
|
- **Default** — if you still have native Copilot model access, this lets VS Code use its built-in fast model.
|
|
72
73
|
4. The setting takes effect immediately — no restart needed.
|
|
73
74
|
|
|
@@ -120,31 +121,34 @@ It approximates the cost of one point on the AA Intelligence Index under the com
|
|
|
120
121
|
|
|
121
122
|
For example, GLM 5.3 Flash is `(0.5 × $0.15) + (0.1 × $0.50) = $0.125`, shown as `~$0.13`. Cached-input discounts are not included. Actual costs vary with context length, output length, caching, pricing tiers, promotions, and provider billing. DeepSeek estimates use peak rates; official off-peak rates are half.
|
|
122
123
|
|
|
123
|
-
The current AA values come from OpenRouter's September
|
|
124
|
-
|
|
125
|
-
| Model
|
|
126
|
-
|
|
|
127
|
-
| **GLM 5.3 Flash**
|
|
128
|
-
| **
|
|
129
|
-
| **
|
|
130
|
-
| **DeepSeek V4.1 Flash**
|
|
131
|
-
| **MiniMax M3**
|
|
132
|
-
| **
|
|
133
|
-
| **
|
|
134
|
-
| **
|
|
135
|
-
| **
|
|
136
|
-
| **
|
|
137
|
-
| **Qwen 3.8 Max (
|
|
138
|
-
| **
|
|
139
|
-
| **
|
|
140
|
-
| **
|
|
141
|
-
| **
|
|
142
|
-
| **Kimi K3**
|
|
143
|
-
| **GPT-5.6 Sol**
|
|
144
|
-
| **Claude Opus 5**
|
|
145
|
-
| **Claude Fable 5.1**
|
|
146
|
-
| **GPT-6 Astra**
|
|
147
|
-
| **Claude Fable 5**
|
|
124
|
+
The current AA values come from OpenRouter's September 22 model metadata and ranking card; **every pricing cell comes from first-party provider pricing or GitHub Copilot's official billing table, never OpenRouter.** The OpenRouter ranking card places unversioned Qwen3.8 Max at **53.4 (#2)**, while the exact 0902 API metadata row is **45.4**. 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 refresh records Gemini 3.8 Flash as **Copilot-native** and adds Xiaomi MiMo V2.6 and xAI Grok 4.7 as **Copilot-native** models, using the current AA v4.3.2 composites.
|
|
125
|
+
|
|
126
|
+
| Model | Provider | Cost per intelligence | Intelligence Score | Est. session | Vision | Context window |
|
|
127
|
+
| ---------------------------- | --------- | --------------------- | ------------------ | ------------ | ------ | -------------- |
|
|
128
|
+
| **GLM 5.3 Flash** | Z.ai | **~$0.0030** | **41.8** | ~$0.13 | ✅ | 1M |
|
|
129
|
+
| **GPT-5.6 Luna** | OpenAI | **~$0.0059** | **37.3** | ~$0.22 | ✅ | 1M |
|
|
130
|
+
| **MiMo V2.6 Pro** | Xiaomi | **~$0.0066** | **46.3** | ~$0.30 | ✅ | 1M |
|
|
131
|
+
| **DeepSeek V4.1 Flash** | DeepSeek | **~$0.0068** | **39.5** | ~$0.27 | ✅ | 1M |
|
|
132
|
+
| **MiniMax M3** | MiniMax | **~$0.0093** | **29.2** | ~$0.27 | ✅ | 1M |
|
|
133
|
+
| **Gemini 3.8 Flash** | Google | **~$0.0183** | **40.9** | ~$0.75 | ✅ | 1M |
|
|
134
|
+
| **GLM 5.3** | Z.ai | **~$0.0254** | **44.8** | ~$1.14 | ❌ | 1M |
|
|
135
|
+
| **DeepSeek V4 Pro 0813** | DeepSeek | **~$0.0294** | **36.0** | ~$1.06 | ❌ | 1M |
|
|
136
|
+
| **Qwen 3.8 Max (0803)** | DashScope | **~$0.0300** | **53.4** | ~$1.60 | ✅ | 1M |
|
|
137
|
+
| **Grok 4.7** | xAI | **~$0.0345** | **46.4** | ~$1.60 | ✅ | 500K |
|
|
138
|
+
| **Qwen 3.8 Max (0902)** | DashScope | **~$0.0352** | **45.4** | ~$1.60 | ✅ | 1M |
|
|
139
|
+
| **Grok 4.6** | xAI | **~$0.0361** | **44.3** | ~$1.60 | ✅ | 500K |
|
|
140
|
+
| **GPT-5.6 Terra** | OpenAI | **~$0.0523** | **42.1** | ~$2.20 | ✅ | 1M |
|
|
141
|
+
| **Claude Sonnet 5** | Anthropic | **~$0.0524** | **38.2** | ~$2.00 | ✅ | 1M |
|
|
142
|
+
| **MiMo V2.6 Pro UltraSpeed** | Xiaomi | **~$0.0658** | **46.3** | ~$3.05 | ✅ | 1M |
|
|
143
|
+
| **Kimi K3** | Moonshot | **~$0.0688** | **43.6** | ~$3.00 | ✅ | 1M |
|
|
144
|
+
| **GPT-5.6 Sol** | OpenAI | **~$0.0851** | **47.0** | ~$4.00 | ✅ | 1M |
|
|
145
|
+
| **Claude Opus 5** | Anthropic | **~$0.0984** | **50.8** | ~$5.00 | ✅ | 1M |
|
|
146
|
+
| **Claude Fable 5.1** | Anthropic | **~$0.1873** | **53.4** | ~$10.00 | ✅ | 1M |
|
|
147
|
+
| **GPT-6 Astra** | OpenAI | **~$0.1898** | **52.7** | ~$10.00 | ✅ | 1M |
|
|
148
|
+
| **Claude Fable 5** | Anthropic | **~$0.2016** | **49.6** | ~$10.00 | ✅ | 1M |
|
|
149
|
+
| **MiMo V2.6 Flash** | Xiaomi | — | — | ~$0.10 | ✅ | 1M |
|
|
150
|
+
|
|
151
|
+
> `MiMo V2.6 Pro UltraSpeed` uses the MiMo V2.6 Pro benchmark score because it is the same-quality latency tier; no independent composite is published. `MiniMax M3 Priority` is intentionally omitted from this snapshot because it is the same model with a priority service tier; the full pricing table documents its separate tier cost.
|
|
148
152
|
|
|
149
153
|
> 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).
|
|
150
154
|
|
|
@@ -166,7 +170,7 @@ VS Code's built-in `view_image` tool only accepts **static images** (PNG, JPG, G
|
|
|
166
170
|
**Video Context MCP** is a small MCP server that bridges that gap. It works with **GitHub Copilot, Cursor, and Claude Code** out of the box, and:
|
|
167
171
|
|
|
168
172
|
- **Extracts frames** from local files or remote URLs (no `ffmpeg` gymnastics required).
|
|
169
|
-
- **Routes them through a multi-provider fallback chain** — `Gemini → GLM 4.6V Flash → Qwen3.8-max
|
|
173
|
+
- **Routes them through a multi-provider fallback chain** — `Gemini → GLM 4.6V Flash → Qwen3.8-max`.
|
|
170
174
|
- **Answers natural-language questions** about the video grounded in actual frames: "what does the speaker click in the last 30 seconds?", "summarize the demo", "find the frame where the error appears".
|
|
171
175
|
- **Extras:** timestamp search, audio transcription with speaker diarization, and video metadata (resolution, duration, codec).
|
|
172
176
|
|
package/cli.mjs
CHANGED
|
@@ -15,7 +15,7 @@ Start a local proxy for VS Code Copilot custom endpoints.
|
|
|
15
15
|
copilot-custom-endpoint all Start all proxies concurrently (default)
|
|
16
16
|
copilot-custom-endpoint kimi Start the Kimi K2 proxy on port 3457
|
|
17
17
|
copilot-custom-endpoint qwen Start the Qwen 3.x proxy on port 3458
|
|
18
|
-
copilot-custom-endpoint mimo Start the MiMo V2.
|
|
18
|
+
copilot-custom-endpoint mimo Start the MiMo V2.6 proxy on port 3459
|
|
19
19
|
copilot-custom-endpoint clean Remove the debug_log/ directory
|
|
20
20
|
|
|
21
21
|
Environment variables: see --help for each proxy.
|
package/docs/example-config.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
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 Flash or MiMo V2.
|
|
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 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
6
|
>
|
|
7
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
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"}`
|
|
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). OpenRouter lists Qwen 3.8 Max as two frozen snapshots (`qwen/qwen3.8-max` = 0803 and `qwen/qwen3.8-max-0902` = 0902); this DashScope config intentionally uses the provider ID `qwen3.8-max` and does not pretend the OpenRouter slugs are interchangeable.
|
|
10
10
|
|
|
11
11
|
```json
|
|
12
12
|
[
|
|
@@ -57,11 +57,11 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
|
|
|
57
57
|
"apiType": "chat-completions",
|
|
58
58
|
"models": [
|
|
59
59
|
{
|
|
60
|
-
"id": "mimo-v2.
|
|
61
|
-
"name": "MiMo V2.
|
|
60
|
+
"id": "mimo-v2.6-pro",
|
|
61
|
+
"name": "MiMo V2.6 Pro",
|
|
62
62
|
"url": "http://127.0.0.1:3459/v1/chat/completions",
|
|
63
63
|
"toolCalling": true,
|
|
64
|
-
"vision":
|
|
64
|
+
"vision": true,
|
|
65
65
|
"streaming": true,
|
|
66
66
|
"maxInputTokens": 1048576,
|
|
67
67
|
"maxOutputTokens": 131072,
|
|
@@ -71,14 +71,28 @@ Here's a complete, real-world `chatLanguageModels.json` that combines **the `cus
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
"id": "mimo-v2.
|
|
75
|
-
"name": "MiMo V2.
|
|
74
|
+
"id": "mimo-v2.6-flash",
|
|
75
|
+
"name": "MiMo V2.6 Flash",
|
|
76
76
|
"url": "http://127.0.0.1:3459/v1/chat/completions",
|
|
77
77
|
"toolCalling": true,
|
|
78
78
|
"vision": true,
|
|
79
79
|
"streaming": true,
|
|
80
80
|
"maxInputTokens": 1048576,
|
|
81
|
-
"maxOutputTokens":
|
|
81
|
+
"maxOutputTokens": 131072,
|
|
82
|
+
"requestBody": {
|
|
83
|
+
"temperature": 1,
|
|
84
|
+
"top_p": 0.95
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "mimo-v2.6-pro-ultraspeed",
|
|
89
|
+
"name": "MiMo V2.6 Pro UltraSpeed",
|
|
90
|
+
"url": "http://127.0.0.1:3459/v1/chat/completions",
|
|
91
|
+
"toolCalling": true,
|
|
92
|
+
"vision": true,
|
|
93
|
+
"streaming": true,
|
|
94
|
+
"maxInputTokens": 1048576,
|
|
95
|
+
"maxOutputTokens": 131072,
|
|
82
96
|
"requestBody": {
|
|
83
97
|
"temperature": 1,
|
|
84
98
|
"top_p": 0.95
|
|
@@ -159,7 +173,7 @@ If you only need one provider, jump straight to its setup guide:
|
|
|
159
173
|
|
|
160
174
|
- [Kimi K3 / K2.6 / K2.7 Code](kimi.md)
|
|
161
175
|
- [Qwen 3.8 Max](qwen.md)
|
|
162
|
-
- [Xiaomi MiMo (V2.
|
|
176
|
+
- [Xiaomi MiMo (V2.6 Pro / Flash / Pro UltraSpeed)](mimo.md)
|
|
163
177
|
- [MiniMax M3 (Standard)](minimax.md) and [MiniMax M3 (Priority)](minimax.md#5-m3-priority-tier-optional)
|
|
164
178
|
- [GLM (5.3 Flash / 5.3 / 5.2 / 5.1)](glm.md)
|
|
165
179
|
|
package/docs/models/glm.md
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
2. **Generate an API key** on the API Keys page of the platform.
|
|
45
45
|
3. **Edit `chatLanguageModels.json`** — add the GLM block below.
|
|
46
46
|
4. **Set the API key** via Command Palette → **Chat: Manage Language Models** → right-click **GLM** → **Update API Key**.
|
|
47
|
-
5. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.
|
|
47
|
+
5. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.6 Flash). [Why?](../../README.md#4-configure-the-utility-small-model)
|
|
48
48
|
6. **Restart VS Code** and select a GLM model from the picker.
|
|
49
49
|
|
|
50
50
|
## Setup
|
package/docs/models/kimi.md
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
1. **Start the proxy** — `npm run proxy:kimi` (or `npx copilot-custom-endpoint kimi` standalone).
|
|
34
34
|
2. **Edit `chatLanguageModels.json`** — add the Kimi block below.
|
|
35
35
|
3. **Set your Moonshot API key** via Command Palette → **Chat: Manage Language Models**.
|
|
36
|
-
4. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.
|
|
36
|
+
4. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.6 Flash). [Why?](../../README.md#4-configure-the-utility-small-model)
|
|
37
37
|
5. **Restart VS Code** and pick "Kimi K3".
|
|
38
38
|
|
|
39
39
|
## Setup
|
package/docs/models/mimo.md
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
# Xiaomi MiMo — VS Code Custom Endpoint Setup Guide
|
|
2
2
|
|
|
3
|
-
> **TL;DR:**
|
|
3
|
+
> **TL;DR:** MiMo V2.6 is now the current API family. The proxy-backed custom endpoint keeps V2.6 thinking enabled when `reasoning_content` is present and falls back to disabled thinking when VS Code drops that history field. Direct and proxy configurations are documented below.
|
|
4
4
|
|
|
5
5
|
## At a Glance
|
|
6
6
|
|
|
7
|
-
| Field | Value
|
|
8
|
-
| ---------------------- |
|
|
9
|
-
| **Recommended method** |
|
|
10
|
-
| Alternative methods | Direct API (static `thinking: disabled`) or
|
|
11
|
-
| Mode (custom endpoint) | **Direct** (static `thinking: disabled`) **or** **Proxy** (dynamic, local on `:3459`)
|
|
12
|
-
| Billing | **Pay-as-You-Go** _or_ **Token Plan subscription** (shared `requestBody`)
|
|
13
|
-
| Vision | ✅ Yes (
|
|
14
|
-
| Tool calling | ✅ Yes
|
|
15
|
-
| Context |
|
|
16
|
-
| Max output | 131072
|
|
17
|
-
| Endpoint | `https://api.xiaomimimo.com/v1/chat/completions`
|
|
18
|
-
| Proxy endpoint | `http://127.0.0.1:3459/v1/chat/completions`
|
|
19
|
-
| Auth | `Authorization: Bearer $MIMO_API_KEY`
|
|
7
|
+
| Field | Value |
|
|
8
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| **Recommended method** | **`proxy/mimo-proxy.mjs`** for V2.6 custom endpoints; the extension is still useful when its model picker exposes V2.6 |
|
|
10
|
+
| Alternative methods | Direct API (static `thinking: disabled`) or the Xiaomi extension |
|
|
11
|
+
| Mode (custom endpoint) | **Direct** (static `thinking: disabled`) **or** **Proxy** (dynamic, local on `:3459`) |
|
|
12
|
+
| Billing | **Pay-as-You-Go** _or_ **Token Plan subscription** (shared `requestBody`) |
|
|
13
|
+
| Vision | ✅ Yes (all V2.6 models) |
|
|
14
|
+
| Tool calling | ✅ Yes; V2.6 preserves thinking only when the history includes `reasoning_content` |
|
|
15
|
+
| Context | 1M |
|
|
16
|
+
| Max output | 131072 |
|
|
17
|
+
| Endpoint | `https://api.xiaomimimo.com/v1/chat/completions` |
|
|
18
|
+
| Proxy endpoint | `http://127.0.0.1:3459/v1/chat/completions` |
|
|
19
|
+
| Auth | `Authorization: Bearer $MIMO_API_KEY` |
|
|
20
20
|
|
|
21
21
|
### Models
|
|
22
22
|
|
|
23
|
-
| Model | Vision | Context | Max output
|
|
24
|
-
| -------------------------- | ------ | ------- |
|
|
25
|
-
| `mimo-v2.
|
|
26
|
-
| `mimo-v2.
|
|
27
|
-
| `mimo-v2.
|
|
23
|
+
| Model | Vision | Context | Max output | Notes |
|
|
24
|
+
| -------------------------- | ------ | ------- | ---------- | ------------------------------------------------------------------ |
|
|
25
|
+
| `mimo-v2.6-pro` | ✅ | 1M | 131072 | Flagship full-modality reasoning for complex and long-horizon work |
|
|
26
|
+
| `mimo-v2.6-flash` | ✅ | 1M | 131072 | Lower-cost full-modality model for frequent calls |
|
|
27
|
+
| `mimo-v2.6-pro-ultraspeed` | ✅ | 1M | 131072 | V2.6 Pro quality with the latency-focused UltraSpeed service |
|
|
28
28
|
|
|
29
|
-
>
|
|
29
|
+
> Xiaomi's API requires the lowercase IDs above.
|
|
30
30
|
|
|
31
31
|
## Quick Start
|
|
32
32
|
|
|
33
|
-
### Recommended:
|
|
33
|
+
### Recommended: V2.6 custom endpoint with proxy
|
|
34
34
|
|
|
35
|
-
1.
|
|
36
|
-
2.
|
|
37
|
-
3.
|
|
38
|
-
4.
|
|
35
|
+
1. Add the proxy configuration from the setup section below.
|
|
36
|
+
2. Start `npm run proxy:mimo` from the repository root.
|
|
37
|
+
3. Set your API key through **Chat: Manage Language Models**.
|
|
38
|
+
4. Pick **MiMo V2.6 Pro**, **MiMo V2.6 Flash**, or **MiMo V2.6 Pro UltraSpeed** in Copilot Chat.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
The [Xiaomi MiMo for Copilot Chat](https://marketplace.visualstudio.com/items?itemName=sdmapvstool.xiaomimimo-for-copilot) extension remains the best option when its picker exposes the V2.6 IDs because it can cache reasoning per tool call. The custom endpoint is useful when you need direct control over the model IDs, URL, or proxy behavior.
|
|
41
41
|
|
|
42
|
-
| Capability | Extension | Custom Endpoint
|
|
43
|
-
| -------------------------------- | ------------------------------------ |
|
|
44
|
-
| Thinking + tool calling together | ✅ Yes (reasoning cache) |
|
|
45
|
-
| Reasoning visible in agent mode | ✅ Yes (`LanguageModelThinkingPart`) |
|
|
46
|
-
| Prompt caching feedback loop | ✅ 97–99% cache hit rates | ❌ No cache awareness
|
|
47
|
-
| Token usage in context widget | ✅ Yes | ❌ No
|
|
48
|
-
| `mimo-v2.
|
|
49
|
-
| Multi-region endpoint selector | ✅ Built-in dropdown | ❌ Manual JSON edits
|
|
50
|
-
| Dependencies | ✅ Zero (VS Code + Node built-ins) | ❌ Requires proxy server
|
|
42
|
+
| Capability | Extension | Custom Endpoint |
|
|
43
|
+
| -------------------------------- | ------------------------------------ | --------------------------------------- |
|
|
44
|
+
| Thinking + tool calling together | ✅ Yes (reasoning cache) | ✅ When `reasoning_content` is retained |
|
|
45
|
+
| Reasoning visible in agent mode | ✅ Yes (`LanguageModelThinkingPart`) | ⚠️ Depends on request history |
|
|
46
|
+
| Prompt caching feedback loop | ✅ 97–99% cache hit rates | ❌ No cache awareness |
|
|
47
|
+
| Token usage in context widget | ✅ Yes | ❌ No |
|
|
48
|
+
| `mimo-v2.6-pro-ultraspeed` model | Depends on extension version | ✅ Yes |
|
|
49
|
+
| Multi-region endpoint selector | ✅ Built-in dropdown | ❌ Manual JSON edits |
|
|
50
|
+
| Dependencies | ✅ Zero (VS Code + Node built-ins) | ❌ Requires proxy server |
|
|
51
51
|
|
|
52
52
|
> **Prerequisites:** VS Code 1.116+, GitHub Copilot subscription (Free tier works), and a MiMo API key from [platform.xiaomimimo.com](https://platform.xiaomimimo.com/console/api-keys). MIT-licensed. Source: [Sdcb/xiaomimimo-for-copilot](https://github.com/Sdcb/xiaomimimo-for-copilot).
|
|
53
53
|
|
|
@@ -57,12 +57,12 @@ Simplest no-proxy approach — but thinking is always off, so you never see mode
|
|
|
57
57
|
|
|
58
58
|
1. **Edit `chatLanguageModels.json`** — add the MiMo block(s) below.
|
|
59
59
|
2. **Set your `MIMO_API_KEY`** via Command Palette → **Chat: Manage Language Models**.
|
|
60
|
-
3. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.
|
|
61
|
-
4. **Restart VS Code** and pick
|
|
60
|
+
3. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.6 Flash). [Why?](../../README.md#4-configure-the-utility-small-model)
|
|
61
|
+
4. **Restart VS Code** and pick one of the V2.6 entries.
|
|
62
62
|
|
|
63
63
|
### Alternative: With optional proxy (dynamic thinking)
|
|
64
64
|
|
|
65
|
-
The `proxy/mimo-proxy.mjs`
|
|
65
|
+
The `proxy/mimo-proxy.mjs` preserves V2.6 thinking when assistant tool-call history contains `reasoning_content`. When VS Code sends a tool loop with missing reasoning history, it injects `thinking: { "type": "disabled" }` to avoid Xiaomi's 400 response.
|
|
66
66
|
|
|
67
67
|
- `npm run proxy:mimo` (from the repo root)
|
|
68
68
|
- `npx copilot-custom-endpoint mimo` (standalone)
|
|
@@ -106,11 +106,11 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
|
|
|
106
106
|
"apiType": "chat-completions",
|
|
107
107
|
"models": [
|
|
108
108
|
{
|
|
109
|
-
"id": "mimo-v2.
|
|
110
|
-
"name": "MiMo V2.
|
|
109
|
+
"id": "mimo-v2.6-pro",
|
|
110
|
+
"name": "MiMo V2.6 Pro",
|
|
111
111
|
"url": "https://api.xiaomimimo.com/v1/chat/completions",
|
|
112
112
|
"toolCalling": true,
|
|
113
|
-
"vision":
|
|
113
|
+
"vision": true,
|
|
114
114
|
"streaming": true,
|
|
115
115
|
"maxInputTokens": 1048576,
|
|
116
116
|
"maxOutputTokens": 131072,
|
|
@@ -121,14 +121,29 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
"id": "mimo-v2.
|
|
125
|
-
"name": "MiMo V2.
|
|
124
|
+
"id": "mimo-v2.6-flash",
|
|
125
|
+
"name": "MiMo V2.6 Flash",
|
|
126
126
|
"url": "https://api.xiaomimimo.com/v1/chat/completions",
|
|
127
127
|
"toolCalling": true,
|
|
128
128
|
"vision": true,
|
|
129
129
|
"streaming": true,
|
|
130
130
|
"maxInputTokens": 1048576,
|
|
131
|
-
"maxOutputTokens":
|
|
131
|
+
"maxOutputTokens": 131072,
|
|
132
|
+
"requestBody": {
|
|
133
|
+
"thinking": { "type": "disabled" },
|
|
134
|
+
"temperature": 1,
|
|
135
|
+
"top_p": 0.95
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"id": "mimo-v2.6-pro-ultraspeed",
|
|
140
|
+
"name": "MiMo V2.6 Pro UltraSpeed",
|
|
141
|
+
"url": "https://api.xiaomimimo.com/v1/chat/completions",
|
|
142
|
+
"toolCalling": true,
|
|
143
|
+
"vision": true,
|
|
144
|
+
"streaming": true,
|
|
145
|
+
"maxInputTokens": 1048576,
|
|
146
|
+
"maxOutputTokens": 131072,
|
|
132
147
|
"requestBody": {
|
|
133
148
|
"thinking": { "type": "disabled" },
|
|
134
149
|
"temperature": 1,
|
|
@@ -149,25 +164,36 @@ The extension stores your API key in VS Code's `SecretStorage` (OS keychain).
|
|
|
149
164
|
"apiType": "chat-completions",
|
|
150
165
|
"models": [
|
|
151
166
|
{
|
|
152
|
-
"id": "mimo-v2.
|
|
153
|
-
"name": "MiMo V2.
|
|
167
|
+
"id": "mimo-v2.6-pro",
|
|
168
|
+
"name": "MiMo V2.6 Pro",
|
|
154
169
|
"url": "http://127.0.0.1:3459/v1/chat/completions",
|
|
155
170
|
"toolCalling": true,
|
|
156
|
-
"vision":
|
|
171
|
+
"vision": true,
|
|
157
172
|
"streaming": true,
|
|
158
173
|
"maxInputTokens": 1048576,
|
|
159
174
|
"maxOutputTokens": 131072,
|
|
160
175
|
"requestBody": { "temperature": 1, "top_p": 0.95 }
|
|
161
176
|
},
|
|
162
177
|
{
|
|
163
|
-
"id": "mimo-v2.
|
|
164
|
-
"name": "MiMo V2.
|
|
178
|
+
"id": "mimo-v2.6-flash",
|
|
179
|
+
"name": "MiMo V2.6 Flash",
|
|
165
180
|
"url": "http://127.0.0.1:3459/v1/chat/completions",
|
|
166
181
|
"toolCalling": true,
|
|
167
182
|
"vision": true,
|
|
168
183
|
"streaming": true,
|
|
169
184
|
"maxInputTokens": 1048576,
|
|
170
|
-
"maxOutputTokens":
|
|
185
|
+
"maxOutputTokens": 131072,
|
|
186
|
+
"requestBody": { "temperature": 1, "top_p": 0.95 }
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"id": "mimo-v2.6-pro-ultraspeed",
|
|
190
|
+
"name": "MiMo V2.6 Pro UltraSpeed",
|
|
191
|
+
"url": "http://127.0.0.1:3459/v1/chat/completions",
|
|
192
|
+
"toolCalling": true,
|
|
193
|
+
"vision": true,
|
|
194
|
+
"streaming": true,
|
|
195
|
+
"maxInputTokens": 1048576,
|
|
196
|
+
"maxOutputTokens": 131072,
|
|
171
197
|
"requestBody": { "temperature": 1, "top_p": 0.95 }
|
|
172
198
|
}
|
|
173
199
|
]
|
|
@@ -196,7 +222,7 @@ The extension has a built-in multi-region endpoint selector covering all Token P
|
|
|
196
222
|
|
|
197
223
|
## Local Proxy
|
|
198
224
|
|
|
199
|
-
The `proxy/mimo-proxy.mjs` (optional)
|
|
225
|
+
The `proxy/mimo-proxy.mjs` (optional) keeps V2.6 reasoning enabled when the conversation history is complete and suppresses it only when a tool loop is missing `reasoning_content`. If you want Xiaomi's full reasoning cache behavior, use an extension version that explicitly supports V2.6.
|
|
200
226
|
|
|
201
227
|
| Setting | Value |
|
|
202
228
|
| ------------ | ----------------------------------------------------- |
|
|
@@ -206,32 +232,33 @@ The `proxy/mimo-proxy.mjs` (optional) provides dynamic thinking suppression: rea
|
|
|
206
232
|
| Start | `npm run proxy:mimo` (or `node proxy/mimo-proxy.mjs`) |
|
|
207
233
|
| Help | `node proxy/mimo-proxy.mjs --help` |
|
|
208
234
|
|
|
209
|
-
When using the proxy, point model `url`s to `http://127.0.0.1:3459/v1/chat/completions` and **remove** `thinking` from `requestBody`. The proxy handles
|
|
235
|
+
When using the proxy, point model `url`s to `http://127.0.0.1:3459/v1/chat/completions` and **remove** `thinking` from `requestBody`. The proxy handles V2.6 history-aware fallback dynamically.
|
|
210
236
|
|
|
211
237
|
## Notes
|
|
212
238
|
|
|
213
|
-
- **Thinking is required for full agent quality.** MiMo returns HTTP 400 if `reasoning_content` is missing from history when thinking is on.
|
|
239
|
+
- **Thinking is required for full agent quality.** MiMo V2.6 returns HTTP 400 if `reasoning_content` is missing from history when thinking is on. The proxy preserves thinking when that field is present and disables it as a compatibility fallback when VS Code drops it; an extension with a per-`tool_call_id` reasoning cache can keep thinking enabled throughout.
|
|
214
240
|
- **`tool_choice` other than `"auto"` is stripped** and treated as `"auto"`. Don't override it (VS Code's default is `auto`).
|
|
215
241
|
- **Rate limits:** 100 RPM / 10M TPM per model per account.
|
|
216
|
-
- **Vision
|
|
242
|
+
- **Vision and full modality:** V2.6 Pro, Flash, and Pro UltraSpeed accept text, image, video, and audio; VS Code custom endpoints expose image input through `vision: true`.
|
|
217
243
|
|
|
218
244
|
## Troubleshooting
|
|
219
245
|
|
|
220
|
-
| Symptom | Likely cause | Fix
|
|
221
|
-
| ------------------------------------------ | -------------------------------------------------------- |
|
|
222
|
-
| HTTP 400 on the second turn of a tool loop | `reasoning_content` missing in history (thinking on) |
|
|
223
|
-
| Vision request returns an error |
|
|
224
|
-
| Custom `tool_choice` ignored | MiMo only honors `"auto"` | Stick to `auto`
|
|
225
|
-
| 401 Unauthorized | Wrong key, or Token Plan URL used with pay-as-you-go key | Match key prefix (`sk-` vs `tp-`) to the endpoint
|
|
226
|
-
| 429 rate-limited | Concurrent sessions exceeded 100 RPM / 10M TPM | Reduce concurrent agent sessions
|
|
246
|
+
| Symptom | Likely cause | Fix |
|
|
247
|
+
| ------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
248
|
+
| HTTP 400 on the second turn of a tool loop | `reasoning_content` missing in history (thinking on) | Use the proxy (`npm run proxy:mimo`), or add `thinking: { type: "disabled" }` to `requestBody`; an extension with a reasoning cache can keep thinking enabled |
|
|
249
|
+
| Vision request returns an error | The model entry is missing `vision: true` | Add `vision: true` to the model entry — every current MiMo model accepts image input |
|
|
250
|
+
| Custom `tool_choice` ignored | MiMo only honors `"auto"` | Stick to `auto` |
|
|
251
|
+
| 401 Unauthorized | Wrong key, or Token Plan URL used with pay-as-you-go key | Match key prefix (`sk-` vs `tp-`) to the endpoint |
|
|
252
|
+
| 429 rate-limited | Concurrent sessions exceeded 100 RPM / 10M TPM | Reduce concurrent agent sessions |
|
|
227
253
|
|
|
228
254
|
## Pricing
|
|
229
255
|
|
|
230
256
|
For the cross-provider comparison, see [docs/pricing.md](../pricing.md). Overseas (international) pay-as-you-go rates:
|
|
231
257
|
|
|
232
|
-
| Model
|
|
233
|
-
|
|
|
234
|
-
| `mimo-v2.
|
|
235
|
-
| `mimo-v2.
|
|
258
|
+
| Model | Input (Cache Hit) | Input (Cache Miss) | Output |
|
|
259
|
+
| -------------------------- | ----------------- | ------------------ | ---------- |
|
|
260
|
+
| `mimo-v2.6-pro` | $0.0036 / 1M | $0.435 / 1M | $0.87 / 1M |
|
|
261
|
+
| `mimo-v2.6-flash` | $0.0028 / 1M | $0.14 / 1M | $0.28 / 1M |
|
|
262
|
+
| `mimo-v2.6-pro-ultraspeed` | $0.036 / 1M | $4.35 / 1M | $8.70 / 1M |
|
|
236
263
|
|
|
237
264
|
> Cache writing is currently free of charge (limited-time offer). MiMo also offers a Token Plan subscription with discounted rates and a free cache-writing promotion.
|
package/docs/models/minimax.md
CHANGED
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
1. **Edit `chatLanguageModels.json`** — add the MiniMax block below.
|
|
40
40
|
2. **Set your `MINIMAX_API_KEY`** via Command Palette → **Chat: Manage Language Models**.
|
|
41
|
-
3. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.
|
|
41
|
+
3. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.6 Flash). [Why?](../../README.md#4-configure-the-utility-small-model)
|
|
42
42
|
4. **Restart VS Code** and pick "MiniMax M3" in the chat picker.
|
|
43
43
|
|
|
44
44
|
## Setup
|
package/docs/models/qwen.md
CHANGED
|
@@ -95,14 +95,14 @@ Set the API key through **Chat: Manage Language Models**, then verify the proxy
|
|
|
95
95
|
1. **Start the proxy:** `npm run proxy:qwen` (or `npx copilot-custom-endpoint qwen`).
|
|
96
96
|
2. **Use the proxy-path JSON snippet** below.
|
|
97
97
|
3. **Set your DashScope API key** via Command Palette → **Chat: Manage Language Models**.
|
|
98
|
-
4. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.
|
|
98
|
+
4. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.6 Flash). [Why?](../../README.md#4-configure-the-utility-small-model)
|
|
99
99
|
5. **Restart VS Code.** Reasoning will be visible in plain chat and suppressed on tool turns.
|
|
100
100
|
|
|
101
101
|
### Direct (no proxy)
|
|
102
102
|
|
|
103
103
|
1. **Use the direct-path JSON snippet** below.
|
|
104
104
|
2. **Set your `DASHSCOPE_API_KEY`** via Command Palette → **Chat: Manage Language Models**.
|
|
105
|
-
3. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.
|
|
105
|
+
3. **Configure the Utility Small Model** — Open Settings → search **"Chat: Utility Small Model"** → pick your fastest model (e.g., DeepSeek V4 Flash or MiMo V2.6 Flash). [Why?](../../README.md#4-configure-the-utility-small-model)
|
|
106
106
|
4. **Restart VS Code** and pick "Qwen 3.8 Max".
|
|
107
107
|
|
|
108
108
|
## Setup
|
package/docs/pricing.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Pricing
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
> **Latest refresh (September 16, 2026):** OpenRouter's live benchmark card puts the unversioned Qwen3.8 Max entry at **#2 with 53.4**. The public model API no longer exposes that unversioned ID and canonicalizes it to 0902; the exact `qwen/qwen3.8-max-0902` metadata row now reports **45.4**. The table preserves both values as separate records rather than silently merging them. Qwen Cloud's current PAYG API rates remain **$2 / $0.25 implicit cache / $6** for Qwen3.8 Max. DeepSeek now serves V4.1 Flash as `deepseek-flash` at peak rates of **$0.30 / $0.006 cache hit / $1.20**; the legacy V4 Flash alias is retired. Anthropic kept Sonnet 5 at **$2 / $0.20 / $10**, and OpenAI's Sol rate is **$4 / $0.40 / $20** through at least November 21. GLM 5.3 Flash's 50% launch promotion ended September 9, so list rates are now the applicable baseline.
|
|
3
|
+
> **Latest refresh (September 23, 2026):** OpenRouter's current metadata uses Artificial Analysis v4.3.2 composites. MiMo V2.6 Pro is **46.3**, Grok 4.7 is **46.4**, and the current values for existing rows are refreshed below. Gemini 3.8 Flash is now available as a GitHub Copilot native model. Xiaomi released the V2.6 Pro, Flash, and Pro UltraSpeed models on September 22; the September 23 roster cleanup removes two retired legacy models. xAI released Grok 4.7 on September 21 at the same short-context rates as Grok 4.6: **$2 / $0.50 cache hit / $6**. The table preserves Qwen's 0803 ranking-card value (**53.4**) and 0902 metadata value (**45.4**) as separate records. The current table is authoritative for present comparisons.
|
|
6
4
|
|
|
7
5
|
> **⏰ June 1, 2026 — GitHub Copilot switched to usage-based billing (AI Credits) today.**
|
|
8
6
|
>
|
|
@@ -24,70 +22,38 @@ All prices below are in **USD per 1M tokens** (non-cached). To convert to AI cre
|
|
|
24
22
|
|
|
25
23
|
All models are listed together below, sorted by Cost per intelligence ascending (lower is better). Models without a Cost per intelligence are ordered by estimated session cost ascending. Session cost assumes ~10K input + ~2K output tokens per turn, 50 turns.
|
|
26
24
|
|
|
27
|
-
| Model
|
|
28
|
-
|
|
|
29
|
-
| **GLM 5.3 Flash**
|
|
30
|
-
| **
|
|
31
|
-
| **
|
|
32
|
-
| **DeepSeek V4.1 Flash**
|
|
33
|
-
| **MiniMax M3**
|
|
34
|
-
| **
|
|
35
|
-
| **
|
|
36
|
-
| **
|
|
37
|
-
| **
|
|
38
|
-
| **
|
|
39
|
-
| **
|
|
40
|
-
| **Qwen 3.8 Max (0902)
|
|
41
|
-
| **Grok 4.6**
|
|
42
|
-
| **GPT-5.6 Terra**
|
|
43
|
-
| **Claude Sonnet 5**
|
|
44
|
-
| **
|
|
45
|
-
| **
|
|
46
|
-
| **
|
|
47
|
-
| **Claude
|
|
48
|
-
| **
|
|
49
|
-
| **
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
⁵ **MiniMax M3 Priority** is not a separate model — it is the same `MiniMax-M3` weights invoked with `"service_tier": "priority"` in the request body. Priority costs **1.5× Standard** across input, output, and cache reads (list prices shown above; effective rates after the standing 50% off are $0.45/$1.80/$0.09 ≤512K and $0.90/$3.60/$0.18 >512K), in exchange for **priority admission** (faster responses, fewer failures during MiniMax peak hours — typically 15:00–17:30 weekdays). Capabilities, context window (1M, guaranteed 512K), vision, tool calling, rate limits (200 RPM / 10M TPM), and thinking modes are identical to Standard. To enable it on the custom-endpoint entry, add `"service_tier": "priority"` to the `requestBody` of the single `MiniMax-M3` block (and remove it to go back to Standard). See [docs/models/minimax.md](models/minimax.md#4-m3-priority-tier-optional) and [docs/research/minimax-m3-priority.md](research/minimax-m3-priority.md) for the full breakdown.
|
|
54
|
-
|
|
55
|
-
⁶ **Claude Sonnet 5** launched at **$2.00 / $0.20 / $10.00** (input / cached / output). Anthropic's current pricing makes those rates standard; the previously announced September 1 increase to $3.00 / $0.30 / $15.00 will not occur. See [Anthropic's pricing page](https://platform.claude.com/docs/en/about-claude/pricing) for the latest.
|
|
56
|
-
|
|
57
|
-
⁷ **Kimi K3** was released on **July 16, 2026**. 2.8T parameters (open-source, weights by July 27, 2026). 1M context window. Always-thinking reasoning model — uses `reasoning_effort` (not the K2.x `thinking` parameter). Fixed sampling: `temperature=1`, `top_p=0.95`. Pricing is flat (no tiering by context length). See [Kimi K3 pricing](https://platform.kimi.ai/docs/pricing/chat-k3) and the [Artificial Analysis model page](https://artificialanalysis.ai/models/kimi-k3).
|
|
58
|
-
|
|
59
|
-
⁸ **GPT-5.6** pricing is **$0.20 / $0.02 / $1.20** for Luna, **$2.00 / $0.20 / $12.00** for Terra, and currently **$4.00 / $0.40 / $20.00** for Sol (input / cached input / output per 1M tokens). The Sol rate is a promotional reduction from $5.00 / $0.50 / $30.00 and is available at least through **November 21, 2026**. OpenAI reduced Luna by 80% and Terra by 20% on July 30, 2026. OpenAI bills cache writes at 1.25x the uncached input rate for GPT-5.6 and later. The Batch API provides an additional 50% discount for asynchronous jobs. All three tiers have a 1M-token context window and support text + image input. See [OpenAI's API pricing](https://developers.openai.com/api/docs/pricing) and [GPT-5.6 announcement](https://openai.com/index/gpt-5-6/).
|
|
60
|
-
|
|
61
|
-
¹⁰ **Claude Opus 5** was released on **July 24, 2026**. AA Intelligence Index score (**63.1**) confirmed by [Artificial Analysis](https://artificialanalysis.ai/models/claude-opus-5). Pricing is $5.00 / $0.50 / $25.00 per MTok input/cached/output. 1M context window, text + image input, adaptive reasoning. Also available in Fast mode ($10/$50 per MTok input/output) and Batch ($2.50/$12.50 per MTok input/output). Uses the newer Claude tokenizer (~30% more tokens than pre-4.7 models). See [Anthropic's Opus 5 announcement](https://www.anthropic.com/news/claude-opus-5).
|
|
62
|
-
|
|
63
|
-
¹¹ **Historical Qwen 3.8 Max launch record:** the August 3, 2026 launch package used the unversioned `qwen3.8-max` name. An earlier Artificial Analysis snapshot reported **58.1**; the current OpenRouter ranking now distinguishes the unversioned **0803** row (**53.4**) from the separate **0902** row (**45.4**). Use the current rows and footnotes ²⁵–²⁶ for comparisons rather than carrying the earlier score forward. See the [Qwen Cloud model page](https://www.qwencloud.com/models/qwen3.8-max), [AA model page](https://artificialanalysis.ai/models/qwen3-8-max), and [OpenRouter model page](https://openrouter.ai/qwen/qwen3.8-max).
|
|
64
|
-
|
|
65
|
-
¹⁴ **Grok 4.6** (xAI/SpaceXAI, released **August 12, 2026**) is now a **GitHub Copilot native** model (GA). AA Intelligence Index **61** (high reasoning preset, #6/188). 500K context window, text + image input, text output. Priced at $2.00 / $0.50 / $6.00 per 1M input/cached/output (75% cache discount). See the [AA model page](https://artificialanalysis.ai/models/grok-4-6), the [xAI announcement](https://x.ai/news/grok-4-6), and the [GitHub Copilot models & pricing page](https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing).
|
|
66
|
-
|
|
67
|
-
¹⁶ **Claude Fable 5** (Anthropic, released **June 9, 2026**) is now a **GitHub Copilot native** model (GA, Powerful; Anthropic's new flagship tier, above Opus). AA Intelligence Index **62.1** (**#3/188**; AA page lists a rounded **62** on its [model page](https://artificialanalysis.ai/models/claude-fable-5)). Currently **#1 in Text, Agent, Code, and Overall Arena**. 1M context window, text + image input, adaptive reasoning. Priced at **$10.00 / $1.00 / $50.00** per 1M input/cached/output (90% cache discount; cache write $12.50). Uses the newer Claude tokenizer (~30% more tokens than pre-4.7 models). **Superseded as Anthropic's flagship by Claude Fable 5.1 (September 1, 2026 — see footnote ²³)**. See the [GitHub Copilot models & pricing page](https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing).
|
|
68
|
-
|
|
69
|
-
¹⁸ **GLM 5.3** is Z.ai's newest flagship (released **August 18, 2026**) with post-training improvements over the previous GLM flagship (~50% coding gain on Z.ai Code Bench). AA Intelligence Index **59.5** (OpenRouter's AA-sourced benchmark; AA's [model page](https://artificialanalysis.ai/models/glm-5-3) lists a rounded **60**, **#8/182**), Coding **74.8**, Agentic **59.1**. Pricing is **$1.40** input, **$0.26** cached, and **$4.40** output per 1M tokens (modeled session cost ~$1.14). 1M context window, 753B params, text-only. Always-thinking: `thinking.type` only supports `enabled` and `reasoning_effort` accepts `low` / `high` / `max` (default `max`). See the [Z.ai model page](https://docs.z.ai/guides/llm/glm-5.3).
|
|
70
|
-
|
|
71
|
-
¹⁹ **DeepSeek V4.1 Flash** and **DeepSeek V4 Pro 0813** are the current API builds. Flash uses canonical model ID `deepseek-flash`, supports text + image input, and has AA Intelligence **39.5** in the current OpenRouter metadata. Pro remains text-only with AA Intelligence **36.3**. DeepSeek's current peak/off-peak pricing is Flash **$0.30 / $0.006 / $1.20** and Pro **$1.32 / $0.044 / $3.96** per 1M input/cache-hit/output at peak, with off-peak rates at half those values. The legacy `deepseek-v4-flash` name remains accepted but is retired. See the [DeepSeek pricing page](https://api-docs.deepseek.com/quick_start/pricing), [update log](https://api-docs.deepseek.com/updates/), and [canonical model record](models/deepseek.md).
|
|
72
|
-
|
|
73
|
-
²⁰ **GLM 5.3 Flash** (`glm-5.3-flash`) is Z.ai's first native multimodal model in the GLM-5 series (released **August 26, 2026**; tested pre-release as "ox-alpha"). Hybrid sparse + linear attention architecture with 320B total / 18B active parameters (open weights, MIT license) and a 1M-token context window; text + image input, text output. AA Intelligence Index **57.5** (OpenRouter's AA-sourced benchmark; AA's [model page](https://artificialanalysis.ai/models/glm-5-3-flash) lists a rounded **57** and ranks it **#3/110** within its open-weights size class), Coding **71.5**, Agentic **58.2**. Launch pricing is **$0.15** input / **$0.03** cached / **$0.50** output per 1M (list), with a **50% off** launch promo (effective **$0.075 / $0.015 / $0.25**) through **September 9, 2026** (24:00 UTC+8). At list price the modeled session cost is ~$0.13 and the cost per intelligence is ~$0.0022 — the cheapest row in this table. Always-thinking: `thinking.type` only supports `enabled`, `reasoning_effort` accepts `low` / `high` / `max` (default `max`). See the [Z.ai model page](https://docs.z.ai/guides/llm/glm-5.3-flash) and [AA model page](https://artificialanalysis.ai/models/glm-5-3-flash).
|
|
74
|
-
|
|
75
|
-
²¹ **Gemini 3.8 Flash** (`gemini-3.8-flash`) was released on **September 2, 2026** — Google's most intelligent Flash model, engineered for long-horizon software engineering, autonomous agents, and enterprise workflows. AA Intelligence Index **58.7** (OpenRouter's AA-sourced benchmark; AA's [model page](https://artificialanalysis.ai/models/gemini-3-8-flash) rounds to **59**, **#17/196**), Coding **76.3**, Agentic **50.0**. 1M context window (1,048,576 input / 65,536 output), text + image + speech + video + PDF input, text output; configurable thinking (`low`/`medium`/`high` — `minimal` is not supported). Fast at **305.5 t/s** per AA but **very verbose** (120M output tokens on the Intelligence Index vs a 71M median) with a high TTFT (13.39 s), so expect output-token costs above what the score alone suggests. **Not yet GitHub Copilot native** (GitHub's Google lineup still ends at 3.7 Flash) — priced from the Gemini API at the **same promotional rates as 3.7 Flash**: $0.75 / $0.075 / $3.75 per 1M input/cached/output through **December 31, 2026**, then $1.50 / $0.15 / $7.50 from January 1, 2027 (90% cache discount; Batch API 50% off; cache storage $0.50/1M per hour during the promo). Vendor-reported: HLE-Verified **54.9**. See the [Google announcement](https://blog.google/innovation-and-ai/models-and-research/gemini-models/3-8-flash-and-3-8-flash-cyber/), the [Gemini API model page](https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash), and the [AA model page](https://artificialanalysis.ai/models/gemini-3-8-flash).
|
|
76
|
-
|
|
77
|
-
²³ **Claude Fable 5.1** was released on **September 1, 2026** — Anthropic's new flagship, improving on Fable 5 across the board with the biggest gains in agentic coding, long-running agentic workflows, and knowledge work (long code refactors, front-end/visual code generation, finance and analysis), and tending to be more concise in plans and summaries. AA Intelligence Index **65.7** (OpenRouter's AA-sourced benchmark; AA's [model page](https://artificialanalysis.ai/models/claude-fable-5-1) rounds to **66** and ranks it **#1/196**) — the **highest score in this table** — with Coding **81.6** and Agentic **61.3**. GitHub Copilot native (GA, Powerful). 1M context window, text + image input, text output, adaptive reasoning; uses the newer Claude tokenizer (~30% more tokens than pre-4.7 models). Priced at **$10.00 / $0.25 / $50.00** per 1M input/cached/output — the same rates as Fable 5 except **cached input drops from $1.00 to $0.25** (97.5% cache discount); cache write $12.50. Modeled session cost stays ~$10.00, and CPI improves only to ~$0.15 (vs Fable 5's ~$0.161) — still the second-most expensive scored row. At max effort it is slow (66.2 t/s per AA) and very verbose (140M output tokens on the Intelligence Index vs a 71M median; TTFT 283.83 s). Like Fable 5, Anthropic retains request data by default, with zero-data-retention available through the end of 2026 under a time-bound exemption. See the [GitHub Copilot models & pricing page](https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing) and the [AA model page](https://artificialanalysis.ai/models/claude-fable-5-1).
|
|
78
|
-
|
|
79
|
-
²⁴ **GPT-6 Astra** was released on **September 3, 2026** as `gpt-6-astra`, an OpenAI API model and **GitHub Copilot native** model (GA, Powerful). It supports reasoning, text + image input, text output, and a 1M-token context window. Standard pricing is **$10.00 / $1.00 / $50.00** per 1M input/cached/output tokens; cache writes are $12.50/M, and prompts above 272K input tokens use long-context rates. The modeled session cost is ~$10.00 and CPI is ~$0.163. See the [GPT-6 Astra announcement](https://openai.com/index/gpt-6-astra/), [OpenAI API pricing](https://developers.openai.com/api/docs/pricing), and [GitHub Copilot models & pricing](https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing).
|
|
80
|
-
|
|
81
|
-
²⁵ **Qwen 3.8 Max (0803)** is the August 3, 2026 launch checkpoint represented by OpenRouter's unversioned ranking card [`qwen/qwen3.8-max`](https://openrouter.ai/qwen/qwen3.8-max). The September 10 ranking card places it at **#2 with 53.4**. It shares Qwen Cloud's **$2.00 / $0.25 implicit cache / $6.00** PAYG rates, 1M context, 131K maximum output, and text/image/video input with the 0902 snapshot. The validated DashScope setup continues to use provider ID `qwen3.8-max` and the proxy forwards that ID unchanged.
|
|
82
|
-
|
|
83
|
-
²⁶ **Qwen 3.8 Max (0902)** is a separate OpenRouter snapshot, [`qwen/qwen3.8-max-0902`](https://openrouter.ai/qwen/qwen3.8-max-0902), released September 4, 2026. The current public model API reports an AA Intelligence Index of **45.4** for this exact ID. It has the same published **$2.00 / $0.25 implicit cache / $6.00** rates, 1M context, 131K maximum output, and text/image/video input. The OpenRouter slug is not automatically a valid DashScope model ID; see [the Qwen setup guide](models/qwen.md) before changing the upstream URL.
|
|
25
|
+
| Model | Provider | Cost per intelligence | Intelligence Score | Input (per 1M) | Cached input | Output (per 1M) | Est. session | Context window |
|
|
26
|
+
| ---------------------------- | --------- | --------------------- | ------------------ | ----------------------------- | ----------------------------- | ----------------------------- | ------------ | -------------- |
|
|
27
|
+
| **GLM 5.3 Flash** | Z.ai | **~$0.0030** | **41.8** | $0.15 | $0.03 | $0.50 | ~$0.13 | 1M |
|
|
28
|
+
| **GPT-5.6 Luna** | OpenAI | **~$0.0059** | **37.3** | $0.20 | $0.02 | $1.20 | ~$0.22 | 1M |
|
|
29
|
+
| **MiMo V2.6 Pro** | Xiaomi | **~$0.0066** | **46.3** | $0.435 | $0.0036 | $0.87 | ~$0.30 | 1M |
|
|
30
|
+
| **DeepSeek V4.1 Flash** | DeepSeek | **~$0.0068** | **39.5** | $0.30 | $0.006 | $1.20 | ~$0.27 | 1M |
|
|
31
|
+
| **MiniMax M3** | MiniMax | **~$0.0093** | **29.2** | $0.60 (≤512K) / $1.20 (>512K) | $0.12 (≤512K) / $0.24 (>512K) | $2.40 (≤512K) / $4.80 (>512K) | ~$0.27 | 1M |
|
|
32
|
+
| **MiniMax M3 Priority** | MiniMax | **~$0.0139** | **29.2** | $0.90 (≤512K) / $1.80 (>512K) | $0.18 (≤512K) / $0.36 (>512K) | $3.60 (≤512K) / $7.20 (>512K) | ~$0.41 | 1M |
|
|
33
|
+
| **Gemini 3.8 Flash** | Google | **~$0.0183** | **40.9** | $0.75 | $0.075 | $3.75 | ~$0.75 | 1M |
|
|
34
|
+
| **GLM 5.3** | Z.ai | **~$0.0254** | **44.8** | $1.40 | $0.26 | $4.40 | ~$1.14 | 1M |
|
|
35
|
+
| **DeepSeek V4 Pro 0813** | DeepSeek | **~$0.0294** | **36.0** | $1.32 | $0.044 | $3.96 | ~$1.06 | 1M |
|
|
36
|
+
| **Qwen 3.8 Max (0803)** | DashScope | **~$0.0300** | **53.4** | $2.00 | $0.25 | $6.00 | ~$1.60 | 1M |
|
|
37
|
+
| **Grok 4.7** | xAI | **~$0.0345** | **46.4** | $2.00 | $0.50 | $6.00 | ~$1.60 | 500K |
|
|
38
|
+
| **Qwen 3.8 Max (0902)** | DashScope | **~$0.0352** | **45.4** | $2.00 | $0.25 | $6.00 | ~$1.60 | 1M |
|
|
39
|
+
| **Grok 4.6** | xAI | **~$0.0361** | **44.3** | $2.00 | $0.50 | $6.00 | ~$1.60 | 500K |
|
|
40
|
+
| **GPT-5.6 Terra** | OpenAI | **~$0.0523** | **42.1** | $2.00 | $0.20 | $12.00 | ~$2.20 | 1M |
|
|
41
|
+
| **Claude Sonnet 5** | Anthropic | **~$0.0524** | **38.2** | $2.00 | $0.20 | $10.00 | ~$2.00 | 1M |
|
|
42
|
+
| **MiMo V2.6 Pro UltraSpeed** | Xiaomi | **~$0.0658** | **46.3** | $4.35 | $0.036 | $8.70 | ~$3.05 | 1M |
|
|
43
|
+
| **Kimi K3** | Moonshot | **~$0.0688** | **43.6** | $3.00 | $0.30 | $15.00 | ~$3.00 | 1M |
|
|
44
|
+
| **GPT-5.6 Sol** | OpenAI | **~$0.0851** | **47.0** | $4.00 | $0.40 | $20.00 | ~$4.00 | 1M |
|
|
45
|
+
| **Claude Opus 5** | Anthropic | **~$0.0984** | **50.8** | $5.00 | $0.50 | $25.00 | ~$5.00 | 1M |
|
|
46
|
+
| **Claude Fable 5.1** | Anthropic | **~$0.1873** | **53.4** | $10.00 | $0.25 | $50.00 | ~$10.00 | 1M |
|
|
47
|
+
| **GPT-6 Astra** | OpenAI | **~$0.1898** | **52.7** | $10.00 | $1.00 | $50.00 | ~$10.00 | 1M |
|
|
48
|
+
| **Claude Fable 5** | Anthropic | **~$0.2016** | **49.6** | $10.00 | $1.00 | $50.00 | ~$10.00 | 1M |
|
|
49
|
+
| **MiMo V2.6 Flash** | Xiaomi | — | — | $0.14 | $0.0028 | $0.28 | ~$0.10 | 1M |
|
|
84
50
|
|
|
85
51
|
Cost per intelligence = estimated session cost ÷ Intelligence Index score. Session cost assumes ~10K input + ~2K output tokens per turn, 50 turns.
|
|
86
52
|
|
|
87
53
|
> **Notes:**
|
|
88
54
|
>
|
|
89
|
-
> - **DeepSeek** input pricing shown is the **peak cache miss** price. Peak cache hits are $0.006/M for V4.1 Flash and $0.044/M for Pro; off-peak rates are half. See
|
|
90
|
-
> - **MiMo** input pricing shown is the **cache miss** price. Cache hits are essentially free for V2.
|
|
55
|
+
> - **DeepSeek** input pricing shown is the **peak cache miss** price. Peak cache hits are $0.006/M for V4.1 Flash and $0.044/M for Pro; off-peak rates are half. See the [DeepSeek pricing page](https://api-docs.deepseek.com/quick_start/pricing) for the full schedule.
|
|
56
|
+
> - **MiMo** input pricing shown is the **cache miss** price. Cache hits are essentially free for V2.6 Pro ($0.0036/M, ~120× cheaper), V2.6 Flash ($0.0028/M, ~50× cheaper), and V2.6 Pro UltraSpeed ($0.036/M, ~120× cheaper). A Xiaomi price cut took effect on 2026-05-27.
|
|
91
57
|
> - **Anthropic (Claude)** models also have a cache write cost ($6.25/MTok for Opus, $3.75/MTok for Sonnet, $1.25/MTok for Haiku). Opus 5, Sonnet 5, and Fable 5 / 5.1 use a new tokenizer that produces approximately 30% more tokens for the same text.
|
|
92
58
|
> - **OpenAI** models support cached input at 0.1× base input rate.
|
|
93
59
|
> - **Qwen** models use **tiered pricing** — determined by total input tokens per request. Prices above are for non-thinking mode.
|
|
@@ -101,7 +67,7 @@ Cost per intelligence = estimated session cost ÷ Intelligence Index score. Sess
|
|
|
101
67
|
|
|
102
68
|
> **How long does 7,000 credits last?** A Pro+ subscriber running 50-turn sessions can estimate monthly capacity by multiplying each modeled session cost by 100 to convert it to AI credits, then mixing models as needed.
|
|
103
69
|
|
|
104
|
-
> Prices last verified: September
|
|
70
|
+
> Prices last verified: September 22, 2026. Always check the official pages for the latest rates:
|
|
105
71
|
>
|
|
106
72
|
> - [GitHub Copilot models & pricing](https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing)
|
|
107
73
|
> - [OpenAI pricing](https://openai.com/api/pricing/)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
function summarizePayload(payload, hasTools, rewriteInfo) {
|
|
2
|
+
const messages = Array.isArray(payload.messages) ? payload.messages : []
|
|
3
|
+
const tools = Array.isArray(payload.tools) ? payload.tools : []
|
|
4
|
+
|
|
5
|
+
return {
|
|
6
|
+
model: payload.model,
|
|
7
|
+
stream: payload.stream,
|
|
8
|
+
hasTools,
|
|
9
|
+
toolCount: tools.length,
|
|
10
|
+
toolChoice: payload.tool_choice,
|
|
11
|
+
...rewriteInfo,
|
|
12
|
+
maxTokens:
|
|
13
|
+
payload.max_tokens ??
|
|
14
|
+
payload.max_completion_tokens ??
|
|
15
|
+
payload.max_output_tokens,
|
|
16
|
+
messageCount: messages.length,
|
|
17
|
+
messageRoles: messages.map((message) => message?.role).slice(0, 16),
|
|
18
|
+
topLevelKeys: Object.keys(payload).sort()
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function hasMissingReasoningContent(messages) {
|
|
23
|
+
return messages.some((message) => {
|
|
24
|
+
if (
|
|
25
|
+
message?.role !== 'assistant' ||
|
|
26
|
+
!Array.isArray(message.tool_calls) ||
|
|
27
|
+
message.tool_calls.length === 0
|
|
28
|
+
) {
|
|
29
|
+
return false
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
typeof message.reasoning_content !== 'string' ||
|
|
34
|
+
message.reasoning_content.trim().length === 0
|
|
35
|
+
)
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function rewriteMiMo(payload, { disableThinkingWithTools = true } = {}) {
|
|
40
|
+
const messages = Array.isArray(payload.messages) ? payload.messages : []
|
|
41
|
+
const hasToolRole = messages.some((message) => message?.role === 'tool')
|
|
42
|
+
const hasToolsArray = Array.isArray(payload.tools) && payload.tools.length > 0
|
|
43
|
+
const toolChoice = payload.tool_choice
|
|
44
|
+
const hasActiveToolCall =
|
|
45
|
+
hasToolRole ||
|
|
46
|
+
hasToolsArray ||
|
|
47
|
+
(toolChoice !== undefined && toolChoice !== 'none' && toolChoice !== null)
|
|
48
|
+
const hasTools = hasActiveToolCall
|
|
49
|
+
const incomingThinkingType = payload?.thinking?.type
|
|
50
|
+
const missingReasoningContent = hasMissingReasoningContent(messages)
|
|
51
|
+
const shouldDisableThinking =
|
|
52
|
+
disableThinkingWithTools && hasTools && missingReasoningContent
|
|
53
|
+
|
|
54
|
+
if (shouldDisableThinking) {
|
|
55
|
+
payload.thinking = { type: 'disabled' }
|
|
56
|
+
} else if (!hasTools) {
|
|
57
|
+
delete payload.thinking
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const rewrittenThinkingType = payload?.thinking?.type
|
|
61
|
+
const thinkingAction = shouldDisableThinking
|
|
62
|
+
? '"disabled"'
|
|
63
|
+
: hasTools
|
|
64
|
+
? '<preserved>'
|
|
65
|
+
: '<deleted>'
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
summary: summarizePayload(payload, hasTools, {
|
|
69
|
+
missingReasoningContent,
|
|
70
|
+
incomingThinkingType,
|
|
71
|
+
rewrittenThinkingType
|
|
72
|
+
}),
|
|
73
|
+
consoleMsg: `[${hasTools ? 'tools' : 'chat'}] thinking.type=${String(
|
|
74
|
+
incomingThinkingType
|
|
75
|
+
)} -> ${thinkingAction}, model=${payload.model ?? '?'}`
|
|
76
|
+
}
|
|
77
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copilot-custom-endpoint",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Local proxies for VS Code Copilot custom endpoints — Kimi K2, Qwen 3.x & MiMo V2.
|
|
3
|
+
"version": "3.3.0",
|
|
4
|
+
"description": "Local proxies for VS Code Copilot custom endpoints — Kimi K2, Qwen 3.x & MiMo V2.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
package/proxy/mimo-proxy.mjs
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import 'dotenv/config'
|
|
3
3
|
import { fileURLToPath } from 'node:url'
|
|
4
4
|
import { createProxy } from '../lib/create-proxy.mjs'
|
|
5
|
+
import { rewriteMiMo } from '../lib/mimo-rewrite.mjs'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Supported model scope for this proxy:
|
|
8
|
-
* - Validated with
|
|
9
|
+
* - Validated with the MiMo V2.6 chat model IDs.
|
|
9
10
|
* - Expected to work for any MiMo model that supports the `thinking` object
|
|
10
11
|
* with a `type` field on the OpenAI-compatible surface.
|
|
11
12
|
* - Not intended for non-MiMo providers, because the rewrite assumes
|
|
@@ -28,16 +29,17 @@ const logPath = process.env.MIMO_PROXY_LOG ?? defaultLogPath
|
|
|
28
29
|
if (process.argv.includes('--help')) {
|
|
29
30
|
console.log(`MiMo proxy
|
|
30
31
|
|
|
31
|
-
Starts a local HTTP proxy that
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
Starts a local HTTP proxy that preserves MiMo V2.6 thinking when the request
|
|
33
|
+
history includes reasoning_content, and falls back to thinking: { type: "disabled" }
|
|
34
|
+
when a tool loop has missing reasoning history.
|
|
34
35
|
|
|
35
36
|
Environment variables:
|
|
36
37
|
MIMO_PROXY_PORT Local listen port. Default: 3459 (falls back to PORT)
|
|
37
38
|
MIMO_UPSTREAM_URL Upstream MiMo chat-completions URL.
|
|
38
39
|
Default: https://api.xiaomimimo.com/v1/chat/completions
|
|
39
40
|
MIMO_PROXY_DISABLE_THINKING_WITH_TOOLS
|
|
40
|
-
|
|
41
|
+
Enable the tool-loop fallback that injects thinking:
|
|
42
|
+
{ type: "disabled" } for incomplete reasoning history.
|
|
41
43
|
Default: 1
|
|
42
44
|
MIMO_PROXY_LOG Path to the redacted NDJSON log file.
|
|
43
45
|
|
|
@@ -47,66 +49,6 @@ Suggested VS Code model URL:
|
|
|
47
49
|
process.exit(0)
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
// ---- Provider-specific rewrite logic ----
|
|
51
|
-
|
|
52
|
-
function summarizePayload(payload, hasTools, rewriteInfo) {
|
|
53
|
-
const messages = Array.isArray(payload.messages) ? payload.messages : []
|
|
54
|
-
const tools = Array.isArray(payload.tools) ? payload.tools : []
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
model: payload.model,
|
|
58
|
-
stream: payload.stream,
|
|
59
|
-
hasTools,
|
|
60
|
-
toolCount: tools.length,
|
|
61
|
-
toolChoice: payload.tool_choice,
|
|
62
|
-
...rewriteInfo,
|
|
63
|
-
maxTokens:
|
|
64
|
-
payload.max_tokens ??
|
|
65
|
-
payload.max_completion_tokens ??
|
|
66
|
-
payload.max_output_tokens,
|
|
67
|
-
messageCount: messages.length,
|
|
68
|
-
messageRoles: messages.map((message) => message?.role).slice(0, 16),
|
|
69
|
-
topLevelKeys: Object.keys(payload).sort()
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function rewriteMiMo(payload) {
|
|
74
|
-
// Determine if a tool is actually being invoked:
|
|
75
|
-
// - tool_choice is set and not "none"
|
|
76
|
-
// - OR there is a "tool" role message in the conversation
|
|
77
|
-
const messages = Array.isArray(payload.messages) ? payload.messages : []
|
|
78
|
-
const hasToolRole = messages.some((message) => message?.role === 'tool')
|
|
79
|
-
const toolChoice = payload.tool_choice
|
|
80
|
-
const hasActiveToolCall =
|
|
81
|
-
hasToolRole ||
|
|
82
|
-
(toolChoice !== undefined && toolChoice !== 'none' && toolChoice !== null)
|
|
83
|
-
const hasTools = hasActiveToolCall
|
|
84
|
-
const incomingThinkingType = payload?.thinking?.type
|
|
85
|
-
|
|
86
|
-
if (disableThinkingWithTools && hasTools) {
|
|
87
|
-
// Tool-enabled request: suppress thinking to avoid reasoning_content issues
|
|
88
|
-
payload.thinking = { type: 'disabled' }
|
|
89
|
-
} else {
|
|
90
|
-
// Plain chat: remove thinking so the model uses its default (enabled for V2.5 models)
|
|
91
|
-
delete payload.thinking
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const rewrittenThinkingType =
|
|
95
|
-
disableThinkingWithTools && hasTools ? 'disabled' : undefined
|
|
96
|
-
|
|
97
|
-
const summary = summarizePayload(payload, hasTools, {
|
|
98
|
-
incomingThinkingType,
|
|
99
|
-
rewrittenThinkingType
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
const modeTag = hasTools ? '[tools]' : '[chat]'
|
|
103
|
-
const consoleMsg = `${modeTag} thinking.type=${String(incomingThinkingType)} -> ${
|
|
104
|
-
hasTools && disableThinkingWithTools ? '"disabled"' : '<deleted>'
|
|
105
|
-
}, model=${payload.model ?? '?'}`
|
|
106
|
-
|
|
107
|
-
return { summary, consoleMsg }
|
|
108
|
-
}
|
|
109
|
-
|
|
110
52
|
// ---- Create and start ----
|
|
111
53
|
|
|
112
54
|
const { start } = createProxy({
|
|
@@ -114,8 +56,12 @@ const { start } = createProxy({
|
|
|
114
56
|
port,
|
|
115
57
|
logPath,
|
|
116
58
|
label: 'mimo-proxy',
|
|
117
|
-
healthCheckExtras: {
|
|
118
|
-
|
|
59
|
+
healthCheckExtras: {
|
|
60
|
+
disableThinkingWithTools,
|
|
61
|
+
preserveV26ThinkingWithReasoningContent: true
|
|
62
|
+
},
|
|
63
|
+
rewriteRequest: (payload) =>
|
|
64
|
+
rewriteMiMo(payload, { disableThinkingWithTools }),
|
|
119
65
|
startupMessages: (_port, _upstreamUrl) => [
|
|
120
66
|
`[mimo-proxy] listening on http://127.0.0.1:${_port}/v1/chat/completions`,
|
|
121
67
|
`[mimo-proxy] forwarding to ${_upstreamUrl}`,
|