@serviceme/devtools-shared 0.4.7 → 0.4.9
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 +271 -8
- package/dist/index.d.ts +271 -8
- package/dist/index.js +528 -85
- package/dist/index.mjs +519 -84
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -50,8 +50,14 @@ var PROVIDER_BASE_URL_PRESETS = {
|
|
|
50
50
|
// pasted `open.bigmodel.cn/api/paas/v4` into a Coding Plan
|
|
51
51
|
// key, and Z.ai users had no preset to pick.
|
|
52
52
|
// ── 国内 (open.bigmodel.cn — CNY) ───────────────────────
|
|
53
|
-
{
|
|
54
|
-
|
|
53
|
+
{
|
|
54
|
+
label: "\u56FD\u5185 \xB7 \u6807\u51C6 API",
|
|
55
|
+
baseUrl: "https://open.bigmodel.cn/api/paas/v4"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: "\u56FD\u5185 \xB7 Coding Plan",
|
|
59
|
+
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4"
|
|
60
|
+
},
|
|
55
61
|
// 重要:Anthropic 协议端点 **复用** Coding Plan 的 key(与
|
|
56
62
|
// `/api/coding/paas/v4` 共用同一凭证;不是 Standard API key,
|
|
57
63
|
// 也没有独立的 "Anthropic API key")。
|
|
@@ -68,8 +74,14 @@ var PROVIDER_BASE_URL_PRESETS = {
|
|
|
68
74
|
},
|
|
69
75
|
// ── 国际 (api.z.ai — USD) ───────────────────────────────
|
|
70
76
|
{ label: "\u56FD\u9645 \xB7 \u6807\u51C6 API", baseUrl: "https://api.z.ai/api/paas/v4" },
|
|
71
|
-
{
|
|
72
|
-
|
|
77
|
+
{
|
|
78
|
+
label: "\u56FD\u9645 \xB7 Coding Plan",
|
|
79
|
+
baseUrl: "https://api.z.ai/api/coding/paas/v4"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: "\u56FD\u9645 \xB7 Coding Plan \xB7 Anthropic \u534F\u8BAE",
|
|
83
|
+
baseUrl: "https://api.z.ai/api/anthropic"
|
|
84
|
+
}
|
|
73
85
|
],
|
|
74
86
|
stepfun: [{ label: "\u5B98\u65B9", baseUrl: "https://api.stepfun.com/v1" }],
|
|
75
87
|
siliconflow: [
|
|
@@ -82,6 +94,8 @@ var PROVIDER_BASE_URL_PRESETS = {
|
|
|
82
94
|
{ label: "\u56FD\u5185", baseUrl: "https://api.agnes-ai.cn/v1" },
|
|
83
95
|
{ label: "\u5168\u7403", baseUrl: "https://apihub.agnes-ai.com/v1" }
|
|
84
96
|
],
|
|
97
|
+
// Medalsoft internal LLM gateway — single OpenAI-compatible endpoint.
|
|
98
|
+
medalsoft: [{ label: "\u5185\u90E8\u7F51\u5173", baseUrl: "https://llm.proxy.alio.wang/v1" }],
|
|
85
99
|
"vscode-builtin": []
|
|
86
100
|
};
|
|
87
101
|
function getProviderBaseUrlPresets(type) {
|
|
@@ -101,7 +115,18 @@ var PROVIDER_CACHE_CONTROL_METADATA = {
|
|
|
101
115
|
// OpenAI-compat prompt_cache_key
|
|
102
116
|
},
|
|
103
117
|
kimi: {},
|
|
104
|
-
|
|
118
|
+
// 2026-08-20 — Zhipu joins the cache-aware set (learnings doc §9
|
|
119
|
+
// task #6). Zhipu's OpenAI-compatible endpoint performs automatic
|
|
120
|
+
// prefix caching on stable request prefixes; the `prompt_cache_key`
|
|
121
|
+
// header the OpenAI adapter writes for cache-aware types gives the
|
|
122
|
+
// upstream a stable per-conversation bucket (mirrors the reference's
|
|
123
|
+
// Coding-Plan prompt-cache behaviour). The Anthropic-protocol
|
|
124
|
+
// `/api/anthropic` routes are unaffected — that path uses the
|
|
125
|
+
// AnthropicAdapter's own 4-breakpoint `cache_control` logic and
|
|
126
|
+
// ignores this flag.
|
|
127
|
+
zhipu: {
|
|
128
|
+
supportsCacheControl: true
|
|
129
|
+
},
|
|
105
130
|
stepfun: {},
|
|
106
131
|
siliconflow: {},
|
|
107
132
|
openrouter: {},
|
|
@@ -109,6 +134,12 @@ var PROVIDER_CACHE_CONTROL_METADATA = {
|
|
|
109
134
|
agnes: {
|
|
110
135
|
supportsCacheControl: true
|
|
111
136
|
},
|
|
137
|
+
// Medalsoft internal gateway — OpenAI-compatible pass-through; the
|
|
138
|
+
// upstream's prompt-cache behaviour is unknown from outside, so we
|
|
139
|
+
// don't declare support (no `prompt_cache_key` header is written).
|
|
140
|
+
// Flip to `supportsCacheControl: true` once the gateway is verified
|
|
141
|
+
// to honour stable prompt caching.
|
|
142
|
+
medalsoft: {},
|
|
112
143
|
"vscode-builtin": {}
|
|
113
144
|
};
|
|
114
145
|
function isProviderCacheControlAware(type) {
|
|
@@ -169,20 +200,20 @@ var PRIMARY_METADATA = {
|
|
|
169
200
|
detail: "Fast, general-purpose model",
|
|
170
201
|
imageInput: true,
|
|
171
202
|
toolCalling: true,
|
|
172
|
-
// Per https://api-docs.deepseek.com/quick_start/pricing
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
//
|
|
177
|
-
// 14:00–18:00 Beijing)
|
|
178
|
-
//
|
|
179
|
-
//
|
|
180
|
-
//
|
|
181
|
-
//
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
pricingUSD: { input: 0.
|
|
185
|
-
pricingCNY: { input:
|
|
203
|
+
// Per https://api-docs.deepseek.com/zh-cn/quick_start/pricing
|
|
204
|
+
// (re-fetched 2026-08-20): peak/off-peak tiered pricing since
|
|
205
|
+
// the 2026-08-17 调价. Pinned the PEAK rate (2026-08-20 product
|
|
206
|
+
// decision — user request): DeepSeek is surfaced as a CNY
|
|
207
|
+
// provider for China accounts, whose working hours
|
|
208
|
+
// (09:00–12:00 + 14:00–18:00 Beijing) fall entirely inside
|
|
209
|
+
// the peak window — peak is the conservative worst-case
|
|
210
|
+
// estimate (cost never exceeds it; off-peak turns are billed
|
|
211
|
+
// at exactly half).
|
|
212
|
+
// Peak: $0.014 cache hit / $0.44 input / $1.32 output
|
|
213
|
+
// ¥0.1 cache hit / ¥3 input / ¥9 output
|
|
214
|
+
// Off-peak: exactly 1/2 of peak (¥1.5 / ¥4.5 / ¥0.05).
|
|
215
|
+
pricingUSD: { input: 0.44, output: 1.32, cacheRead: 0.014 },
|
|
216
|
+
pricingCNY: { input: 3, output: 9, cacheRead: 0.1 },
|
|
186
217
|
priceCategory: "low",
|
|
187
218
|
// Official docs (api-docs.deepseek.com/quick_start/pricing, fetched
|
|
188
219
|
// 2026-07-27): "THINKING MODE: Supports both non-thinking and
|
|
@@ -198,20 +229,13 @@ var PRIMARY_METADATA = {
|
|
|
198
229
|
detail: "Most capable reasoning model",
|
|
199
230
|
imageInput: true,
|
|
200
231
|
toolCalling: true,
|
|
201
|
-
//
|
|
202
|
-
//
|
|
203
|
-
//
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
|
|
207
|
-
|
|
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 },
|
|
232
|
+
// Same source + same PEAK-tier decision as deepseek-v4-flash
|
|
233
|
+
// (2026-08-20): conservative worst-case estimate; off-peak is
|
|
234
|
+
// exactly half (¥4.5 / ¥13.5 / ¥0.15).
|
|
235
|
+
// Peak: $0.044 cache hit / $1.32 input / $3.96 output
|
|
236
|
+
// ¥0.3 cache hit / ¥9 input / ¥27 output
|
|
237
|
+
pricingUSD: { input: 1.32, output: 3.96, cacheRead: 0.044 },
|
|
238
|
+
pricingCNY: { input: 9, output: 27, cacheRead: 0.3 },
|
|
215
239
|
priceCategory: "low",
|
|
216
240
|
thinkingSchema: "thinkingEnabled",
|
|
217
241
|
maxInputTokens: 655360,
|
|
@@ -254,6 +278,44 @@ var PRIMARY_METADATA = {
|
|
|
254
278
|
maxInputTokens: 934976,
|
|
255
279
|
maxOutputTokens: 65536
|
|
256
280
|
},
|
|
281
|
+
"agnes-2.5-pro": {
|
|
282
|
+
detail: "Paid reasoning model \u2014 commercial stable of 2.5 Pro Alpha (advanced coding, scientific reasoning, long context, multimodal). 1M context / 65K max output",
|
|
283
|
+
imageInput: true,
|
|
284
|
+
toolCalling: true,
|
|
285
|
+
// Official pricing per https://wiki.agnes-ai.com/en/docs/agnes-25-pro.md
|
|
286
|
+
// (fetched 2026-08-19) — identical to 2.5 Pro Alpha:
|
|
287
|
+
// $0.45 input / $0.0038 cache read / $0.90 output per 1M tokens.
|
|
288
|
+
// No separate CNY tier is published, so pricingCNY mirrors USD.
|
|
289
|
+
pricingUSD: { input: 0.45, output: 0.9, cacheRead: 38e-4 },
|
|
290
|
+
pricingCNY: { input: 0.45, output: 0.9, cacheRead: 38e-4 },
|
|
291
|
+
priceCategory: "medium",
|
|
292
|
+
// Same binary Thinking on/off switch as the other Agnes models
|
|
293
|
+
// (`chat_template_kwargs.enable_thinking` on the OpenAI wire).
|
|
294
|
+
thinkingSchema: "thinkingEnabled",
|
|
295
|
+
// Same published window as 2.5 Pro Alpha: 1M context /
|
|
296
|
+
// 65536 max output — input cap mirrors the alpha entry.
|
|
297
|
+
maxInputTokens: 934976,
|
|
298
|
+
maxOutputTokens: 65536
|
|
299
|
+
},
|
|
300
|
+
"agnes-2.5-flash": {
|
|
301
|
+
detail: "GA upgrade of Agnes 2.0 Flash \u2014 stronger coding, agent workflows, tool calling, image understanding (512K context)",
|
|
302
|
+
imageInput: true,
|
|
303
|
+
toolCalling: true,
|
|
304
|
+
// Standard (post-promo) pricing per
|
|
305
|
+
// https://wiki.agnes-ai.com/en/docs/agnes-25-flash.md (fetched
|
|
306
|
+
// 2026-08-19) — same list price as 2.0 Flash ($0.03 / $0.15 per
|
|
307
|
+
// 1M tokens); the temporary $0 / $0 promo is ignored per the
|
|
308
|
+
// same policy as the 2.0 Flash entry. No separate CNY tier is
|
|
309
|
+
// published, so pricingCNY mirrors the USD numbers.
|
|
310
|
+
pricingUSD: { input: 0.03, output: 0.15, cacheRead: null },
|
|
311
|
+
pricingCNY: { input: 0.03, output: 0.15, cacheRead: null },
|
|
312
|
+
priceCategory: "low",
|
|
313
|
+
// Same binary Thinking on/off switch as 2.0 Flash
|
|
314
|
+
// (`chat_template_kwargs.enable_thinking` on the OpenAI wire).
|
|
315
|
+
thinkingSchema: "thinkingEnabled",
|
|
316
|
+
maxInputTokens: 512e3,
|
|
317
|
+
maxOutputTokens: 65536
|
|
318
|
+
},
|
|
257
319
|
// ── Kimi (月之暗面 / Moonshot AI) ────────────────────────────────
|
|
258
320
|
// Source: https://platform.kimi.com/docs/pricing/chat-k3,
|
|
259
321
|
// chat-k27-code, chat-k26 (fetched 2026-07-27). Prices are per 1M
|
|
@@ -342,6 +404,13 @@ var PRIMARY_METADATA = {
|
|
|
342
404
|
detail: "GLM-5.2 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF08\u5355\u6863 pricing\uFF09",
|
|
343
405
|
imageInput: false,
|
|
344
406
|
toolCalling: true,
|
|
407
|
+
// Thinking-mode dropdown + `reasoning_effort`. Zhipu official
|
|
408
|
+
// OpenAPI (fetched 2026-08-19): "仅 GLM-5.2 及其以上模型支持"
|
|
409
|
+
// reasoning_effort; for 5.2 the server maps none/minimal → give
|
|
410
|
+
// up thinking, low/medium → high, xhigh → max (we only send the
|
|
411
|
+
// native high/max so no client-side aliasing is needed).
|
|
412
|
+
thinkingSchema: "reasoningEffort",
|
|
413
|
+
supportsReasoningEffort: true,
|
|
345
414
|
// Single rate (no input-length tier split) per
|
|
346
415
|
// bigmodel.cn/pricing 2026-08-18:
|
|
347
416
|
// ¥8 input / ¥28 output / ¥2 cache hit per 1M tokens
|
|
@@ -363,12 +432,23 @@ var PRIMARY_METADATA = {
|
|
|
363
432
|
detail: "GLM-5.3 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u540E\u8BAD\u7EC3\u589E\u5F3A\u4EE3\u7801 / \u7F51\u7EDC\u5B89\u5168",
|
|
364
433
|
imageInput: false,
|
|
365
434
|
toolCalling: true,
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
//
|
|
369
|
-
//
|
|
370
|
-
|
|
371
|
-
|
|
435
|
+
// Thinking-mode dropdown (思考模式 停用/标准/深度) + the
|
|
436
|
+
// `reasoning_effort` field. Zhipu official OpenAPI (fetched
|
|
437
|
+
// 2026-08-19): GLM-5.3 restricts `thinking.type` to "enabled"
|
|
438
|
+
// and controls depth via `reasoning_effort` (low/high/max
|
|
439
|
+
// only). Mirrors `supportsReasoningEffort: true` in
|
|
440
|
+
// `docs/references/GLM-for-copilot-main/src/consts.ts`.
|
|
441
|
+
thinkingSchema: "reasoningEffort",
|
|
442
|
+
supportsReasoningEffort: true,
|
|
443
|
+
// Vendor pricing (corrected 2026-08-20): bigmodel.cn/pricing
|
|
444
|
+
// now lists GLM-5.3 at the SAME rate as GLM-5.2 —
|
|
445
|
+
// ¥8 input / ¥28 output / ¥2 cache hit per 1M tokens
|
|
446
|
+
// The previous CNY 10/31 was a mis-read of the Decrypt launch
|
|
447
|
+
// article (2026-08-14). USD comes from Z.ai's independently-
|
|
448
|
+
// set international list ($1.4 / $4.4 / $0.26 — not the ×0.14
|
|
449
|
+
// CNY mirror), matching the reference consts.ts USD block.
|
|
450
|
+
pricingUSD: { input: 1.4, output: 4.4, cacheRead: 0.26 },
|
|
451
|
+
pricingCNY: { input: 8, output: 28, cacheRead: 2 },
|
|
372
452
|
priceCategory: "high",
|
|
373
453
|
maxInputTokens: 1e6,
|
|
374
454
|
maxOutputTokens: 128e3
|
|
@@ -384,10 +464,14 @@ var PRIMARY_METADATA = {
|
|
|
384
464
|
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",
|
|
385
465
|
imageInput: false,
|
|
386
466
|
toolCalling: true,
|
|
467
|
+
// Thinking switch (no reasoning_effort — 5.1 < 5.2 threshold).
|
|
468
|
+
thinkingSchema: "reasoningEffort",
|
|
387
469
|
// Mirrors GLM-5.1 [0, 32K) tier per bigmodel.cn/pricing 2026-08-18.
|
|
388
470
|
// TileRT is a serving-side optim; the per-token rate is the same
|
|
389
|
-
// architecture as the base model.
|
|
390
|
-
|
|
471
|
+
// architecture as the base model. USD = the standard ×0.14 mirror
|
|
472
|
+
// of 6/24/1.3 (2026-08-20 — fixed a copy-paste slip that had
|
|
473
|
+
// cloned glm-4.6's 0.6/2.2/0.11 USD block here, a ×0.10 rate).
|
|
474
|
+
pricingUSD: { input: 0.84, output: 3.36, cacheRead: 0.182 },
|
|
391
475
|
pricingCNY: { input: 6, output: 24, cacheRead: 1.3 },
|
|
392
476
|
priceCategory: "medium",
|
|
393
477
|
maxInputTokens: 2e5,
|
|
@@ -403,6 +487,8 @@ var PRIMARY_METADATA = {
|
|
|
403
487
|
detail: "GLM-4.7 Flash \u2014 \u5B8C\u5168\u514D\u8D39\uFF08200K \u4E0A\u4E0B\u6587\uFF09",
|
|
404
488
|
imageInput: false,
|
|
405
489
|
toolCalling: true,
|
|
490
|
+
// Thinking switch (no reasoning_effort — 4.7 < 5.2 threshold).
|
|
491
|
+
thinkingSchema: "reasoningEffort",
|
|
406
492
|
// Free tier — input / output / cache hit all 0 (bigmodel.cn
|
|
407
493
|
// 2026-08-18 lists "免费" for every column). USD mirrors CNY
|
|
408
494
|
// rather than inventing a rate.
|
|
@@ -416,6 +502,9 @@ var PRIMARY_METADATA = {
|
|
|
416
502
|
detail: "GLM-4.7 \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u5DE5\u5177\u8C03\u7528\uFF083-tier pricing\uFF09",
|
|
417
503
|
imageInput: false,
|
|
418
504
|
toolCalling: true,
|
|
505
|
+
// Thinking switch (GLM-4.7 forces thinking when enabled per the
|
|
506
|
+
// official ChatThinking doc; no reasoning_effort — 4.7 < 5.2).
|
|
507
|
+
thinkingSchema: "reasoningEffort",
|
|
419
508
|
// Pinned the LOWEST tier per bigmodel.cn/pricing 2026-08-18:
|
|
420
509
|
// [0, 32K) input × [0, 0.2K) output — ¥2 / ¥8 / ¥0.4 cache hit
|
|
421
510
|
// [0, 32K) input × [0.2K+) output — ¥3 / ¥14 / ¥0.6 cache hit
|
|
@@ -433,6 +522,8 @@ var PRIMARY_METADATA = {
|
|
|
433
522
|
detail: "GLM-5.1 \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
434
523
|
imageInput: false,
|
|
435
524
|
toolCalling: true,
|
|
525
|
+
// Thinking switch (no reasoning_effort — 5.1 < 5.2 threshold).
|
|
526
|
+
thinkingSchema: "reasoningEffort",
|
|
436
527
|
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
437
528
|
// [0, 32K) — ¥6 input / ¥24 output / ¥1.3 cache hit
|
|
438
529
|
// [32K+) — ¥8 input / ¥28 output / ¥2 cache hit
|
|
@@ -448,6 +539,8 @@ var PRIMARY_METADATA = {
|
|
|
448
539
|
detail: "GLM-5 \u2014 200K \u4E0A\u4E0B\u6587\uFF0CAgentic \u5DE5\u5177\u8C03\u7528\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
449
540
|
imageInput: false,
|
|
450
541
|
toolCalling: true,
|
|
542
|
+
// Thinking switch (no reasoning_effort — 5 < 5.2 threshold).
|
|
543
|
+
thinkingSchema: "reasoningEffort",
|
|
451
544
|
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
452
545
|
// [0, 32K) — ¥4 input / ¥18 output / ¥1 cache hit
|
|
453
546
|
// [32K+) — ¥6 input / ¥22 output / ¥1.5 cache hit
|
|
@@ -461,6 +554,9 @@ var PRIMARY_METADATA = {
|
|
|
461
554
|
detail: "GLM-5 Turbo \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
462
555
|
imageInput: false,
|
|
463
556
|
toolCalling: true,
|
|
557
|
+
// Thinking switch (listed in the official ChatThinking doc's
|
|
558
|
+
// auto-think family; no reasoning_effort — 5-Turbo < 5.2).
|
|
559
|
+
thinkingSchema: "reasoningEffort",
|
|
464
560
|
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
465
561
|
// [0, 32K) — ¥5 input / ¥22 output / ¥1.2 cache hit
|
|
466
562
|
// [32K+) — ¥7 input / ¥26 output / ¥1.8 cache hit
|
|
@@ -474,6 +570,8 @@ var PRIMARY_METADATA = {
|
|
|
474
570
|
detail: "GLM-4.7 FlashX \u2014 \u5FEB\u901F\u7248",
|
|
475
571
|
imageInput: false,
|
|
476
572
|
toolCalling: false,
|
|
573
|
+
// Thinking switch (4.7 family; no reasoning_effort).
|
|
574
|
+
thinkingSchema: "reasoningEffort",
|
|
477
575
|
// ¥0.5 input / ¥3 output / ¥0.1 cache hit per 1M tokens
|
|
478
576
|
pricingUSD: { input: 0.07, output: 0.42, cacheRead: 0.014 },
|
|
479
577
|
pricingCNY: { input: 0.5, output: 3, cacheRead: 0.1 },
|
|
@@ -485,6 +583,9 @@ var PRIMARY_METADATA = {
|
|
|
485
583
|
detail: "GLM-4.6 \u2014 \u5DE5\u5177\u8C03\u7528",
|
|
486
584
|
imageInput: false,
|
|
487
585
|
toolCalling: true,
|
|
586
|
+
// Thinking switch (auto-think family per the official
|
|
587
|
+
// ChatThinking doc; no reasoning_effort — 4.6 < 5.2).
|
|
588
|
+
thinkingSchema: "reasoningEffort",
|
|
488
589
|
pricingUSD: { input: 0.6, output: 2.2, cacheRead: 0.11 },
|
|
489
590
|
pricingCNY: { input: 4.3, output: 15.7, cacheRead: 0.79 },
|
|
490
591
|
priceCategory: "medium",
|
|
@@ -506,6 +607,9 @@ var PRIMARY_METADATA = {
|
|
|
506
607
|
detail: "GLM-4.5 \u2014 \u5DE5\u5177\u8C03\u7528\uFF08\u88F8\u540D\uFF1BZhipu /v1/models \u66B4\u9732\u7684 legacy alias\uFF09",
|
|
507
608
|
imageInput: false,
|
|
508
609
|
toolCalling: true,
|
|
610
|
+
// Thinking switch (4.5 generation is the thinking-param floor
|
|
611
|
+
// per the official ChatThinking doc; no reasoning_effort).
|
|
612
|
+
thinkingSchema: "reasoningEffort",
|
|
509
613
|
pricingUSD: { input: 0, output: 0, cacheRead: null },
|
|
510
614
|
pricingCNY: { input: 0, output: 0, cacheRead: null },
|
|
511
615
|
priceCategory: "low",
|
|
@@ -516,6 +620,8 @@ var PRIMARY_METADATA = {
|
|
|
516
620
|
detail: "GLM-4.5 Air \u2014 \u5DE5\u5177\u8C03\u7528\uFF083-tier pricing\uFF09",
|
|
517
621
|
imageInput: false,
|
|
518
622
|
toolCalling: true,
|
|
623
|
+
// Thinking switch (4.5 family; no reasoning_effort).
|
|
624
|
+
thinkingSchema: "reasoningEffort",
|
|
519
625
|
// Pinned the LOWEST tier per bigmodel.cn/pricing 2026-08-18:
|
|
520
626
|
// [0, 32K) × [0, 0.2K) output — ¥0.8 / ¥2 / ¥0.16 cache hit
|
|
521
627
|
// [0, 32K) × [0.2K+) output — ¥0.8 / ¥6 / ¥0.16 cache hit
|
|
@@ -532,6 +638,8 @@ var PRIMARY_METADATA = {
|
|
|
532
638
|
detail: "GLM-4.5 AirX \u2014 \u5FEB\u901F\u7248\uFF08\xA510/M \u5355\u6863\uFF09",
|
|
533
639
|
imageInput: false,
|
|
534
640
|
toolCalling: false,
|
|
641
|
+
// Thinking switch (4.5 family; no reasoning_effort).
|
|
642
|
+
thinkingSchema: "reasoningEffort",
|
|
535
643
|
// ¥10 / M tokens (single rate, input == output) per
|
|
536
644
|
// bigmodel.cn/pricing 2026-08-18 — listed under the "模型推理
|
|
537
645
|
// → Language Models" sub-tab, NOT the flagship text section.
|
|
@@ -580,6 +688,9 @@ var PRIMARY_METADATA = {
|
|
|
580
688
|
detail: "GLM-4.5V \u89C6\u89C9\u63A8\u7406\u6A21\u578B \u2014 \u56FE\u50CF/\u89C6\u9891/\u6587\u6863/GUI\uFF082-tier pricing\uFF09",
|
|
581
689
|
imageInput: true,
|
|
582
690
|
toolCalling: true,
|
|
691
|
+
// Thinking switch (official ChatThinking doc: GLM-4.5V 为强制
|
|
692
|
+
// 思考 when enabled; no reasoning_effort).
|
|
693
|
+
thinkingSchema: "reasoningEffort",
|
|
583
694
|
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
584
695
|
// [0, 32K) — ¥2 input / ¥6 output / ¥0.4 cache hit
|
|
585
696
|
// [32, 64K) — ¥4 input / ¥12 output / ¥0.8 cache hit
|
|
@@ -589,10 +700,103 @@ var PRIMARY_METADATA = {
|
|
|
589
700
|
maxInputTokens: 64e3,
|
|
590
701
|
maxOutputTokens: 8192
|
|
591
702
|
},
|
|
703
|
+
// GLM-4.6V (2026 H1) — 视觉推理模型 (paid version, 2-tier
|
|
704
|
+
// pricing). Distinct from `glm-4.6v-flash` (免费版, 0/0/0) and
|
|
705
|
+
// `glm-4.6v-flashx` (快速版, ¥0.15/¥1.5/¥0.03). Per
|
|
706
|
+
// bigmodel.cn/pricing 2026-08-18 (the same snapshot the
|
|
707
|
+
// §7 table in `byom-glm-learnings.md` was sourced from, where
|
|
708
|
+
// this row was first documented but never landed in
|
|
709
|
+
// MODEL_METADATA until 2026-08-19):
|
|
710
|
+
// [0, 32K) — ¥1 input / ¥3 output / ¥0.2 cache hit
|
|
711
|
+
// [32, 128K) — ¥2 input / ¥6 output / ¥0.4 cache hit
|
|
712
|
+
// The lower tier is pinned per the project's "multi-tier →
|
|
713
|
+
// lowest tier" convention (most prompts < 32K input × < 0.2K
|
|
714
|
+
// output). 4.6V sits between glm-4.5v (¥2/¥6/¥0.4) and the
|
|
715
|
+
// flashx variant — the 4.6 generation is meaningfully cheaper
|
|
716
|
+
// per the 2026 mid-year price reset.
|
|
717
|
+
"glm-4.6v": {
|
|
718
|
+
detail: "GLM-4.6V \u89C6\u89C9\u63A8\u7406\u6A21\u578B \u2014 \u56FE\u50CF/\u89C6\u9891/\u6587\u6863/GUI\uFF082-tier pricing\uFF09",
|
|
719
|
+
imageInput: true,
|
|
720
|
+
toolCalling: true,
|
|
721
|
+
// Thinking switch (same auto-think family as glm-4.5v;
|
|
722
|
+
// 4.6 < 5.2 threshold, so no reasoning_effort).
|
|
723
|
+
thinkingSchema: "reasoningEffort",
|
|
724
|
+
// Pinned the LOWER tier [0, 32K) per bigmodel.cn/pricing
|
|
725
|
+
// 2026-08-18. USD mirrors the CNY/7 ratio with 2-decimal
|
|
726
|
+
// rounding (matches glm-4.5v's USD rounding style).
|
|
727
|
+
pricingUSD: { input: 0.14, output: 0.42, cacheRead: 0.028 },
|
|
728
|
+
pricingCNY: { input: 1, output: 3, cacheRead: 0.2 },
|
|
729
|
+
// Tier boundary is 128K (vs glm-4.5v's 64K), so a
|
|
730
|
+
// `medium` tier tag is still appropriate — the 4.6V is
|
|
731
|
+
// cheaper than glm-4.5v but not a "low" tier like the
|
|
732
|
+
// 0.5/3/0.1 flashx family.
|
|
733
|
+
priceCategory: "medium",
|
|
734
|
+
maxInputTokens: 128e3,
|
|
735
|
+
maxOutputTokens: 8192
|
|
736
|
+
},
|
|
737
|
+
// GLM-4.6V-Flash — the FULLY-FREE vision model on
|
|
738
|
+
// bigmodel.cn/pricing's 视觉理解 tab (every column 免费,
|
|
739
|
+
// 2026-08-18 snapshot). This is the exact model the GLM-for-
|
|
740
|
+
// copilot reference uses as its transparent vision proxy
|
|
741
|
+
// (`DEFAULT_GLM_VISION_MODEL_ID` in its consts.ts — "the
|
|
742
|
+
// extension accepts images for text models through the
|
|
743
|
+
// GLM-4.6V-Flash vision proxy"). Zero cost makes it the
|
|
744
|
+
// natural candidate for our future ProxyVisionAdapter (v2).
|
|
745
|
+
// Token caps mirror the reference's entry (96K input + 32K
|
|
746
|
+
// output = the 128K shared window). Not in the zhipu preset —
|
|
747
|
+
// multimodal models aren't exposed via the public
|
|
748
|
+
// `/v1/chat/completions` models list (same trim rationale as
|
|
749
|
+
// glm-5v-turbo / glm-4.5v); users add it by hand.
|
|
750
|
+
"glm-4.6v-flash": {
|
|
751
|
+
detail: "GLM-4.6V Flash \u2014 \u5B8C\u5168\u514D\u8D39\u89C6\u89C9\u7406\u89E3\u6A21\u578B",
|
|
752
|
+
imageInput: true,
|
|
753
|
+
// Reference consts.ts declares GLM_TOOLS_LIMIT (128) tool
|
|
754
|
+
// calling for this model — the flash vision tier keeps the
|
|
755
|
+
// full function-call surface.
|
|
756
|
+
toolCalling: true,
|
|
757
|
+
// Thinking switch (auto-think family per the reference's
|
|
758
|
+
// `requiresThinkingParam: true`; no reasoning_effort —
|
|
759
|
+
// 4.6 < 5.2 threshold).
|
|
760
|
+
thinkingSchema: "reasoningEffort",
|
|
761
|
+
// Free tier — input / output / cache hit all 0 per
|
|
762
|
+
// bigmodel.cn 2026-08-18. USD mirrors CNY at 0 rather than
|
|
763
|
+
// inventing a rate.
|
|
764
|
+
pricingUSD: { input: 0, output: 0, cacheRead: 0 },
|
|
765
|
+
pricingCNY: { input: 0, output: 0, cacheRead: 0 },
|
|
766
|
+
priceCategory: "low",
|
|
767
|
+
maxInputTokens: 98304,
|
|
768
|
+
maxOutputTokens: 32768
|
|
769
|
+
},
|
|
770
|
+
// GLM-4.6V-FlashX — the 快速版 (quick) paid sibling of the free
|
|
771
|
+
// glm-4.6v-flash. Per bigmodel.cn/pricing 视觉理解 tab
|
|
772
|
+
// (2026-08-18):
|
|
773
|
+
// [0, 32K) — ¥0.15 input / ¥1.5 output / ¥0.03 cache hit
|
|
774
|
+
// [32K, 128K) — ¥0.3 input / ¥3 output / ¥0.03 cache hit
|
|
775
|
+
// The LOWER tier is pinned per the project's multi-tier
|
|
776
|
+
// convention. Not in the zhipu preset (same multimodal trim
|
|
777
|
+
// rationale as glm-4.6v-flash). Token caps are a best-guess
|
|
778
|
+
// from sibling glm-4.6v (128K context / 8K output) — Zhipu
|
|
779
|
+
// publishes no dedicated spec for the flashx vision tier.
|
|
780
|
+
"glm-4.6v-flashx": {
|
|
781
|
+
detail: "GLM-4.6V FlashX \u2014 \u5FEB\u901F\u7248\u89C6\u89C9\u7406\u89E3\uFF082-tier pricing\uFF09",
|
|
782
|
+
imageInput: true,
|
|
783
|
+
// 快速版 convention: the flashx siblings (glm-4.7-flashx,
|
|
784
|
+
// glm-4.5-airx) drop tool calling.
|
|
785
|
+
toolCalling: false,
|
|
786
|
+
thinkingSchema: "reasoningEffort",
|
|
787
|
+
pricingUSD: { input: 0.021, output: 0.21, cacheRead: 42e-4 },
|
|
788
|
+
pricingCNY: { input: 0.15, output: 1.5, cacheRead: 0.03 },
|
|
789
|
+
priceCategory: "low",
|
|
790
|
+
maxInputTokens: 128e3,
|
|
791
|
+
maxOutputTokens: 8192
|
|
792
|
+
},
|
|
592
793
|
"glm-5v-turbo": {
|
|
593
794
|
detail: "GLM-5V Turbo \u2014 \u591A\u6A21\u6001 Coding \u6A21\u578B\uFF082-tier pricing\uFF09",
|
|
594
795
|
imageInput: true,
|
|
595
796
|
toolCalling: true,
|
|
797
|
+
// Thinking switch (listed in the official ChatThinking doc's
|
|
798
|
+
// auto-think family; no reasoning_effort).
|
|
799
|
+
thinkingSchema: "reasoningEffort",
|
|
596
800
|
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
597
801
|
// [0, 32K) — ¥5 input / ¥22 output / ¥1.2 cache hit
|
|
598
802
|
// [32K+) — ¥7 input / ¥26 output / ¥1.8 cache hit
|
|
@@ -738,9 +942,13 @@ var PRIMARY_METADATA = {
|
|
|
738
942
|
detail: "Qwen3.6-35B-A3B \u2014 35B MoE (3B \u6FC0\u6D3B)\uFF0C\u601D\u8003/\u975E\u601D\u8003\u53CC\u6A21\uFF0C256K \u4E0A\u4E0B\u6587",
|
|
739
943
|
imageInput: true,
|
|
740
944
|
toolCalling: true,
|
|
741
|
-
// SiliconFlow
|
|
742
|
-
|
|
743
|
-
|
|
945
|
+
// SiliconFlow 官方价格页(https://siliconflow.cn/pricing,
|
|
946
|
+
// re-fetched 2026-08-20):¥1.8 input / ¥10.8 output per 1M
|
|
947
|
+
// tokens,无缓存价格列。此前 ¥1.6/¥12.8 来自发布新闻稿,
|
|
948
|
+
// 已过时(输入上调、输出下调)。USD = CNY ÷7 镜像取两位
|
|
949
|
+
// 小数(0.26 / 1.54)。
|
|
950
|
+
pricingUSD: { input: 0.26, output: 1.54, cacheRead: null },
|
|
951
|
+
pricingCNY: { input: 1.8, output: 10.8, cacheRead: null },
|
|
744
952
|
priceCategory: "low",
|
|
745
953
|
// Qwen3.6-35B-A3B 官方 256K context;output 上限按同代 27B
|
|
746
954
|
// 同样 32K 取值(Qwen3.6 系列 max output 未单独公布)。
|
|
@@ -771,6 +979,20 @@ var NAMESPACE_ALIASES = {
|
|
|
771
979
|
// from the curated detail / pricing / capability columns.
|
|
772
980
|
"glm-4-flashx-250414": "glm-4-flashx"
|
|
773
981
|
};
|
|
982
|
+
var NAMESPACE_ALIAS_FAMILY = {
|
|
983
|
+
// SiliconFlow
|
|
984
|
+
"deepseek-ai/DeepSeek-V4-Pro": "SiliconFlow (aggregator)",
|
|
985
|
+
"deepseek-ai/DeepSeek-V4-Flash": "SiliconFlow (aggregator)",
|
|
986
|
+
"zai-org/GLM-5.2": "SiliconFlow (aggregator)",
|
|
987
|
+
"Qwen/Qwen3.6-35B-A3B": "SiliconFlow (aggregator)",
|
|
988
|
+
"moonshotai/Kimi-K2.7-Code": "SiliconFlow (aggregator)",
|
|
989
|
+
// Novita
|
|
990
|
+
"deepseek/deepseek-v4-pro": "Novita (aggregator)",
|
|
991
|
+
"deepseek/deepseek-v4-flash": "Novita (aggregator)",
|
|
992
|
+
"zai/glm-5.2": "Novita (aggregator)",
|
|
993
|
+
"zai/glm-5.1": "Novita (aggregator)",
|
|
994
|
+
"moonshotai/kimi-k3": "Novita (aggregator)"
|
|
995
|
+
};
|
|
774
996
|
var MODEL_METADATA = (() => {
|
|
775
997
|
const merged = {
|
|
776
998
|
...PRIMARY_METADATA
|
|
@@ -789,14 +1011,26 @@ function lookupModelMetadata(modelId) {
|
|
|
789
1011
|
function currencyForBaseUrl(baseUrl) {
|
|
790
1012
|
try {
|
|
791
1013
|
const hostname = new URL(baseUrl).hostname.toLowerCase();
|
|
792
|
-
if (hostname === "api.minimaxi.com" || hostname === "api.minimaxi.cn" || hostname === "api.
|
|
1014
|
+
if (hostname === "api.minimaxi.com" || hostname === "api.minimaxi.cn" || hostname === "api.moonshot.cn" || hostname === "open.bigmodel.cn" || // Zhipu legacy v3 host. Per the GLM-for-copilot reference
|
|
793
1015
|
// (`docs/references/GLM-for-copilot-main/src/endpoint.ts:4`)
|
|
794
1016
|
// this was retired to `bigmodel.cn` but is still
|
|
795
1017
|
// resolvable for accounts that haven't migrated — we
|
|
796
1018
|
// don't surface it in the baseUrl dropdown, but a user
|
|
797
1019
|
// may paste it from a saved settings.json, so the
|
|
798
1020
|
// currency has to match (CNY, same as the new host).
|
|
799
|
-
hostname === "dev.bigmodel.cn")
|
|
1021
|
+
hostname === "dev.bigmodel.cn" || // DeepSeek — 2026-08-20 product decision (user request):
|
|
1022
|
+
// surface the domestic ¥ prices. The `.com` endpoint
|
|
1023
|
+
// serves both regions, but our user base bills in CNY on
|
|
1024
|
+
// it (the official zh-cn pricing page publishes the ¥
|
|
1025
|
+
// table for this endpoint), so the picker now shows the
|
|
1026
|
+
// CNY block. This REVERSES the 2026-08-19 mapping that
|
|
1027
|
+
// left it in the USD catch-all ("$ block corresponds to
|
|
1028
|
+
// the .com endpoint") — with a CNY-billed user base, the
|
|
1029
|
+
// ¥ block is the relevant one. The pricingCNY block in
|
|
1030
|
+
// MODEL_METADATA pins the PEAK tier for these entries
|
|
1031
|
+
// (conservative worst-case; see the deepseek-v4-flash
|
|
1032
|
+
// comment).
|
|
1033
|
+
hostname === "api.deepseek.com") {
|
|
800
1034
|
return "CNY";
|
|
801
1035
|
}
|
|
802
1036
|
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
|
|
@@ -819,13 +1053,14 @@ function currencyForBaseUrl(baseUrl) {
|
|
|
819
1053
|
}
|
|
820
1054
|
|
|
821
1055
|
// src/ai/providers.presets.ts
|
|
822
|
-
function buildPresetModel(id, displayName) {
|
|
1056
|
+
function buildPresetModel(id, displayName, baseUrl) {
|
|
823
1057
|
const meta = MODEL_METADATA[id];
|
|
824
1058
|
if (!meta) {
|
|
825
1059
|
throw new Error(
|
|
826
1060
|
`buildPresetModel: no curated MODEL_METADATA entry for '${id}' \u2014 add one before referencing it from BUILTIN_PROVIDER_PRESETS.`
|
|
827
1061
|
);
|
|
828
1062
|
}
|
|
1063
|
+
const currency = baseUrl ? currencyForBaseUrl(baseUrl) : "USD";
|
|
829
1064
|
return {
|
|
830
1065
|
id,
|
|
831
1066
|
displayName,
|
|
@@ -836,11 +1071,95 @@ function buildPresetModel(id, displayName) {
|
|
|
836
1071
|
supportsImageToText: meta.imageInput,
|
|
837
1072
|
supportsToolCalling: meta.toolCalling
|
|
838
1073
|
},
|
|
839
|
-
pricing: meta
|
|
1074
|
+
pricing: meta[`pricing${currency}`],
|
|
840
1075
|
priceCategory: meta.priceCategory,
|
|
841
1076
|
thinkingSchema: meta.thinkingSchema ?? "none"
|
|
842
1077
|
};
|
|
843
1078
|
}
|
|
1079
|
+
function unionProviderModelWithPreset(fetched, baseUrl) {
|
|
1080
|
+
const meta = MODEL_METADATA[fetched.id];
|
|
1081
|
+
if (!meta) {
|
|
1082
|
+
return fetched;
|
|
1083
|
+
}
|
|
1084
|
+
const currency = baseUrl ? currencyForBaseUrl(baseUrl) : "USD";
|
|
1085
|
+
const presetDisplayName = getPresetModelDisplayName(fetched.id);
|
|
1086
|
+
const displayName = typeof fetched.displayName === "string" && fetched.displayName.length > 0 ? fetched.displayName : presetDisplayName;
|
|
1087
|
+
return {
|
|
1088
|
+
// Spread fetched first so `id` wins, then overlay the
|
|
1089
|
+
// curated fields. (Curated fields ALWAYS win over fetched
|
|
1090
|
+
// per the precedence above — that's why they're explicit,
|
|
1091
|
+
// not relying on spread order.)
|
|
1092
|
+
...fetched,
|
|
1093
|
+
displayName,
|
|
1094
|
+
detail: meta.detail,
|
|
1095
|
+
capabilities: {
|
|
1096
|
+
supportsImageToText: meta.imageInput,
|
|
1097
|
+
supportsToolCalling: meta.toolCalling
|
|
1098
|
+
},
|
|
1099
|
+
pricing: meta[`pricing${currency}`],
|
|
1100
|
+
priceCategory: meta.priceCategory,
|
|
1101
|
+
// thinkingSchema: prefer preset (curated), fall back to
|
|
1102
|
+
// fetched (in case the API publishes a schema the
|
|
1103
|
+
// preset doesn't know about), then "none" to match
|
|
1104
|
+
// `buildPresetModel`'s explicit-none convention so the
|
|
1105
|
+
// picker renders identically for preset vs fetched rows.
|
|
1106
|
+
thinkingSchema: meta.thinkingSchema ?? fetched.thinkingSchema ?? "none",
|
|
1107
|
+
// Token caps: preset is curated; if the preset doesn't
|
|
1108
|
+
// publish a cap, keep whatever fetched supplied (the
|
|
1109
|
+
// user may have entered it by hand earlier).
|
|
1110
|
+
maxInputTokens: meta.maxInputTokens ?? fetched.maxInputTokens,
|
|
1111
|
+
maxOutputTokens: meta.maxOutputTokens ?? fetched.maxOutputTokens
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
var PRESET_MODEL_FAMILIES = [
|
|
1115
|
+
"GLM",
|
|
1116
|
+
"DeepSeek",
|
|
1117
|
+
"Kimi",
|
|
1118
|
+
"StepFun",
|
|
1119
|
+
"MiniMax",
|
|
1120
|
+
"Agnes",
|
|
1121
|
+
"Qwen",
|
|
1122
|
+
"SiliconFlow (aggregator)",
|
|
1123
|
+
"Novita (aggregator)",
|
|
1124
|
+
"OpenRouter (aggregator)"
|
|
1125
|
+
];
|
|
1126
|
+
function vendorFamilyForId(id) {
|
|
1127
|
+
const aliasFamily = NAMESPACE_ALIAS_FAMILY[id];
|
|
1128
|
+
if (aliasFamily) return aliasFamily;
|
|
1129
|
+
if (id.startsWith("glm-")) return "GLM";
|
|
1130
|
+
if (id.startsWith("deepseek-")) return "DeepSeek";
|
|
1131
|
+
if (id.startsWith("kimi-")) return "Kimi";
|
|
1132
|
+
if (id.startsWith("step-")) return "StepFun";
|
|
1133
|
+
if (id.startsWith("MiniMax-")) return "MiniMax";
|
|
1134
|
+
if (id.startsWith("agnes-")) return "Agnes";
|
|
1135
|
+
if (id.startsWith("Qwen")) return "Qwen";
|
|
1136
|
+
if (id.startsWith("openrouter/")) return "OpenRouter (aggregator)";
|
|
1137
|
+
return "Other";
|
|
1138
|
+
}
|
|
1139
|
+
var LISTABLE_PRESET_MODELS = (() => {
|
|
1140
|
+
const aggregatorAliasKeys = new Set(Object.keys(NAMESPACE_ALIAS_FAMILY));
|
|
1141
|
+
const allIds = Object.keys(MODEL_METADATA).filter((id) => {
|
|
1142
|
+
if (NAMESPACE_ALIASES[id] === void 0) return true;
|
|
1143
|
+
return aggregatorAliasKeys.has(id);
|
|
1144
|
+
}).sort();
|
|
1145
|
+
return allIds.map((id) => ({
|
|
1146
|
+
id,
|
|
1147
|
+
displayName: id,
|
|
1148
|
+
vendorFamily: vendorFamilyForId(id)
|
|
1149
|
+
}));
|
|
1150
|
+
})();
|
|
1151
|
+
function listPresetModelGroups() {
|
|
1152
|
+
const byFamily = /* @__PURE__ */ new Map();
|
|
1153
|
+
for (const entry of LISTABLE_PRESET_MODELS) {
|
|
1154
|
+
const bucket = byFamily.get(entry.vendorFamily) ?? [];
|
|
1155
|
+
bucket.push(entry);
|
|
1156
|
+
byFamily.set(entry.vendorFamily, bucket);
|
|
1157
|
+
}
|
|
1158
|
+
return PRESET_MODEL_FAMILIES.filter((f) => byFamily.has(f)).map((family) => ({
|
|
1159
|
+
family,
|
|
1160
|
+
entries: byFamily.get(family) ?? []
|
|
1161
|
+
}));
|
|
1162
|
+
}
|
|
844
1163
|
var BUILTIN_PROVIDER_PRESETS = {
|
|
845
1164
|
minimax: {
|
|
846
1165
|
displayName: "MiniMax",
|
|
@@ -866,14 +1185,18 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
866
1185
|
// (otherwise the user's added model never shows up in the
|
|
867
1186
|
// Copilot Chat picker).
|
|
868
1187
|
models: [
|
|
869
|
-
buildPresetModel("MiniMax-M3", "MiniMax-M3"),
|
|
870
|
-
buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7"),
|
|
871
|
-
buildPresetModel(
|
|
1188
|
+
buildPresetModel("MiniMax-M3", "MiniMax-M3", "https://api.minimaxi.com/anthropic"),
|
|
1189
|
+
buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7", "https://api.minimaxi.com/anthropic"),
|
|
1190
|
+
buildPresetModel(
|
|
1191
|
+
"MiniMax-M2.7-highspeed",
|
|
1192
|
+
"MiniMax-M2.7-highspeed",
|
|
1193
|
+
"https://api.minimaxi.com/anthropic"
|
|
1194
|
+
),
|
|
872
1195
|
// M2.5 (2026-02-13, 80.2% SWE-Bench Verified) — the
|
|
873
1196
|
// predecessor of M2.7. Still in the catalog and often
|
|
874
1197
|
// available on MiniMax's promotional $0.30/$1.20 rate, so
|
|
875
1198
|
// keep it as a preset for users on the M2.5 plan tier.
|
|
876
|
-
buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5")
|
|
1199
|
+
buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5", "https://api.minimaxi.com/anthropic")
|
|
877
1200
|
]
|
|
878
1201
|
},
|
|
879
1202
|
deepseek: {
|
|
@@ -895,8 +1218,8 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
895
1218
|
// the recommended default — users still on V3 can override
|
|
896
1219
|
// these defaults in the ProvidersTab form.
|
|
897
1220
|
models: [
|
|
898
|
-
buildPresetModel("deepseek-v4-flash", "DeepSeek V4 Flash"),
|
|
899
|
-
buildPresetModel("deepseek-v4-pro", "DeepSeek V4 Pro")
|
|
1221
|
+
buildPresetModel("deepseek-v4-flash", "DeepSeek V4 Flash", "https://api.deepseek.com/v1"),
|
|
1222
|
+
buildPresetModel("deepseek-v4-pro", "DeepSeek V4 Pro", "https://api.deepseek.com/v1")
|
|
900
1223
|
]
|
|
901
1224
|
},
|
|
902
1225
|
agnes: {
|
|
@@ -904,19 +1227,34 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
904
1227
|
// Sapiens AI's Agnes — OpenAI-compatible endpoint per
|
|
905
1228
|
// https://wiki.agnes-ai.com (`POST /v1/chat/completions`).
|
|
906
1229
|
baseUrl: "https://apihub.agnes-ai.com/v1",
|
|
1230
|
+
// Order mirrors the vendor docs index (wiki.agnes-ai.com,
|
|
1231
|
+
// fetched 2026-08-19): paid reasoning models first — the
|
|
1232
|
+
// commercial stable `agnes-2.5-pro` leads, then the
|
|
1233
|
+
// benchmark-listed alpha — followed by the flash tier
|
|
1234
|
+
// newest-first.
|
|
907
1235
|
models: [
|
|
908
|
-
buildPresetModel("agnes-2.5-pro
|
|
909
|
-
buildPresetModel(
|
|
1236
|
+
buildPresetModel("agnes-2.5-pro", "Agnes 2.5 Pro", "https://apihub.agnes-ai.com/v1"),
|
|
1237
|
+
buildPresetModel(
|
|
1238
|
+
"agnes-2.5-pro-alpha",
|
|
1239
|
+
"Agnes 2.5 Pro Alpha",
|
|
1240
|
+
"https://apihub.agnes-ai.com/v1"
|
|
1241
|
+
),
|
|
1242
|
+
buildPresetModel("agnes-2.5-flash", "Agnes 2.5 Flash", "https://apihub.agnes-ai.com/v1"),
|
|
1243
|
+
buildPresetModel("agnes-2.0-flash", "Agnes 2.0 Flash", "https://apihub.agnes-ai.com/v1")
|
|
910
1244
|
]
|
|
911
1245
|
},
|
|
912
1246
|
kimi: {
|
|
913
1247
|
displayName: "Kimi",
|
|
914
1248
|
baseUrl: "https://api.moonshot.cn/v1",
|
|
915
1249
|
models: [
|
|
916
|
-
buildPresetModel("kimi-k3", "Kimi K3"),
|
|
917
|
-
buildPresetModel("kimi-k2.7-code", "Kimi K2.7 Code"),
|
|
918
|
-
buildPresetModel(
|
|
919
|
-
|
|
1250
|
+
buildPresetModel("kimi-k3", "Kimi K3", "https://api.moonshot.cn/v1"),
|
|
1251
|
+
buildPresetModel("kimi-k2.7-code", "Kimi K2.7 Code", "https://api.moonshot.cn/v1"),
|
|
1252
|
+
buildPresetModel(
|
|
1253
|
+
"kimi-k2.7-code-highspeed",
|
|
1254
|
+
"Kimi K2.7 Code HighSpeed",
|
|
1255
|
+
"https://api.moonshot.cn/v1"
|
|
1256
|
+
),
|
|
1257
|
+
buildPresetModel("kimi-k2.6", "Kimi K2.6", "https://api.moonshot.cn/v1")
|
|
920
1258
|
]
|
|
921
1259
|
},
|
|
922
1260
|
zhipu: {
|
|
@@ -988,24 +1326,28 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
988
1326
|
// `MODEL_METADATA` entries are kept so the id is still
|
|
989
1327
|
// resolvable for the curated detail / pricing columns.
|
|
990
1328
|
models: [
|
|
991
|
-
buildPresetModel("glm-5.3", "GLM-5.3"),
|
|
992
|
-
buildPresetModel("glm-5.2", "GLM-5.2"),
|
|
993
|
-
buildPresetModel("glm-5.1", "GLM-5.1"),
|
|
994
|
-
buildPresetModel("glm-5", "GLM-5"),
|
|
995
|
-
buildPresetModel("glm-5-turbo", "GLM-5 Turbo"),
|
|
996
|
-
buildPresetModel("glm-4.7", "GLM-4.7"),
|
|
997
|
-
buildPresetModel("glm-4.6", "GLM-4.6"),
|
|
998
|
-
buildPresetModel("glm-4.5-air", "GLM-4.5 Air"),
|
|
999
|
-
buildPresetModel("glm-4.5", "GLM-4.5")
|
|
1329
|
+
buildPresetModel("glm-5.3", "GLM-5.3", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1330
|
+
buildPresetModel("glm-5.2", "GLM-5.2", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1331
|
+
buildPresetModel("glm-5.1", "GLM-5.1", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1332
|
+
buildPresetModel("glm-5", "GLM-5", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1333
|
+
buildPresetModel("glm-5-turbo", "GLM-5 Turbo", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1334
|
+
buildPresetModel("glm-4.7", "GLM-4.7", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1335
|
+
buildPresetModel("glm-4.6", "GLM-4.6", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1336
|
+
buildPresetModel("glm-4.5-air", "GLM-4.5 Air", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1337
|
+
buildPresetModel("glm-4.5", "GLM-4.5", "https://open.bigmodel.cn/api/paas/v4")
|
|
1000
1338
|
]
|
|
1001
1339
|
},
|
|
1002
1340
|
stepfun: {
|
|
1003
1341
|
displayName: "StepFun",
|
|
1004
1342
|
baseUrl: "https://api.stepfun.com/v1",
|
|
1005
1343
|
models: [
|
|
1006
|
-
buildPresetModel("step-3.7-flash", "Step 3.7 Flash"),
|
|
1007
|
-
buildPresetModel("step-3.5-flash", "Step 3.5 Flash"),
|
|
1008
|
-
buildPresetModel(
|
|
1344
|
+
buildPresetModel("step-3.7-flash", "Step 3.7 Flash", "https://api.stepfun.com/v1"),
|
|
1345
|
+
buildPresetModel("step-3.5-flash", "Step 3.5 Flash", "https://api.stepfun.com/v1"),
|
|
1346
|
+
buildPresetModel(
|
|
1347
|
+
"step-1o-turbo-vision",
|
|
1348
|
+
"Step 1o Turbo Vision",
|
|
1349
|
+
"https://api.stepfun.com/v1"
|
|
1350
|
+
)
|
|
1009
1351
|
]
|
|
1010
1352
|
},
|
|
1011
1353
|
siliconflow: {
|
|
@@ -1019,20 +1361,42 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
1019
1361
|
// 与 MODEL_METADATA 的 alias 严格一致。
|
|
1020
1362
|
models: [
|
|
1021
1363
|
// DeepSeek V4 系列 (2026-04)
|
|
1022
|
-
buildPresetModel(
|
|
1023
|
-
|
|
1364
|
+
buildPresetModel(
|
|
1365
|
+
"deepseek-ai/DeepSeek-V4-Pro",
|
|
1366
|
+
"DeepSeek V4 Pro (via SiliconFlow)",
|
|
1367
|
+
"https://api.siliconflow.cn/v1"
|
|
1368
|
+
),
|
|
1369
|
+
buildPresetModel(
|
|
1370
|
+
"deepseek-ai/DeepSeek-V4-Flash",
|
|
1371
|
+
"DeepSeek V4 Flash (via SiliconFlow)",
|
|
1372
|
+
"https://api.siliconflow.cn/v1"
|
|
1373
|
+
),
|
|
1024
1374
|
// GLM-5.2 (2026-06-17) — open-weight 编程旗舰,1M context
|
|
1025
|
-
buildPresetModel(
|
|
1375
|
+
buildPresetModel(
|
|
1376
|
+
"zai-org/GLM-5.2",
|
|
1377
|
+
"GLM-5.2 (via SiliconFlow)",
|
|
1378
|
+
"https://api.siliconflow.cn/v1"
|
|
1379
|
+
),
|
|
1026
1380
|
// Qwen3.6-35B-A3B (2026-04) — 35B MoE, 3B 激活,"小而强"
|
|
1027
|
-
buildPresetModel(
|
|
1381
|
+
buildPresetModel(
|
|
1382
|
+
"Qwen/Qwen3.6-35B-A3B",
|
|
1383
|
+
"Qwen3.6-35B-A3B (via SiliconFlow)",
|
|
1384
|
+
"https://api.siliconflow.cn/v1"
|
|
1385
|
+
),
|
|
1028
1386
|
// Kimi K2.7-Code (2026-06-12) — Moonshot coding 旗舰
|
|
1029
|
-
buildPresetModel(
|
|
1387
|
+
buildPresetModel(
|
|
1388
|
+
"moonshotai/Kimi-K2.7-Code",
|
|
1389
|
+
"Kimi K2.7 Code (via SiliconFlow)",
|
|
1390
|
+
"https://api.siliconflow.cn/v1"
|
|
1391
|
+
)
|
|
1030
1392
|
]
|
|
1031
1393
|
},
|
|
1032
1394
|
openrouter: {
|
|
1033
1395
|
displayName: "OpenRouter",
|
|
1034
1396
|
baseUrl: "https://openrouter.ai/api/v1",
|
|
1035
|
-
models: [
|
|
1397
|
+
models: [
|
|
1398
|
+
buildPresetModel("openrouter/auto", "OpenRouter Auto", "https://openrouter.ai/api/v1")
|
|
1399
|
+
]
|
|
1036
1400
|
},
|
|
1037
1401
|
novita: {
|
|
1038
1402
|
displayName: "Novita",
|
|
@@ -1044,16 +1408,76 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
1044
1408
|
// 完整列表。id 严格匹配 Novita API 的 namespaced 字符串。
|
|
1045
1409
|
models: [
|
|
1046
1410
|
// DeepSeek V4 系列 (2026-04)
|
|
1047
|
-
buildPresetModel(
|
|
1048
|
-
|
|
1411
|
+
buildPresetModel(
|
|
1412
|
+
"deepseek/deepseek-v4-pro",
|
|
1413
|
+
"DeepSeek V4 Pro (via Novita)",
|
|
1414
|
+
"https://api.novita.ai/openai/v1"
|
|
1415
|
+
),
|
|
1416
|
+
buildPresetModel(
|
|
1417
|
+
"deepseek/deepseek-v4-flash",
|
|
1418
|
+
"DeepSeek V4 Flash (via Novita)",
|
|
1419
|
+
"https://api.novita.ai/openai/v1"
|
|
1420
|
+
),
|
|
1049
1421
|
// 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)"),
|
|
1422
|
+
buildPresetModel("zai/glm-5.2", "GLM-5.2 (via Novita)", "https://api.novita.ai/openai/v1"),
|
|
1423
|
+
buildPresetModel("zai/glm-5.1", "GLM-5.1 (via Novita)", "https://api.novita.ai/openai/v1"),
|
|
1052
1424
|
// Kimi K3 (2026-07-16 API, 2026-07-27 开源) — 1M context, 2.8T MoE
|
|
1053
|
-
buildPresetModel(
|
|
1425
|
+
buildPresetModel(
|
|
1426
|
+
"moonshotai/kimi-k3",
|
|
1427
|
+
"Kimi K3 (via Novita)",
|
|
1428
|
+
"https://api.novita.ai/openai/v1"
|
|
1429
|
+
)
|
|
1054
1430
|
]
|
|
1431
|
+
},
|
|
1432
|
+
medalsoft: {
|
|
1433
|
+
displayName: "Medalsoft",
|
|
1434
|
+
// Medalsoft internal LLM gateway (公司内部代理) — OpenAI-compatible
|
|
1435
|
+
// `/v1/chat/completions`. The gateway forwards to upstream vendors
|
|
1436
|
+
// (GLM / DeepSeek / Kimi / ...), so the model catalogue is dynamic
|
|
1437
|
+
// and NOT curated here: the preset ships an EMPTY starter list and
|
|
1438
|
+
// the user populates it via "Fetch from API" (`GET /v1/models`) in
|
|
1439
|
+
// the ProvidersTab. `buildPresetModel`'s fail-loudly contract is
|
|
1440
|
+
// why we don't guess ids — a curated `MODEL_METADATA` entry only
|
|
1441
|
+
// exists for vendor-native ids, not the gateway's routing table.
|
|
1442
|
+
//
|
|
1443
|
+
// NOTE: models fetched from the gateway carry the upstream model
|
|
1444
|
+
// ids, so the curated metadata (pricing / thinking dropdown /
|
|
1445
|
+
// token caps) still resolves via `MODEL_METADATA` after the fetch.
|
|
1446
|
+
baseUrl: "https://llm.proxy.alio.wang/v1",
|
|
1447
|
+
models: []
|
|
1055
1448
|
}
|
|
1056
1449
|
};
|
|
1450
|
+
var PRESET_MODEL_DISPLAY_NAMES = (() => {
|
|
1451
|
+
const map = {};
|
|
1452
|
+
for (const preset of Object.values(BUILTIN_PROVIDER_PRESETS)) {
|
|
1453
|
+
for (const model of preset.models) {
|
|
1454
|
+
if (model.displayName !== void 0) {
|
|
1455
|
+
map[model.id] = model.displayName;
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
return Object.freeze(map);
|
|
1460
|
+
})();
|
|
1461
|
+
function getPresetModelDisplayName(id) {
|
|
1462
|
+
const explicit = PRESET_MODEL_DISPLAY_NAMES[id];
|
|
1463
|
+
if (explicit !== void 0) {
|
|
1464
|
+
return explicit;
|
|
1465
|
+
}
|
|
1466
|
+
const meta = MODEL_METADATA[id];
|
|
1467
|
+
if (meta === void 0) {
|
|
1468
|
+
return void 0;
|
|
1469
|
+
}
|
|
1470
|
+
const detail = meta.detail;
|
|
1471
|
+
if (typeof detail !== "string" || detail.trim() === "") {
|
|
1472
|
+
return void 0;
|
|
1473
|
+
}
|
|
1474
|
+
const dashIndex = detail.indexOf(" \u2014 ");
|
|
1475
|
+
if (dashIndex === -1) {
|
|
1476
|
+
return detail;
|
|
1477
|
+
}
|
|
1478
|
+
const head = detail.slice(0, dashIndex).trim();
|
|
1479
|
+
return head === "" ? void 0 : head;
|
|
1480
|
+
}
|
|
1057
1481
|
function getBuiltinProviderPreset(type) {
|
|
1058
1482
|
switch (type) {
|
|
1059
1483
|
case "minimax":
|
|
@@ -1065,6 +1489,7 @@ function getBuiltinProviderPreset(type) {
|
|
|
1065
1489
|
case "siliconflow":
|
|
1066
1490
|
case "openrouter":
|
|
1067
1491
|
case "novita":
|
|
1492
|
+
case "medalsoft":
|
|
1068
1493
|
return BUILTIN_PROVIDER_PRESETS[type];
|
|
1069
1494
|
default:
|
|
1070
1495
|
return null;
|
|
@@ -1488,6 +1913,8 @@ var WebviewMessageType = /* @__PURE__ */ ((WebviewMessageType2) => {
|
|
|
1488
1913
|
WebviewMessageType2["SetProviderOrder"] = "setProviderOrder";
|
|
1489
1914
|
WebviewMessageType2["TestProvider"] = "testProvider";
|
|
1490
1915
|
WebviewMessageType2["ProviderTestResultMessage"] = "providerTestResult";
|
|
1916
|
+
WebviewMessageType2["TestProviderModel"] = "testProviderModel";
|
|
1917
|
+
WebviewMessageType2["ProviderTestModelResultMessage"] = "providerTestModelResult";
|
|
1491
1918
|
WebviewMessageType2["DefaultProviderChanged"] = "defaultProviderChanged";
|
|
1492
1919
|
WebviewMessageType2["FetchProviderModels"] = "fetchProviderModels";
|
|
1493
1920
|
WebviewMessageType2["FetchProviderModelsResult"] = "fetchProviderModelsResult";
|
|
@@ -1578,8 +2005,12 @@ export {
|
|
|
1578
2005
|
GetCachedServerUrl,
|
|
1579
2006
|
GetServerProxyState,
|
|
1580
2007
|
GetUtilityModels,
|
|
2008
|
+
LISTABLE_PRESET_MODELS,
|
|
1581
2009
|
LogLevel,
|
|
1582
2010
|
MODEL_METADATA,
|
|
2011
|
+
NAMESPACE_ALIASES,
|
|
2012
|
+
NAMESPACE_ALIAS_FAMILY,
|
|
2013
|
+
PRESET_MODEL_FAMILIES,
|
|
1583
2014
|
PROVIDER_BASE_URL_PRESETS,
|
|
1584
2015
|
PROVIDER_CACHE_CONTROL_METADATA,
|
|
1585
2016
|
ServerProxyStateResponse,
|
|
@@ -1592,6 +2023,7 @@ export {
|
|
|
1592
2023
|
__internal,
|
|
1593
2024
|
asAbortSignal,
|
|
1594
2025
|
buildGitHubLocalEmail,
|
|
2026
|
+
buildPresetModel,
|
|
1595
2027
|
checkGitHubOrgMembership,
|
|
1596
2028
|
createConsoleLogger,
|
|
1597
2029
|
currencyForBaseUrl,
|
|
@@ -1599,10 +2031,12 @@ export {
|
|
|
1599
2031
|
fetchGitHubUser,
|
|
1600
2032
|
getBuiltinProviderPreset,
|
|
1601
2033
|
getGitHubOrgMembership,
|
|
2034
|
+
getPresetModelDisplayName,
|
|
1602
2035
|
getProviderBaseUrlPresets,
|
|
1603
2036
|
isGitHubLocalEmail,
|
|
1604
2037
|
isProviderCacheControlAware,
|
|
1605
2038
|
isValidCanonicalSlug,
|
|
2039
|
+
listPresetModelGroups,
|
|
1606
2040
|
lookupModelMetadata,
|
|
1607
2041
|
normalizeCanonicalSlug,
|
|
1608
2042
|
normalizeErrorForLog,
|
|
@@ -1610,5 +2044,6 @@ export {
|
|
|
1610
2044
|
parsePayload,
|
|
1611
2045
|
protocolForBaseUrl,
|
|
1612
2046
|
resolvePrimaryEmail,
|
|
1613
|
-
safeJson
|
|
2047
|
+
safeJson,
|
|
2048
|
+
unionProviderModelWithPreset
|
|
1614
2049
|
};
|