copilot-custom-endpoint 1.2.0 → 1.2.2

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.
Files changed (2) hide show
  1. package/README.md +65 -24
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -38,26 +38,37 @@ This repo is for those situations: validated, copy-paste-ready configs when Open
38
38
 
39
39
  Pick the model you want and follow the corresponding section below.
40
40
 
41
- ### Config file location
41
+ ### Config setup: two-step workflow
42
42
 
43
- The Kimi and Qwen setups require editing the same VS Code config file:
43
+ VS Code separates **model configuration** from **API key storage** for security. You set up each provider in two steps:
44
44
 
45
- | OS | Path |
46
- | ------- | ----------------------------------------------------------------- |
47
- | Windows | `%APPDATA%\Code\User\chatLanguageModels.json` |
48
- | macOS | `~/Library/Application Support/Code/User/chatLanguageModels.json` |
49
- | Linux | `~/.config/Code/User/chatLanguageModels.json` |
45
+ 1. **Create/update `chatLanguageModels.json`** — this file defines the models, URLs, and settings. API keys are **not** stored here (leave `apiKey` out entirely, or use an empty string).
46
+
47
+ | OS | Path |
48
+ | ------- | ----------------------------------------------------------------- |
49
+ | Windows | `%APPDATA%\Code\User\chatLanguageModels.json` |
50
+ | macOS | `~/Library/Application Support/Code/User/chatLanguageModels.json` |
51
+ | Linux | `~/.config/Code/User/chatLanguageModels.json` |
52
+
53
+ 2. **Set each API key through the Language Models UI:**
54
+ - Open the Command Palette (`Ctrl+Shift+P`).
55
+ - Run **Chat: Manage Language Models**.
56
+ - Find your provider group in the list.
57
+ - Right-click the group name → **Update API Key**.
58
+ - Paste your key. It is stored securely (not in the JSON file).
59
+
60
+ > **Why this way?** The JSON config file is often tracked in dotfile repos or shared across machines. API keys don't belong there. The VS Code UI stores them in your OS keychain instead.
50
61
 
51
62
  ### Full example config
52
63
 
53
- Here's a complete, real-world example of `chatLanguageModels.json` combining all the providers documented in this repo.
64
+ Here's a complete, real-world example of `chatLanguageModels.json` combining all the providers documented in this repo. Note the `apiKey` fields are left as empty strings — you'll set them via the Language Models UI instead. After you set a key via the UI, VS Code replaces the empty string with a `${input:chat.lm.secret.<id>}` secret reference.
54
65
 
55
66
  ```json
56
67
  [
57
68
  {
58
69
  "name": "Qwen",
59
70
  "vendor": "customendpoint",
60
- "apiKey": "<your-dashscope-key>",
71
+ "apiKey": "",
61
72
  "apiType": "chat-completions",
62
73
  "models": [
63
74
  {
@@ -87,7 +98,7 @@ Here's a complete, real-world example of `chatLanguageModels.json` combining all
87
98
  {
88
99
  "name": "Kimi",
89
100
  "vendor": "customendpoint",
90
- "apiKey": "<your-moonshot-key>",
101
+ "apiKey": "",
91
102
  "apiType": "chat-completions",
92
103
  "models": [
93
104
  {
@@ -108,7 +119,7 @@ Here's a complete, real-world example of `chatLanguageModels.json` combining all
108
119
  {
109
120
  "name": "MiMo",
110
121
  "vendor": "customendpoint",
111
- "apiKey": "<your-mimo-api-key>",
122
+ "apiKey": "",
112
123
  "apiType": "chat-completions",
113
124
  "models": [
114
125
  {
@@ -161,7 +172,7 @@ Here's a complete, real-world example of `chatLanguageModels.json` combining all
161
172
  {
162
173
  "name": "MiniMax",
163
174
  "vendor": "customendpoint",
164
- "apiKey": "<your-minimax-api-key>",
175
+ "apiKey": "",
165
176
  "apiType": "chat-completions",
166
177
  "models": [
167
178
  {
@@ -198,8 +209,6 @@ Sign up at [platform.moonshot.ai](https://platform.moonshot.ai) and create an AP
198
209
 
199
210
  The proxy rewrites VS Code's requests into shapes Kimi actually accepts (fixed `temperature`, `top_p`, and disabling "thinking" during tool calls).
200
211
 
201
- > **Local config:** Create a `.env` file in this repo root to set environment variables like `KIMI_PROXY_PORT`, `KIMI_UPSTREAM_URL`, etc. It's loaded automatically via `dotenv` — no need to prefix commands.
202
-
203
212
  Run Kimi proxy
204
213
 
205
214
  ```bash
@@ -233,6 +242,10 @@ You should see:
233
242
 
234
243
  ```
235
244
  [kimi-proxy] listening on http://127.0.0.1:3457/v1/chat/completions
245
+ [kimi-proxy] forwarding to https://api.moonshot.ai/v1/chat/completions
246
+ [kimi-proxy] forcing temperature=1, non-thinking temperature=0.6, and top_p=0.95
247
+ [kimi-proxy] disable thinking with tools=true
248
+ [kimi-proxy] writing redacted request summaries to debug_log/kimi-proxy.ndjson
236
249
  ```
237
250
 
238
251
  Check it's alive:
@@ -257,13 +270,13 @@ Expected response:
257
270
 
258
271
  #### 3. Register the model in VS Code
259
272
 
260
- Open (or create) your user config file (see [Config file location](#config-file-location) above) and paste this entry (replace `<your-moonshot-key>`):
273
+ First, open (or create) your user config file (see [Config file location](#config-file-location) above) and paste this entry (leave `apiKey` as empty string — you'll set it via the UI):
261
274
 
262
275
  ```json
263
276
  {
264
277
  "name": "Kimi",
265
278
  "vendor": "customendpoint",
266
- "apiKey": "<your-moonshot-key>",
279
+ "apiKey": "",
267
280
  "apiType": "chat-completions",
268
281
  "models": [
269
282
  {
@@ -285,6 +298,13 @@ Open (or create) your user config file (see [Config file location](#config-file-
285
298
 
286
299
  > **Note:** The `requestBody.temperature` here is a hint to VS Code, but the proxy will enforce the exact values Kimi requires regardless.
287
300
 
301
+ Then set your Moonshot API key via the Language Models UI:
302
+
303
+ - Open the Command Palette (`Ctrl+Shift+P`).
304
+ - Run **Chat: Manage Language Models**.
305
+ - Find the **Kimi** group, right-click it → **Update API Key**.
306
+ - Paste your Moonshot API key.
307
+
288
308
  #### 4. Chat!
289
309
 
290
310
  - Open the Copilot chat panel (`Ctrl+Alt+I` / `Cmd+Ctrl+I`).
@@ -323,13 +343,13 @@ Create an API key [here](https://modelstudio.console.alibabacloud.com/ap-southea
323
343
 
324
344
  #### 2. Register the models in VS Code
325
345
 
326
- Open (or create) your user config file (see [Config file location](#config-file-location) above) and paste this entry (replace `<your-dashscope-key>`):
346
+ First, open (or create) your user config file (see [Config file location](#config-file-location) above) and paste this entry (leave `apiKey` as empty string — you'll set it via the UI):
327
347
 
328
348
  ```json
329
349
  {
330
350
  "name": "Qwen",
331
351
  "vendor": "customendpoint",
332
- "apiKey": "<your-dashscope-key>",
352
+ "apiKey": "",
333
353
  "apiType": "chat-completions",
334
354
  "models": [
335
355
  {
@@ -358,6 +378,13 @@ Open (or create) your user config file (see [Config file location](#config-file-
358
378
  }
359
379
  ```
360
380
 
381
+ Then set your DashScope API key via the Language Models UI:
382
+
383
+ - Open the Command Palette (`Ctrl+Shift+P`).
384
+ - Run **Chat: Manage Language Models**.
385
+ - Find the **Qwen** group, right-click it → **Update API Key**.
386
+ - Paste your DashScope API key.
387
+
361
388
  > **Trade-off:** `enable_thinking: false` suppresses reasoning in all requests (both plain chat and tool loops). Tool loops stay stable, but you never see the model's thought process. The [optional proxy](#optional-local-proxy-for-dynamic-thinking) below avoids this trade-off.
362
389
 
363
390
  #### 3. Chat!
@@ -417,13 +444,13 @@ Expected response:
417
444
  }
418
445
  ```
419
446
 
420
- Then update your VS Code config to point URLs at the proxy and remove `requestBody` — the proxy handles thinking dynamically:
447
+ Then update your VS Code config to point URLs at the proxy and remove `requestBody` — the proxy handles thinking dynamically (remember, `apiKey` stays empty — set it via the UI):
421
448
 
422
449
  ```json
423
450
  {
424
451
  "name": "Qwen",
425
452
  "vendor": "customendpoint",
426
- "apiKey": "<your-dashscope-key>",
453
+ "apiKey": "",
427
454
  "apiType": "chat-completions",
428
455
  "models": [
429
456
  {
@@ -524,13 +551,13 @@ Sign up at [platform.xiaomimimo.com](https://platform.xiaomimimo.com) and create
524
551
 
525
552
  #### 2. Register the models in VS Code
526
553
 
527
- Open your user config file (see [Config file location](#config-file-location) above) and paste this entry (replace `<your-mimo-api-key>`):
554
+ First, open your user config file (see [Config file location](#config-file-location) above) and paste this entry (leave `apiKey` as empty string — you'll set it via the UI):
528
555
 
529
556
  ```json
530
557
  {
531
558
  "name": "MiMo",
532
559
  "vendor": "customendpoint",
533
- "apiKey": "<your-mimo-api-key>",
560
+ "apiKey": "",
534
561
  "apiType": "chat-completions",
535
562
  "models": [
536
563
  {
@@ -582,6 +609,13 @@ Open your user config file (see [Config file location](#config-file-location) ab
582
609
  }
583
610
  ```
584
611
 
612
+ Then set your MiMo API key via the Language Models UI:
613
+
614
+ - Open the Command Palette (`Ctrl+Shift+P`).
615
+ - Run **Chat: Manage Language Models**.
616
+ - Find the **MiMo** group, right-click it → **Update API Key**.
617
+ - Paste your MiMo API key.
618
+
585
619
  > **Note:** `thinking: { "type": "disabled" }` is required for tool-calling stability. Without it, MiMo returns a 400 error when conversation history contains tool calls with missing `reasoning_content`.
586
620
 
587
621
  #### 3. Chat!
@@ -620,13 +654,13 @@ Create an API key at the [MiniMax Developer Platform](https://platform.minimax.i
620
654
 
621
655
  #### 2. Register the model in VS Code
622
656
 
623
- Open (or create) your user config file (see [Config file location](#config-file-location) above) and paste this entry (replace `<your-minimax-api-key>`):
657
+ First, open (or create) your user config file (see [Config file location](#config-file-location) above) and paste this entry (leave `apiKey` as empty string — you'll set it via the UI):
624
658
 
625
659
  ```json
626
660
  {
627
661
  "name": "MiniMax",
628
662
  "vendor": "customendpoint",
629
- "apiKey": "<your-minimax-api-key>",
663
+ "apiKey": "",
630
664
  "apiType": "chat-completions",
631
665
  "models": [
632
666
  {
@@ -649,6 +683,13 @@ Open (or create) your user config file (see [Config file location](#config-file-
649
683
  }
650
684
  ```
651
685
 
686
+ Then set your MiniMax API key via the Language Models UI:
687
+
688
+ - Open the Command Palette (`Ctrl+Shift+P`).
689
+ - Run **Chat: Manage Language Models**.
690
+ - Find the **MiniMax** group, right-click it → **Update API Key**.
691
+ - Paste your MiniMax API key.
692
+
652
693
  **Why this config?**
653
694
 
654
695
  - `thinking: { "type": "adaptive" }` — MiniMax's documented default. The model decides when to reason.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilot-custom-endpoint",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Local proxies for VS Code Copilot custom endpoints — Kimi K2 & Qwen 3.x",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,4 +51,4 @@
51
51
  "dependencies": {
52
52
  "dotenv": "^17.4.2"
53
53
  }
54
- }
54
+ }