@serviceme/devtools-shared 0.4.5 → 0.4.7
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/dist/index.d.mts +91 -1
- package/dist/index.d.ts +91 -1
- package/dist/index.js +472 -73
- package/dist/index.mjs +470 -73
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
// src/ai/protocol.ts
|
|
2
|
+
function protocolForBaseUrl(baseUrl) {
|
|
3
|
+
try {
|
|
4
|
+
const url = new URL(baseUrl);
|
|
5
|
+
return /(^|\/)anthropic(\/|$)/i.test(url.pathname) ? "anthropic" : "openai";
|
|
6
|
+
} catch {
|
|
7
|
+
return "openai";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function effectiveAdapterType(configuredType, baseUrl) {
|
|
11
|
+
if (configuredType === "zhipu" && protocolForBaseUrl(baseUrl) === "anthropic") {
|
|
12
|
+
return "anthropic-compatible";
|
|
13
|
+
}
|
|
14
|
+
return configuredType;
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
// src/ai/providers.base-url.ts
|
|
2
18
|
var PROVIDER_BASE_URL_PRESETS = {
|
|
3
19
|
"openai-compatible": [],
|
|
@@ -12,8 +28,48 @@ var PROVIDER_BASE_URL_PRESETS = {
|
|
|
12
28
|
{ label: "\u5168\u7403", baseUrl: "https://api.moonshot.ai/v1" }
|
|
13
29
|
],
|
|
14
30
|
zhipu: [
|
|
15
|
-
|
|
16
|
-
|
|
31
|
+
// Zhipu / 智谱 GLM 6 endpoint paths × 2 hosts. The 4
|
|
32
|
+
// "credential channels" the GLM-for-copilot reference
|
|
33
|
+
// distinguishes (region × apiMode — each with its own API
|
|
34
|
+
// key) collapse to a 6-row baseUrl dropdown here because we
|
|
35
|
+
// keep one API key per provider, not one per channel. The
|
|
36
|
+
// user picks the host + path that matches the API key
|
|
37
|
+
// they actually have; the curated `MODEL_METADATA` prices
|
|
38
|
+
// are host-based (CNY vs USD via `currencyForBaseUrl`).
|
|
39
|
+
//
|
|
40
|
+
// Source: https://bigmodel.cn/pricing (CN platform, CNY) +
|
|
41
|
+
// https://z.ai/pricing (international, USD). The 6 paths
|
|
42
|
+
// map to:
|
|
43
|
+
// - `/api/paas/v4` → 标准 API (Standard)
|
|
44
|
+
// - `/api/coding/paas/v4` → Coding Plan (订阅套餐)
|
|
45
|
+
// - `/api/anthropic` → Anthropic 兼容协议
|
|
46
|
+
//
|
|
47
|
+
// Earlier single-entry dropdown omitted the Coding Plan
|
|
48
|
+
// path and the international Z.ai host entirely — users on
|
|
49
|
+
// the Coding Plan subscription were 404'ing because they
|
|
50
|
+
// pasted `open.bigmodel.cn/api/paas/v4` into a Coding Plan
|
|
51
|
+
// key, and Z.ai users had no preset to pick.
|
|
52
|
+
// ── 国内 (open.bigmodel.cn — CNY) ───────────────────────
|
|
53
|
+
{ label: "\u56FD\u5185 \xB7 \u6807\u51C6 API", baseUrl: "https://open.bigmodel.cn/api/paas/v4" },
|
|
54
|
+
{ label: "\u56FD\u5185 \xB7 Coding Plan", baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4" },
|
|
55
|
+
// 重要:Anthropic 协议端点 **复用** Coding Plan 的 key(与
|
|
56
|
+
// `/api/coding/paas/v4` 共用同一凭证;不是 Standard API key,
|
|
57
|
+
// 也没有独立的 "Anthropic API key")。
|
|
58
|
+
// Reference: `docs/references/GLM-for-copilot-main/src/i18n.ts:578-579`
|
|
59
|
+
// "Coding Plan and Standard API credentials are independent.
|
|
60
|
+
// OpenAI and Anthropic endpoints in the same region share
|
|
61
|
+
// the Coding Plan key."
|
|
62
|
+
// label 故意重复 "Coding Plan" 两次,让用户从下拉里一眼看出:
|
|
63
|
+
// (a) 这个端点**只能配 Coding Plan key**;
|
|
64
|
+
// (b) 这是 Coding Plan 的**协议变体**,不是 Standard API 的。
|
|
65
|
+
{
|
|
66
|
+
label: "\u56FD\u5185 \xB7 Coding Plan \xB7 Anthropic \u534F\u8BAE",
|
|
67
|
+
baseUrl: "https://open.bigmodel.cn/api/anthropic"
|
|
68
|
+
},
|
|
69
|
+
// ── 国际 (api.z.ai — USD) ───────────────────────────────
|
|
70
|
+
{ label: "\u56FD\u9645 \xB7 \u6807\u51C6 API", baseUrl: "https://api.z.ai/api/paas/v4" },
|
|
71
|
+
{ label: "\u56FD\u9645 \xB7 Coding Plan", baseUrl: "https://api.z.ai/api/coding/paas/v4" },
|
|
72
|
+
{ label: "\u56FD\u9645 \xB7 Coding Plan \xB7 Anthropic \u534F\u8BAE", baseUrl: "https://api.z.ai/api/anthropic" }
|
|
17
73
|
],
|
|
18
74
|
stepfun: [{ label: "\u5B98\u65B9", baseUrl: "https://api.stepfun.com/v1" }],
|
|
19
75
|
siliconflow: [
|
|
@@ -60,7 +116,7 @@ function isProviderCacheControlAware(type) {
|
|
|
60
116
|
}
|
|
61
117
|
|
|
62
118
|
// src/ai/providers.metadata.ts
|
|
63
|
-
var
|
|
119
|
+
var PRIMARY_METADATA = {
|
|
64
120
|
"MiniMax-M3": {
|
|
65
121
|
detail: "Native multimodal frontier coding model (1M context, 512K effective)",
|
|
66
122
|
imageInput: true,
|
|
@@ -93,8 +149,17 @@ var MODEL_METADATA = {
|
|
|
93
149
|
detail: "M2.7 high-speed: same quality, faster (~100 TPS)",
|
|
94
150
|
imageInput: false,
|
|
95
151
|
toolCalling: true,
|
|
152
|
+
// Per https://minimax-ai.chat/pricing (2026-07 verified):
|
|
153
|
+
// M2.7-highspeed is 2× M2.7 base on input/output, but
|
|
154
|
+
// identical on cache hit (same model + same infra, just a
|
|
155
|
+
// serving-side TPS bump). The CNY values mirror USD at the
|
|
156
|
+
// project's 1:7 CNY-per-USD convention.
|
|
157
|
+
// Previously the CNY input/output were the same as base
|
|
158
|
+
// (¥2.1 / ¥8.4) while USD was already 2× — that left the
|
|
159
|
+
// USD/CNY ratio at 3.5× instead of 7× and silently
|
|
160
|
+
// under-reported CNY cost for users on the China platform.
|
|
96
161
|
pricingUSD: { input: 0.6, output: 2.4, cacheRead: 0.06 },
|
|
97
|
-
pricingCNY: { input: 2
|
|
162
|
+
pricingCNY: { input: 4.2, output: 16.8, cacheRead: 0.42 },
|
|
98
163
|
priceCategory: "low",
|
|
99
164
|
// Inherits M2.7's context window.
|
|
100
165
|
maxInputTokens: 131072,
|
|
@@ -104,8 +169,20 @@ var MODEL_METADATA = {
|
|
|
104
169
|
detail: "Fast, general-purpose model",
|
|
105
170
|
imageInput: true,
|
|
106
171
|
toolCalling: true,
|
|
107
|
-
|
|
108
|
-
|
|
172
|
+
// Per https://api-docs.deepseek.com/quick_start/pricing/ and
|
|
173
|
+
// https://new.qq.com/rain/a/20260813A0DROS00 (2026-08-13
|
|
174
|
+
// announcement, effective 2026-08-17 00:00 Beijing): peak/
|
|
175
|
+
// off-peak tiered pricing. Pinned the OFF-PEAK rate since
|
|
176
|
+
// peak hours (01:00–04:00 + 06:00–10:00 UTC = 09:00–12:00 +
|
|
177
|
+
// 14:00–18:00 Beijing) cover only 8 of 24 hours — most chat
|
|
178
|
+
// sessions land off-peak. Peak is exactly 2× off-peak per
|
|
179
|
+
// the official page.
|
|
180
|
+
// Off-peak: $0.007 cache hit / $0.22 input / $0.66 output
|
|
181
|
+
// ¥0.05 cache hit / ¥1.5 input / ¥4.5 output
|
|
182
|
+
// The pre-2026-08-17 rate was 1/3 of the current off-peak;
|
|
183
|
+
// 8/17 调价 raised cache hit 6× and output 2.25×.
|
|
184
|
+
pricingUSD: { input: 0.22, output: 0.66, cacheRead: 7e-3 },
|
|
185
|
+
pricingCNY: { input: 1.5, output: 4.5, cacheRead: 0.05 },
|
|
109
186
|
priceCategory: "low",
|
|
110
187
|
// Official docs (api-docs.deepseek.com/quick_start/pricing, fetched
|
|
111
188
|
// 2026-07-27): "THINKING MODE: Supports both non-thinking and
|
|
@@ -121,8 +198,20 @@ var MODEL_METADATA = {
|
|
|
121
198
|
detail: "Most capable reasoning model",
|
|
122
199
|
imageInput: true,
|
|
123
200
|
toolCalling: true,
|
|
124
|
-
|
|
125
|
-
|
|
201
|
+
// Per https://api-docs.deepseek.com/quick_start/pricing/ and
|
|
202
|
+
// https://new.qq.com/rain/a/20260813A0DROS00 (2026-08-13
|
|
203
|
+
// announcement, effective 2026-08-17 00:00 Beijing): peak/
|
|
204
|
+
// off-peak tiered pricing. Pinned the OFF-PEAK rate (peak
|
|
205
|
+
// hours are 8/24; most chat sessions land off-peak; peak is
|
|
206
|
+
// exactly 2× off-peak per the official page).
|
|
207
|
+
// Off-peak: $0.022 cache hit / $0.66 input / $1.98 output
|
|
208
|
+
// ¥0.15 cache hit / ¥4.5 input / ¥13.5 output
|
|
209
|
+
// The 8/17 调价 raised cache hit 6× (¥0.025 → ¥0.15),
|
|
210
|
+
// input 1.5×, and output 2.25×. The pre-08-17 USD values
|
|
211
|
+
// (0.435/0.87/0.003625) and CNY values (2.1/4.2/0.025) did
|
|
212
|
+
// not correspond to any DeepSeek-published rate; corrected.
|
|
213
|
+
pricingUSD: { input: 0.66, output: 1.98, cacheRead: 0.022 },
|
|
214
|
+
pricingCNY: { input: 4.5, output: 13.5, cacheRead: 0.15 },
|
|
126
215
|
priceCategory: "low",
|
|
127
216
|
thinkingSchema: "thinkingEnabled",
|
|
128
217
|
maxInputTokens: 655360,
|
|
@@ -250,56 +339,133 @@ var MODEL_METADATA = {
|
|
|
250
339
|
// GLM-5's explicit "Agentic 长程规划与执行" description. Corrected
|
|
251
340
|
// from false (inconsistent with the rest of the GLM-5 family).
|
|
252
341
|
"glm-5.2": {
|
|
253
|
-
detail: "GLM-5.2 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K",
|
|
342
|
+
detail: "GLM-5.2 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF08\u5355\u6863 pricing\uFF09",
|
|
254
343
|
imageInput: false,
|
|
255
344
|
toolCalling: true,
|
|
256
|
-
//
|
|
345
|
+
// Single rate (no input-length tier split) per
|
|
346
|
+
// bigmodel.cn/pricing 2026-08-18:
|
|
347
|
+
// ¥8 input / ¥28 output / ¥2 cache hit per 1M tokens
|
|
348
|
+
// The previous entry's comment said "输入长度 32K+ 档" — that
|
|
349
|
+
// was wrong: GLM-5.2 has no tier split on the official page.
|
|
257
350
|
pricingUSD: { input: 1.12, output: 3.92, cacheRead: 0.28 },
|
|
258
351
|
pricingCNY: { input: 8, output: 28, cacheRead: 2 },
|
|
259
352
|
priceCategory: "high",
|
|
260
353
|
maxInputTokens: 1e6,
|
|
261
354
|
maxOutputTokens: 128e3
|
|
262
355
|
},
|
|
263
|
-
|
|
264
|
-
|
|
356
|
+
// GLM-5.3 (2026-08-14) — same 744B base as GLM-5.2 with extended
|
|
357
|
+
// post-training for security / long-horizon coding. ~one-tenth the
|
|
358
|
+
// per-token price of comparable U.S. frontier models; Z.ai's headline
|
|
359
|
+
// result is 84.5% on CyberGym vulnerability-identification benchmark
|
|
360
|
+
// (vendor-reported, no third-party replication as of 2026-08-18).
|
|
361
|
+
// Available via GLM Coding Plan + ZCode; open weights staged ~2026-08-28.
|
|
362
|
+
"glm-5.3": {
|
|
363
|
+
detail: "GLM-5.3 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u540E\u8BAD\u7EC3\u589E\u5F3A\u4EE3\u7801 / \u7F51\u7EDC\u5B89\u5168",
|
|
364
|
+
imageInput: false,
|
|
365
|
+
toolCalling: true,
|
|
366
|
+
// Vendor-published USD price (Decrypt, 2026-08-14). Cache-hit price
|
|
367
|
+
// has not been published — the picker shows "(not published)" rather
|
|
368
|
+
// than fabricating a number (the rate usually diverges 4–10× from
|
|
369
|
+
// input, so a guess would mislead budget estimates).
|
|
370
|
+
pricingUSD: { input: 1.4, output: 4.4, cacheRead: null },
|
|
371
|
+
pricingCNY: { input: 10, output: 31, cacheRead: null },
|
|
372
|
+
priceCategory: "high",
|
|
373
|
+
maxInputTokens: 1e6,
|
|
374
|
+
maxOutputTokens: 128e3
|
|
375
|
+
},
|
|
376
|
+
// GLM-5.1-HighSpeed (2026-05) — production-grade high-throughput
|
|
377
|
+
// variant of GLM-5.1. Same 200K context + 128K output, but optimised
|
|
378
|
+
// via Zhipu's TileRT inference engine for 400 TPS output (~2× the
|
|
379
|
+
// rate of comparable flagship models). Native SSE streaming + MCP
|
|
380
|
+
// tool-call support. Listed on BigModel + Alibaba Cloud DashScope
|
|
381
|
+
// (model id `glm-5.1-highspeed`). Pricing mirrors GLM-5.1 since the
|
|
382
|
+
// rate is identical architecture — TileRT is a serving-side optim.
|
|
383
|
+
"glm-5.1-highspeed": {
|
|
384
|
+
detail: "GLM-5.1 HighSpeed \u2014 400 TPS \u9AD8\u541E\u5410\u751F\u4EA7\u53D8\u4F53\uFF08[0, 32K) tier \u955C\u50CF GLM-5.1\uFF09",
|
|
265
385
|
imageInput: false,
|
|
266
386
|
toolCalling: true,
|
|
267
|
-
//
|
|
387
|
+
// Mirrors GLM-5.1 [0, 32K) tier per bigmodel.cn/pricing 2026-08-18.
|
|
388
|
+
// TileRT is a serving-side optim; the per-token rate is the same
|
|
389
|
+
// architecture as the base model.
|
|
268
390
|
pricingUSD: { input: 0.6, output: 2.2, cacheRead: 0.11 },
|
|
269
|
-
pricingCNY: { input:
|
|
391
|
+
pricingCNY: { input: 6, output: 24, cacheRead: 1.3 },
|
|
392
|
+
priceCategory: "medium",
|
|
393
|
+
maxInputTokens: 2e5,
|
|
394
|
+
maxOutputTokens: 128e3
|
|
395
|
+
},
|
|
396
|
+
// GLM-4.7-Flash (2026-01-19) — 200K context, fully-free tier on
|
|
397
|
+
// bigmodel.cn/pricing (fetched 2026-08-18). Lightweight + high-
|
|
398
|
+
// frequency optimised; coding / writing / translation / reasoning
|
|
399
|
+
// at "best-in-class-for-its-size" per the Zhipu release notes.
|
|
400
|
+
// Distinct from `glm-4.7-flashx` (the latter is the 快速版 with
|
|
401
|
+
// paid pricing).
|
|
402
|
+
"glm-4.7-flash": {
|
|
403
|
+
detail: "GLM-4.7 Flash \u2014 \u5B8C\u5168\u514D\u8D39\uFF08200K \u4E0A\u4E0B\u6587\uFF09",
|
|
404
|
+
imageInput: false,
|
|
405
|
+
toolCalling: true,
|
|
406
|
+
// Free tier — input / output / cache hit all 0 (bigmodel.cn
|
|
407
|
+
// 2026-08-18 lists "免费" for every column). USD mirrors CNY
|
|
408
|
+
// rather than inventing a rate.
|
|
409
|
+
pricingUSD: { input: 0, output: 0, cacheRead: 0 },
|
|
410
|
+
pricingCNY: { input: 0, output: 0, cacheRead: 0 },
|
|
411
|
+
priceCategory: "low",
|
|
412
|
+
maxInputTokens: 2e5,
|
|
413
|
+
maxOutputTokens: 128e3
|
|
414
|
+
},
|
|
415
|
+
"glm-4.7": {
|
|
416
|
+
detail: "GLM-4.7 \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u5DE5\u5177\u8C03\u7528\uFF083-tier pricing\uFF09",
|
|
417
|
+
imageInput: false,
|
|
418
|
+
toolCalling: true,
|
|
419
|
+
// Pinned the LOWEST tier per bigmodel.cn/pricing 2026-08-18:
|
|
420
|
+
// [0, 32K) input × [0, 0.2K) output — ¥2 / ¥8 / ¥0.4 cache hit
|
|
421
|
+
// [0, 32K) input × [0.2K+) output — ¥3 / ¥14 / ¥0.6 cache hit
|
|
422
|
+
// [32K, 200K) input — ¥4 / ¥16 / ¥0.8 cache hit
|
|
423
|
+
// Most real prompts are < 32K input and < 0.2K output, so the
|
|
424
|
+
// lowest tier is the most representative per-request price.
|
|
425
|
+
// Re-pick from a higher tier if the picker adds a length slider.
|
|
426
|
+
pricingUSD: { input: 0.28, output: 1.12, cacheRead: 0.056 },
|
|
427
|
+
pricingCNY: { input: 2, output: 8, cacheRead: 0.4 },
|
|
270
428
|
priceCategory: "medium",
|
|
271
429
|
maxInputTokens: 2e5,
|
|
272
430
|
maxOutputTokens: 128e3
|
|
273
431
|
},
|
|
274
432
|
"glm-5.1": {
|
|
275
|
-
detail: "GLM-5.1 \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K",
|
|
433
|
+
detail: "GLM-5.1 \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
276
434
|
imageInput: false,
|
|
277
435
|
toolCalling: true,
|
|
278
|
-
//
|
|
279
|
-
|
|
280
|
-
|
|
436
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
437
|
+
// [0, 32K) — ¥6 input / ¥24 output / ¥1.3 cache hit
|
|
438
|
+
// [32K+) — ¥8 input / ¥28 output / ¥2 cache hit
|
|
439
|
+
// The previous entry had the higher tier; switched to the lower
|
|
440
|
+
// tier so a typical < 32K prompt shows the more accurate price.
|
|
441
|
+
pricingUSD: { input: 0.84, output: 3.36, cacheRead: 0.182 },
|
|
442
|
+
pricingCNY: { input: 6, output: 24, cacheRead: 1.3 },
|
|
281
443
|
priceCategory: "high",
|
|
282
444
|
maxInputTokens: 2e5,
|
|
283
445
|
maxOutputTokens: 128e3
|
|
284
446
|
},
|
|
285
447
|
"glm-5": {
|
|
286
|
-
detail: "GLM-5 \u2014 200K \u4E0A\u4E0B\u6587\uFF0CAgentic \u5DE5\u5177\u8C03\u7528\uFF0C\u6700\u5927\u8F93\u51FA 128K",
|
|
448
|
+
detail: "GLM-5 \u2014 200K \u4E0A\u4E0B\u6587\uFF0CAgentic \u5DE5\u5177\u8C03\u7528\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
287
449
|
imageInput: false,
|
|
288
450
|
toolCalling: true,
|
|
289
|
-
//
|
|
290
|
-
|
|
291
|
-
|
|
451
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
452
|
+
// [0, 32K) — ¥4 input / ¥18 output / ¥1 cache hit
|
|
453
|
+
// [32K+) — ¥6 input / ¥22 output / ¥1.5 cache hit
|
|
454
|
+
pricingUSD: { input: 0.56, output: 2.52, cacheRead: 0.14 },
|
|
455
|
+
pricingCNY: { input: 4, output: 18, cacheRead: 1 },
|
|
292
456
|
priceCategory: "high",
|
|
293
457
|
maxInputTokens: 2e5,
|
|
294
458
|
maxOutputTokens: 128e3
|
|
295
459
|
},
|
|
296
460
|
"glm-5-turbo": {
|
|
297
|
-
detail: "GLM-5 Turbo \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K",
|
|
461
|
+
detail: "GLM-5 Turbo \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
298
462
|
imageInput: false,
|
|
299
463
|
toolCalling: true,
|
|
300
|
-
//
|
|
301
|
-
|
|
302
|
-
|
|
464
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
465
|
+
// [0, 32K) — ¥5 input / ¥22 output / ¥1.2 cache hit
|
|
466
|
+
// [32K+) — ¥7 input / ¥26 output / ¥1.8 cache hit
|
|
467
|
+
pricingUSD: { input: 0.7, output: 3.08, cacheRead: 0.168 },
|
|
468
|
+
pricingCNY: { input: 5, output: 22, cacheRead: 1.2 },
|
|
303
469
|
priceCategory: "medium",
|
|
304
470
|
maxInputTokens: 2e5,
|
|
305
471
|
maxOutputTokens: 128e3
|
|
@@ -325,8 +491,19 @@ var MODEL_METADATA = {
|
|
|
325
491
|
maxInputTokens: 2e5,
|
|
326
492
|
maxOutputTokens: 128e3
|
|
327
493
|
},
|
|
328
|
-
|
|
329
|
-
|
|
494
|
+
// `glm-4.5` (no suffix) is exposed by Zhipu's `/v1/models`
|
|
495
|
+
// endpoint as of 2026-08-18 but is NOT listed on the public
|
|
496
|
+
// "模型概览" page (https://docs.bigmodel.cn/cn/guide/start/model-overview).
|
|
497
|
+
// It is almost certainly a legacy alias that routes to one of the
|
|
498
|
+
// suffixed variants — the only sibling in the 4.5 generation
|
|
499
|
+
// that ships tool calling is `glm-4.5-air` (128K context, 96K
|
|
500
|
+
// max output, ¥-billed), so we mirror that metadata here. The
|
|
501
|
+
// token caps are the most important field for the VSCode chat
|
|
502
|
+
// picker (entries with `maxInputTokens: 0` are hidden), and the
|
|
503
|
+
// pricing column is honest about it being a best-guess until
|
|
504
|
+
// Zhipu publishes a dedicated spec.
|
|
505
|
+
"glm-4.5": {
|
|
506
|
+
detail: "GLM-4.5 \u2014 \u5DE5\u5177\u8C03\u7528\uFF08\u88F8\u540D\uFF1BZhipu /v1/models \u66B4\u9732\u7684 legacy alias\uFF09",
|
|
330
507
|
imageInput: false,
|
|
331
508
|
toolCalling: true,
|
|
332
509
|
pricingUSD: { input: 0, output: 0, cacheRead: null },
|
|
@@ -335,14 +512,35 @@ var MODEL_METADATA = {
|
|
|
335
512
|
maxInputTokens: 128e3,
|
|
336
513
|
maxOutputTokens: 96e3
|
|
337
514
|
},
|
|
515
|
+
"glm-4.5-air": {
|
|
516
|
+
detail: "GLM-4.5 Air \u2014 \u5DE5\u5177\u8C03\u7528\uFF083-tier pricing\uFF09",
|
|
517
|
+
imageInput: false,
|
|
518
|
+
toolCalling: true,
|
|
519
|
+
// Pinned the LOWEST tier per bigmodel.cn/pricing 2026-08-18:
|
|
520
|
+
// [0, 32K) × [0, 0.2K) output — ¥0.8 / ¥2 / ¥0.16 cache hit
|
|
521
|
+
// [0, 32K) × [0.2K+) output — ¥0.8 / ¥6 / ¥0.16 cache hit
|
|
522
|
+
// [32K, 128K) — ¥1.2 / ¥8 / ¥0.24 cache hit
|
|
523
|
+
// All cache-hit rates are 4× lower than input — the
|
|
524
|
+
// explicit-cache-discount half of BYOM-depth #1.
|
|
525
|
+
pricingUSD: { input: 0.112, output: 0.28, cacheRead: 0.0224 },
|
|
526
|
+
pricingCNY: { input: 0.8, output: 2, cacheRead: 0.16 },
|
|
527
|
+
priceCategory: "low",
|
|
528
|
+
maxInputTokens: 128e3,
|
|
529
|
+
maxOutputTokens: 96e3
|
|
530
|
+
},
|
|
338
531
|
"glm-4.5-airx": {
|
|
339
|
-
detail: "GLM-4.5 AirX \u2014 \u5FEB\u901F\u7248",
|
|
532
|
+
detail: "GLM-4.5 AirX \u2014 \u5FEB\u901F\u7248\uFF08\xA510/M \u5355\u6863\uFF09",
|
|
340
533
|
imageInput: false,
|
|
341
534
|
toolCalling: false,
|
|
342
|
-
|
|
343
|
-
|
|
535
|
+
// ¥10 / M tokens (single rate, input == output) per
|
|
536
|
+
// bigmodel.cn/pricing 2026-08-18 — listed under the "模型推理
|
|
537
|
+
// → Language Models" sub-tab, NOT the flagship text section.
|
|
538
|
+
// 8K context window per the same sub-tab; 96K max output is a
|
|
539
|
+
// best-guess from sibling Air-tier models.
|
|
540
|
+
pricingUSD: { input: 1.4, output: 1.4, cacheRead: null },
|
|
541
|
+
pricingCNY: { input: 10, output: 10, cacheRead: null },
|
|
344
542
|
priceCategory: "low",
|
|
345
|
-
maxInputTokens:
|
|
543
|
+
maxInputTokens: 8192,
|
|
346
544
|
maxOutputTokens: 96e3
|
|
347
545
|
},
|
|
348
546
|
"glm-4-long": {
|
|
@@ -379,24 +577,29 @@ var MODEL_METADATA = {
|
|
|
379
577
|
maxOutputTokens: 4e3
|
|
380
578
|
},
|
|
381
579
|
"glm-4.5v": {
|
|
382
|
-
detail: "GLM-4.5V \u89C6\u89C9\u63A8\u7406\u6A21\u578B \u2014 \u56FE\u50CF/\u89C6\u9891/\u6587\u6863/GUI",
|
|
580
|
+
detail: "GLM-4.5V \u89C6\u89C9\u63A8\u7406\u6A21\u578B \u2014 \u56FE\u50CF/\u89C6\u9891/\u6587\u6863/GUI\uFF082-tier pricing\uFF09",
|
|
383
581
|
imageInput: true,
|
|
384
582
|
toolCalling: true,
|
|
385
|
-
|
|
386
|
-
|
|
583
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
584
|
+
// [0, 32K) — ¥2 input / ¥6 output / ¥0.4 cache hit
|
|
585
|
+
// [32, 64K) — ¥4 input / ¥12 output / ¥0.8 cache hit
|
|
586
|
+
pricingUSD: { input: 0.28, output: 0.84, cacheRead: 0.056 },
|
|
587
|
+
pricingCNY: { input: 2, output: 6, cacheRead: 0.4 },
|
|
387
588
|
priceCategory: "medium",
|
|
388
|
-
maxInputTokens:
|
|
589
|
+
maxInputTokens: 64e3,
|
|
389
590
|
maxOutputTokens: 8192
|
|
390
591
|
},
|
|
391
592
|
"glm-5v-turbo": {
|
|
392
|
-
detail: "GLM-5V Turbo \u2014 \u591A\u6A21\u6001 Coding \u6A21\u578B",
|
|
593
|
+
detail: "GLM-5V Turbo \u2014 \u591A\u6A21\u6001 Coding \u6A21\u578B\uFF082-tier pricing\uFF09",
|
|
393
594
|
imageInput: true,
|
|
394
595
|
toolCalling: true,
|
|
395
|
-
|
|
396
|
-
|
|
596
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
597
|
+
// [0, 32K) — ¥5 input / ¥22 output / ¥1.2 cache hit
|
|
598
|
+
// [32K+) — ¥7 input / ¥26 output / ¥1.8 cache hit
|
|
599
|
+
// Vendor-published context: 200K / 128K max output.
|
|
600
|
+
pricingUSD: { input: 0.7, output: 3.08, cacheRead: 0.168 },
|
|
601
|
+
pricingCNY: { input: 5, output: 22, cacheRead: 1.2 },
|
|
397
602
|
priceCategory: "medium",
|
|
398
|
-
// Official model overview: 200K context / 128K max output
|
|
399
|
-
// (previously mis-set to 128K/8_192 — corrected 2026-07-27).
|
|
400
603
|
maxInputTokens: 2e5,
|
|
401
604
|
maxOutputTokens: 128e3
|
|
402
605
|
},
|
|
@@ -424,8 +627,15 @@ var MODEL_METADATA = {
|
|
|
424
627
|
// Official model page lists "🛠️ 工具调用: 可靠的工具调用能力,支持多步
|
|
425
628
|
// 任务分解与计划执行" as a core capability — was mis-set to false.
|
|
426
629
|
toolCalling: true,
|
|
427
|
-
//
|
|
428
|
-
|
|
630
|
+
// Per https://platform.stepfun.com/docs/zh/pricing/details
|
|
631
|
+
// (2026-08-18 fetched): ¥1.35 input / ¥8.1 output /
|
|
632
|
+
// ¥0.27 cache hit per 1M tokens, USD = $0.20 / $1.15 /
|
|
633
|
+
// $0.04 (StepFun is USD-billed at the same rate as CNY/7
|
|
634
|
+
// with small rounding per the official pricing page).
|
|
635
|
+
// USD values previously 0.189/1.134/0.038 — slightly off
|
|
636
|
+
// from the official page (rounding error from dividing CNY
|
|
637
|
+
// by hand), corrected.
|
|
638
|
+
pricingUSD: { input: 0.2, output: 1.15, cacheRead: 0.04 },
|
|
429
639
|
pricingCNY: { input: 1.35, output: 8.1, cacheRead: 0.27 },
|
|
430
640
|
priceCategory: "medium",
|
|
431
641
|
thinkingSchema: "reasoningEffort",
|
|
@@ -441,8 +651,13 @@ var MODEL_METADATA = {
|
|
|
441
651
|
// Official model page lists "🛠️ 工具调用: 可靠的 tools / tool_choice
|
|
442
652
|
// 调用能力" as a core capability — was mis-set to false.
|
|
443
653
|
toolCalling: true,
|
|
444
|
-
//
|
|
445
|
-
|
|
654
|
+
// Per https://platform.stepfun.com/docs/zh/pricing/details
|
|
655
|
+
// (2026-08-18 fetched): ¥0.7 input / ¥2.1 output /
|
|
656
|
+
// ¥0.14 cache hit per 1M tokens, USD = $0.10 / $0.30 /
|
|
657
|
+
// $0.02. USD values previously 0.098/0.294/0.02 — slightly
|
|
658
|
+
// off from the official page (rounding error), corrected
|
|
659
|
+
// to the exact published values.
|
|
660
|
+
pricingUSD: { input: 0.1, output: 0.3, cacheRead: 0.02 },
|
|
446
661
|
pricingCNY: { input: 0.7, output: 2.1, cacheRead: 0.14 },
|
|
447
662
|
priceCategory: "low",
|
|
448
663
|
thinkingSchema: "reasoningEffort",
|
|
@@ -453,9 +668,13 @@ var MODEL_METADATA = {
|
|
|
453
668
|
detail: "Step 1o Turbo Vision \u2014 \u89C6\u89C9\u6A21\u578B",
|
|
454
669
|
imageInput: true,
|
|
455
670
|
toolCalling: false,
|
|
456
|
-
//
|
|
457
|
-
|
|
458
|
-
|
|
671
|
+
// Per https://platform.stepfun.com/docs/zh/pricing/details
|
|
672
|
+
// (2026-08-18 fetched): ¥2.5 cache miss / ¥0.5 cache hit /
|
|
673
|
+
// ¥8 output per 1M tokens. USD = $0.357 / $0.071 / $1.143
|
|
674
|
+
// (CNY/7 with rounding). Cache hit was previously
|
|
675
|
+
// undocumented in the curated entry — added.
|
|
676
|
+
pricingUSD: { input: 0.357, output: 1.143, cacheRead: 0.071 },
|
|
677
|
+
pricingCNY: { input: 2.5, output: 8, cacheRead: 0.5 },
|
|
459
678
|
priceCategory: "low",
|
|
460
679
|
// Official model overview: 32K context window.
|
|
461
680
|
maxInputTokens: 32768,
|
|
@@ -486,18 +705,112 @@ var MODEL_METADATA = {
|
|
|
486
705
|
priceCategory: "low",
|
|
487
706
|
maxInputTokens: 32768,
|
|
488
707
|
maxOutputTokens: 32768
|
|
708
|
+
},
|
|
709
|
+
// ── MiniMax M2.5 (2026-02-13) ──────────────────────────────────────
|
|
710
|
+
// 229B MoE, 80.2% SWE-Bench Verified, the predecessor to M2.7.
|
|
711
|
+
// Source: https://siliconflow.cn/models?series=qwen (MiniMax card),
|
|
712
|
+
// platform.minimaxi.com/docs/release-notes/models (M2.5 release note).
|
|
713
|
+
"MiniMax-M2.5": {
|
|
714
|
+
detail: "MiniMax M2.5 \u2014 229B MoE, SOTA \u7F16\u7A0B / Agent / \u529E\u516C\u751F\u4EA7\u529B\uFF08192K \u4E0A\u4E0B\u6587\uFF09",
|
|
715
|
+
imageInput: false,
|
|
716
|
+
toolCalling: true,
|
|
717
|
+
// Per https://minimax-ai.chat/pricing (M2.5 legacy line):
|
|
718
|
+
// ¥2.1 input / ¥8.4 output / ¥0.21 cache hit per 1M tokens;
|
|
719
|
+
// USD = $0.30 / $1.20 / $0.03 (cloudprice.net 2026-08-13).
|
|
720
|
+
// Cache hit IS the published rate — the previous comment
|
|
721
|
+
// "按官方 10% cache 命中率回填" was wrong (it implied we
|
|
722
|
+
// were estimating, when actually the cache rate is
|
|
723
|
+
// documented at ¥0.21 / $0.03 per 1M tokens).
|
|
724
|
+
pricingUSD: { input: 0.3, output: 1.2, cacheRead: 0.03 },
|
|
725
|
+
pricingCNY: { input: 2.1, output: 8.4, cacheRead: 0.21 },
|
|
726
|
+
priceCategory: "medium",
|
|
727
|
+
// 官方 context 192K;output 按 16K 保守估值(M2.7 标 128K,M2.5
|
|
728
|
+
// 官方未单独发布 max output 数字,按其同代老模型惯例取 16K)。
|
|
729
|
+
maxInputTokens: 192e3,
|
|
730
|
+
maxOutputTokens: 16384
|
|
731
|
+
},
|
|
732
|
+
// ── Qwen3.6-35B-A3B(2026-04-17 通义千问)────────────────────────────
|
|
733
|
+
// 35B MoE,激活仅 3B,256K 上下文;2026 年 Qwen3.6 系列首发
|
|
734
|
+
// small-size open-weight。"激活成本 1/10" 是其与前代 Qwen3.5-27B
|
|
735
|
+
// 相比的核心卖点。Source:
|
|
736
|
+
// https://siliconflow.cn/news/z12t3edpv6ypbuja3o65lgh2
|
|
737
|
+
"Qwen3.6-35B-A3B": {
|
|
738
|
+
detail: "Qwen3.6-35B-A3B \u2014 35B MoE (3B \u6FC0\u6D3B)\uFF0C\u601D\u8003/\u975E\u601D\u8003\u53CC\u6A21\uFF0C256K \u4E0A\u4E0B\u6587",
|
|
739
|
+
imageInput: true,
|
|
740
|
+
toolCalling: true,
|
|
741
|
+
// SiliconFlow 列价:¥1.6 / ¥12.8 per 1M tokens
|
|
742
|
+
pricingUSD: { input: 0.23, output: 1.83, cacheRead: null },
|
|
743
|
+
pricingCNY: { input: 1.6, output: 12.8, cacheRead: null },
|
|
744
|
+
priceCategory: "low",
|
|
745
|
+
// Qwen3.6-35B-A3B 官方 256K context;output 上限按同代 27B
|
|
746
|
+
// 同样 32K 取值(Qwen3.6 系列 max output 未单独公布)。
|
|
747
|
+
maxInputTokens: 256e3,
|
|
748
|
+
maxOutputTokens: 32768
|
|
489
749
|
}
|
|
490
750
|
};
|
|
751
|
+
var NAMESPACE_ALIASES = {
|
|
752
|
+
// SiliconFlow (CNY-billed China-domiciled platform)
|
|
753
|
+
"deepseek-ai/DeepSeek-V4-Pro": "deepseek-v4-pro",
|
|
754
|
+
"deepseek-ai/DeepSeek-V4-Flash": "deepseek-v4-flash",
|
|
755
|
+
"zai-org/GLM-5.2": "glm-5.2",
|
|
756
|
+
"Qwen/Qwen3.6-35B-A3B": "Qwen3.6-35B-A3B",
|
|
757
|
+
"moonshotai/Kimi-K2.7-Code": "kimi-k2.7-code",
|
|
758
|
+
// Novita (USD-billed global aggregator)
|
|
759
|
+
"deepseek/deepseek-v4-pro": "deepseek-v4-pro",
|
|
760
|
+
"deepseek/deepseek-v4-flash": "deepseek-v4-flash",
|
|
761
|
+
"zai/glm-5.2": "glm-5.2",
|
|
762
|
+
"zai/glm-5.1": "glm-5.1",
|
|
763
|
+
"moonshotai/kimi-k3": "kimi-k3",
|
|
764
|
+
// Zhipu naming-history aliases. The 2026-08 "模型一览" page
|
|
765
|
+
// (https://docs.bigmodel.cn/cn/guide/start/model-overview) lists
|
|
766
|
+
// the FlashX variant under its date-stamped id
|
|
767
|
+
// `GLM-4-FlashX-250414`; the bare `glm-4-flashx` is the
|
|
768
|
+
// historical alias that still resolves in chat-completions calls
|
|
769
|
+
// (and is what every existing ProvidersTab user has stored). Map
|
|
770
|
+
// the new id to the same primary entry so both spellings benefit
|
|
771
|
+
// from the curated detail / pricing / capability columns.
|
|
772
|
+
"glm-4-flashx-250414": "glm-4-flashx"
|
|
773
|
+
};
|
|
774
|
+
var MODEL_METADATA = (() => {
|
|
775
|
+
const merged = {
|
|
776
|
+
...PRIMARY_METADATA
|
|
777
|
+
};
|
|
778
|
+
for (const [alias, target] of Object.entries(NAMESPACE_ALIASES)) {
|
|
779
|
+
const targetEntry = PRIMARY_METADATA[target];
|
|
780
|
+
if (targetEntry !== void 0) {
|
|
781
|
+
merged[alias] = targetEntry;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
return Object.freeze(merged);
|
|
785
|
+
})();
|
|
491
786
|
function lookupModelMetadata(modelId) {
|
|
492
787
|
return MODEL_METADATA[modelId];
|
|
493
788
|
}
|
|
494
789
|
function currencyForBaseUrl(baseUrl) {
|
|
495
790
|
try {
|
|
496
791
|
const hostname = new URL(baseUrl).hostname.toLowerCase();
|
|
497
|
-
if (hostname === "api.minimaxi.com" || hostname === "api.minimaxi.cn" || hostname === "api.deepseek.com" || hostname === "api.moonshot.cn" || hostname === "open.bigmodel.cn"
|
|
792
|
+
if (hostname === "api.minimaxi.com" || hostname === "api.minimaxi.cn" || hostname === "api.deepseek.com" || hostname === "api.moonshot.cn" || hostname === "open.bigmodel.cn" || // Zhipu legacy v3 host. Per the GLM-for-copilot reference
|
|
793
|
+
// (`docs/references/GLM-for-copilot-main/src/endpoint.ts:4`)
|
|
794
|
+
// this was retired to `bigmodel.cn` but is still
|
|
795
|
+
// resolvable for accounts that haven't migrated — we
|
|
796
|
+
// don't surface it in the baseUrl dropdown, but a user
|
|
797
|
+
// may paste it from a saved settings.json, so the
|
|
798
|
+
// currency has to match (CNY, same as the new host).
|
|
799
|
+
hostname === "dev.bigmodel.cn") {
|
|
498
800
|
return "CNY";
|
|
499
801
|
}
|
|
500
|
-
if (hostname === "api.minimax.io" || hostname === "api.minimaxi.io" || hostname === "api.siliconflow.cn" || hostname === "api.siliconflow.com" || hostname === "api.stepfun.com" || hostname === "openrouter.ai" || hostname === "api.novita.ai"
|
|
802
|
+
if (hostname === "api.minimax.io" || hostname === "api.minimaxi.io" || hostname === "api.siliconflow.cn" || hostname === "api.siliconflow.com" || hostname === "api.stepfun.com" || hostname === "openrouter.ai" || hostname === "api.novita.ai" || // Z.ai / Zhipu international. Billed in USD per the
|
|
803
|
+
// official `bigmodel.cn/pricing` page (the CNY-billed
|
|
804
|
+
// list is the China-domiciled `open.bigmodel.cn` only;
|
|
805
|
+
// the international `api.z.ai` is USD regardless of
|
|
806
|
+
// which apiMode / protocol path the user picked). The
|
|
807
|
+
// GLM-for-copilot reference uses the same split
|
|
808
|
+
// (`docs/references/GLM-for-copilot-main/src/endpoint.ts:160-173`).
|
|
809
|
+
// Without this explicit entry, `api.z.ai` would still
|
|
810
|
+
// resolve to USD via the catch-all below — adding it
|
|
811
|
+
// here makes the intent grep-able and pins the host
|
|
812
|
+
// list against accidental removal.
|
|
813
|
+
hostname === "api.z.ai") {
|
|
501
814
|
return "USD";
|
|
502
815
|
}
|
|
503
816
|
} catch {
|
|
@@ -555,7 +868,12 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
555
868
|
models: [
|
|
556
869
|
buildPresetModel("MiniMax-M3", "MiniMax-M3"),
|
|
557
870
|
buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7"),
|
|
558
|
-
buildPresetModel("MiniMax-M2.7-highspeed", "MiniMax-M2.7-highspeed")
|
|
871
|
+
buildPresetModel("MiniMax-M2.7-highspeed", "MiniMax-M2.7-highspeed"),
|
|
872
|
+
// M2.5 (2026-02-13, 80.2% SWE-Bench Verified) — the
|
|
873
|
+
// predecessor of M2.7. Still in the catalog and often
|
|
874
|
+
// available on MiniMax's promotional $0.30/$1.20 rate, so
|
|
875
|
+
// keep it as a preset for users on the M2.5 plan tier.
|
|
876
|
+
buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5")
|
|
559
877
|
]
|
|
560
878
|
},
|
|
561
879
|
deepseek: {
|
|
@@ -604,27 +922,81 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
604
922
|
zhipu: {
|
|
605
923
|
displayName: "Zhipu",
|
|
606
924
|
baseUrl: "https://open.bigmodel.cn/api/paas/v4",
|
|
607
|
-
//
|
|
608
|
-
//
|
|
609
|
-
//
|
|
610
|
-
//
|
|
611
|
-
//
|
|
925
|
+
// The preset is the **intersection** of (a) the curated
|
|
926
|
+
// `MODEL_METADATA` table above and (b) what Zhipu's
|
|
927
|
+
// `/v1/models` endpoint actually returns as of 2026-08-18
|
|
928
|
+
// (verified by the user's "Fetch from API" pull in
|
|
929
|
+
// ProvidersTab — see screenshot in the 2026-08-18 review).
|
|
930
|
+
// The two sources are kept in sync deliberately: a curated
|
|
931
|
+
// entry without a `/v1/models` listing is dead weight in the
|
|
932
|
+
// starter list (the user can still add it by hand), and a
|
|
933
|
+
// `/v1/models` listing without a curated entry breaks
|
|
934
|
+
// `buildPresetModel`'s fail-loudly contract.
|
|
935
|
+
//
|
|
936
|
+
// 2026-08-18 trim — the following 8 entries were removed
|
|
937
|
+
// because they no longer show up in Zhipu's `/v1/models`
|
|
938
|
+
// response (they were either retired, never exposed via
|
|
939
|
+
// chat-completions, or only reachable on private/coding-plan
|
|
940
|
+
// endpoints that the public `/v1/models` doesn't advertise):
|
|
941
|
+
//
|
|
942
|
+
// glm-5.1-highspeed — production 400-TPS variant of
|
|
943
|
+
// GLM-5.1 served via TileRT; still
|
|
944
|
+
// listed in some third-party mirrors
|
|
945
|
+
// (Alibaba Cloud DashScope) but not
|
|
946
|
+
// on Zhipu's own /v1/models.
|
|
947
|
+
// glm-5v-turbo — multimodal coding base; only
|
|
948
|
+
// reachable via the dedicated
|
|
949
|
+
// multimodal endpoint, not
|
|
950
|
+
// /v1/chat/completions.
|
|
951
|
+
// glm-4.7-flash — free-tier 4.7 lite; advertised on
|
|
952
|
+
// the docs pricing page but absent
|
|
953
|
+
// from /v1/models.
|
|
954
|
+
// glm-4.7-flashx — quick-response 4.7; same situation
|
|
955
|
+
// as glm-4.7-flash.
|
|
956
|
+
// glm-4.5v — multimodal 4.5; only on the
|
|
957
|
+
// dedicated VLM endpoint.
|
|
958
|
+
// glm-4.5-airx — quick-response 4.5 Air; not in
|
|
959
|
+
// /v1/models anymore.
|
|
960
|
+
// glm-4-long — 1M-context 4-Long; the `/long`
|
|
961
|
+
// path was retired in 2026 H1.
|
|
962
|
+
// glm-4-flashx — quick-response 4 FlashX; the
|
|
963
|
+
// `-250414` dated alias (see
|
|
964
|
+
// `NAMESPACE_ALIASES` in
|
|
965
|
+
// `providers.metadata.ts`) is the
|
|
966
|
+
// only spelling still exposed.
|
|
967
|
+
//
|
|
968
|
+
// Note: `glm-4.5` (no suffix) IS in the preset now. It is
|
|
969
|
+
// NOT listed on the public "模型概览" page but it IS
|
|
970
|
+
// returned by /v1/models — almost certainly a legacy alias
|
|
971
|
+
// that routes to one of the suffixed 4.5 variants. The
|
|
972
|
+
// curated metadata entry marks it as such; users on a
|
|
973
|
+
// private coding-plan endpoint that distinguishes `glm-4.5`
|
|
974
|
+
// from `glm-4.5-air` should override the model id in the
|
|
975
|
+
// ProvidersTab.
|
|
976
|
+
//
|
|
977
|
+
// Earlier (also 2026-08-18) trim — `glm-4-plus` and
|
|
978
|
+
// `glm-3-turbo` were removed from the preset on the same
|
|
979
|
+
// date. Both are no longer listed in Zhipu's public
|
|
980
|
+
// "模型一览": `GLM-4-0520` is in the "即将弃用模型" list
|
|
981
|
+
// and `GLM-3-Turbo` has been retired without a formal
|
|
982
|
+
// redirect. Their API endpoints may still respond for
|
|
983
|
+
// legacy accounts (the `glm-4-plus` 429 "余额不足" log we
|
|
984
|
+
// saw on 2026-08-18 is one such case), but they shouldn't
|
|
985
|
+
// be the default starter pick for a freshly added Zhipu
|
|
986
|
+
// provider. Users with a paid legacy plan that still works
|
|
987
|
+
// can add the id back by hand in the ProvidersTab; the
|
|
988
|
+
// `MODEL_METADATA` entries are kept so the id is still
|
|
989
|
+
// resolvable for the curated detail / pricing columns.
|
|
612
990
|
models: [
|
|
991
|
+
buildPresetModel("glm-5.3", "GLM-5.3"),
|
|
613
992
|
buildPresetModel("glm-5.2", "GLM-5.2"),
|
|
614
993
|
buildPresetModel("glm-5.1", "GLM-5.1"),
|
|
615
994
|
buildPresetModel("glm-5", "GLM-5"),
|
|
616
995
|
buildPresetModel("glm-5-turbo", "GLM-5 Turbo"),
|
|
617
|
-
buildPresetModel("glm-5v-turbo", "GLM-5V Turbo"),
|
|
618
996
|
buildPresetModel("glm-4.7", "GLM-4.7"),
|
|
619
|
-
buildPresetModel("glm-4.7-flashx", "GLM-4.7 FlashX"),
|
|
620
997
|
buildPresetModel("glm-4.6", "GLM-4.6"),
|
|
621
|
-
buildPresetModel("glm-4.5v", "GLM-4.5V"),
|
|
622
998
|
buildPresetModel("glm-4.5-air", "GLM-4.5 Air"),
|
|
623
|
-
buildPresetModel("glm-4.5
|
|
624
|
-
buildPresetModel("glm-4-plus", "GLM-4 Plus"),
|
|
625
|
-
buildPresetModel("glm-4-long", "GLM-4 Long"),
|
|
626
|
-
buildPresetModel("glm-4-flashx", "GLM-4 FlashX"),
|
|
627
|
-
buildPresetModel("glm-3-turbo", "GLM-3 Turbo")
|
|
999
|
+
buildPresetModel("glm-4.5", "GLM-4.5")
|
|
628
1000
|
]
|
|
629
1001
|
},
|
|
630
1002
|
stepfun: {
|
|
@@ -639,9 +1011,23 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
639
1011
|
siliconflow: {
|
|
640
1012
|
displayName: "SiliconFlow",
|
|
641
1013
|
baseUrl: "https://api.siliconflow.cn/v1",
|
|
642
|
-
//
|
|
643
|
-
//
|
|
644
|
-
|
|
1014
|
+
// 聚合平台 — 模型列表由平台动态维护(>100 个)。这里列的
|
|
1015
|
+
// 6 个是 2026 年 7-8 月各家最新的旗舰/代表型号,给 ProvidersTab
|
|
1016
|
+
// 一个 "一眼能看到" 的起点;用户添加 provider 后可继续通过
|
|
1017
|
+
// `/v1/models` 拉取完整列表。
|
|
1018
|
+
// 这里的 id 是 SiliconFlow API 用的 namespaced 字符串,必须
|
|
1019
|
+
// 与 MODEL_METADATA 的 alias 严格一致。
|
|
1020
|
+
models: [
|
|
1021
|
+
// DeepSeek V4 系列 (2026-04)
|
|
1022
|
+
buildPresetModel("deepseek-ai/DeepSeek-V4-Pro", "DeepSeek V4 Pro (via SiliconFlow)"),
|
|
1023
|
+
buildPresetModel("deepseek-ai/DeepSeek-V4-Flash", "DeepSeek V4 Flash (via SiliconFlow)"),
|
|
1024
|
+
// GLM-5.2 (2026-06-17) — open-weight 编程旗舰,1M context
|
|
1025
|
+
buildPresetModel("zai-org/GLM-5.2", "GLM-5.2 (via SiliconFlow)"),
|
|
1026
|
+
// Qwen3.6-35B-A3B (2026-04) — 35B MoE, 3B 激活,"小而强"
|
|
1027
|
+
buildPresetModel("Qwen/Qwen3.6-35B-A3B", "Qwen3.6-35B-A3B (via SiliconFlow)"),
|
|
1028
|
+
// Kimi K2.7-Code (2026-06-12) — Moonshot coding 旗舰
|
|
1029
|
+
buildPresetModel("moonshotai/Kimi-K2.7-Code", "Kimi K2.7 Code (via SiliconFlow)")
|
|
1030
|
+
]
|
|
645
1031
|
},
|
|
646
1032
|
openrouter: {
|
|
647
1033
|
displayName: "OpenRouter",
|
|
@@ -651,12 +1037,21 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
651
1037
|
novita: {
|
|
652
1038
|
displayName: "Novita",
|
|
653
1039
|
baseUrl: "https://api.novita.ai/openai/v1",
|
|
654
|
-
// 聚合平台:Novita 本身不产出自有模型,只是把 Kimi K3 / GLM 5.
|
|
655
|
-
// DeepSeek V4
|
|
656
|
-
//
|
|
657
|
-
//
|
|
658
|
-
//
|
|
659
|
-
models: [
|
|
1040
|
+
// 聚合平台:Novita 本身不产出自有模型,只是把 Kimi K3 / GLM 5.x /
|
|
1041
|
+
// DeepSeek V4 等第三方开源或授权模型挂到统一 OpenAI 兼容网关下
|
|
1042
|
+
// (见 https://novita.ai/llm-api)。这里列 5 个 2026 旗舰作为
|
|
1043
|
+
// preset 起点;用户添加 provider 后可继续通过 `/v1/models` 拉取
|
|
1044
|
+
// 完整列表。id 严格匹配 Novita API 的 namespaced 字符串。
|
|
1045
|
+
models: [
|
|
1046
|
+
// DeepSeek V4 系列 (2026-04)
|
|
1047
|
+
buildPresetModel("deepseek/deepseek-v4-pro", "DeepSeek V4 Pro (via Novita)"),
|
|
1048
|
+
buildPresetModel("deepseek/deepseek-v4-flash", "DeepSeek V4 Flash (via Novita)"),
|
|
1049
|
+
// GLM-5 系列 (2026-04/06)
|
|
1050
|
+
buildPresetModel("zai/glm-5.2", "GLM-5.2 (via Novita)"),
|
|
1051
|
+
buildPresetModel("zai/glm-5.1", "GLM-5.1 (via Novita)"),
|
|
1052
|
+
// Kimi K3 (2026-07-16 API, 2026-07-27 开源) — 1M context, 2.8T MoE
|
|
1053
|
+
buildPresetModel("moonshotai/kimi-k3", "Kimi K3 (via Novita)")
|
|
1054
|
+
]
|
|
660
1055
|
}
|
|
661
1056
|
};
|
|
662
1057
|
function getBuiltinProviderPreset(type) {
|
|
@@ -1200,6 +1595,7 @@ export {
|
|
|
1200
1595
|
checkGitHubOrgMembership,
|
|
1201
1596
|
createConsoleLogger,
|
|
1202
1597
|
currencyForBaseUrl,
|
|
1598
|
+
effectiveAdapterType,
|
|
1203
1599
|
fetchGitHubUser,
|
|
1204
1600
|
getBuiltinProviderPreset,
|
|
1205
1601
|
getGitHubOrgMembership,
|
|
@@ -1212,6 +1608,7 @@ export {
|
|
|
1212
1608
|
normalizeErrorForLog,
|
|
1213
1609
|
normalizeGitUrl,
|
|
1214
1610
|
parsePayload,
|
|
1611
|
+
protocolForBaseUrl,
|
|
1215
1612
|
resolvePrimaryEmail,
|
|
1216
1613
|
safeJson
|
|
1217
1614
|
};
|