@serviceme/devtools-shared 0.4.6 → 0.4.8
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 +354 -8
- package/dist/index.d.ts +354 -8
- package/dist/index.js +635 -115
- package/dist/index.mjs +624 -114
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -29,8 +29,12 @@ __export(index_exports, {
|
|
|
29
29
|
GetCachedServerUrl: () => GetCachedServerUrl,
|
|
30
30
|
GetServerProxyState: () => GetServerProxyState,
|
|
31
31
|
GetUtilityModels: () => GetUtilityModels,
|
|
32
|
+
LISTABLE_PRESET_MODELS: () => LISTABLE_PRESET_MODELS,
|
|
32
33
|
LogLevel: () => LogLevel,
|
|
33
34
|
MODEL_METADATA: () => MODEL_METADATA,
|
|
35
|
+
NAMESPACE_ALIASES: () => NAMESPACE_ALIASES,
|
|
36
|
+
NAMESPACE_ALIAS_FAMILY: () => NAMESPACE_ALIAS_FAMILY,
|
|
37
|
+
PRESET_MODEL_FAMILIES: () => PRESET_MODEL_FAMILIES,
|
|
34
38
|
PROVIDER_BASE_URL_PRESETS: () => PROVIDER_BASE_URL_PRESETS,
|
|
35
39
|
PROVIDER_CACHE_CONTROL_METADATA: () => PROVIDER_CACHE_CONTROL_METADATA,
|
|
36
40
|
ServerProxyStateResponse: () => ServerProxyStateResponse,
|
|
@@ -43,26 +47,48 @@ __export(index_exports, {
|
|
|
43
47
|
__internal: () => __internal,
|
|
44
48
|
asAbortSignal: () => asAbortSignal,
|
|
45
49
|
buildGitHubLocalEmail: () => buildGitHubLocalEmail,
|
|
50
|
+
buildPresetModel: () => buildPresetModel,
|
|
46
51
|
checkGitHubOrgMembership: () => checkGitHubOrgMembership,
|
|
47
52
|
createConsoleLogger: () => createConsoleLogger,
|
|
48
53
|
currencyForBaseUrl: () => currencyForBaseUrl,
|
|
54
|
+
effectiveAdapterType: () => effectiveAdapterType,
|
|
49
55
|
fetchGitHubUser: () => fetchGitHubUser,
|
|
50
56
|
getBuiltinProviderPreset: () => getBuiltinProviderPreset,
|
|
51
57
|
getGitHubOrgMembership: () => getGitHubOrgMembership,
|
|
58
|
+
getPresetModelDisplayName: () => getPresetModelDisplayName,
|
|
52
59
|
getProviderBaseUrlPresets: () => getProviderBaseUrlPresets,
|
|
53
60
|
isGitHubLocalEmail: () => isGitHubLocalEmail,
|
|
54
61
|
isProviderCacheControlAware: () => isProviderCacheControlAware,
|
|
55
62
|
isValidCanonicalSlug: () => isValidCanonicalSlug,
|
|
63
|
+
listPresetModelGroups: () => listPresetModelGroups,
|
|
56
64
|
lookupModelMetadata: () => lookupModelMetadata,
|
|
57
65
|
normalizeCanonicalSlug: () => normalizeCanonicalSlug,
|
|
58
66
|
normalizeErrorForLog: () => normalizeErrorForLog,
|
|
59
67
|
normalizeGitUrl: () => normalizeGitUrl,
|
|
60
68
|
parsePayload: () => parsePayload,
|
|
69
|
+
protocolForBaseUrl: () => protocolForBaseUrl,
|
|
61
70
|
resolvePrimaryEmail: () => resolvePrimaryEmail,
|
|
62
|
-
safeJson: () => safeJson
|
|
71
|
+
safeJson: () => safeJson,
|
|
72
|
+
unionProviderModelWithPreset: () => unionProviderModelWithPreset
|
|
63
73
|
});
|
|
64
74
|
module.exports = __toCommonJS(index_exports);
|
|
65
75
|
|
|
76
|
+
// src/ai/protocol.ts
|
|
77
|
+
function protocolForBaseUrl(baseUrl) {
|
|
78
|
+
try {
|
|
79
|
+
const url = new URL(baseUrl);
|
|
80
|
+
return /(^|\/)anthropic(\/|$)/i.test(url.pathname) ? "anthropic" : "openai";
|
|
81
|
+
} catch {
|
|
82
|
+
return "openai";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function effectiveAdapterType(configuredType, baseUrl) {
|
|
86
|
+
if (configuredType === "zhipu" && protocolForBaseUrl(baseUrl) === "anthropic") {
|
|
87
|
+
return "anthropic-compatible";
|
|
88
|
+
}
|
|
89
|
+
return configuredType;
|
|
90
|
+
}
|
|
91
|
+
|
|
66
92
|
// src/ai/providers.base-url.ts
|
|
67
93
|
var PROVIDER_BASE_URL_PRESETS = {
|
|
68
94
|
"openai-compatible": [],
|
|
@@ -77,19 +103,60 @@ var PROVIDER_BASE_URL_PRESETS = {
|
|
|
77
103
|
{ label: "\u5168\u7403", baseUrl: "https://api.moonshot.ai/v1" }
|
|
78
104
|
],
|
|
79
105
|
zhipu: [
|
|
80
|
-
// Zhipu
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
|
|
106
|
+
// Zhipu / 智谱 GLM 6 endpoint paths × 2 hosts. The 4
|
|
107
|
+
// "credential channels" the GLM-for-copilot reference
|
|
108
|
+
// distinguishes (region × apiMode — each with its own API
|
|
109
|
+
// key) collapse to a 6-row baseUrl dropdown here because we
|
|
110
|
+
// keep one API key per provider, not one per channel. The
|
|
111
|
+
// user picks the host + path that matches the API key
|
|
112
|
+
// they actually have; the curated `MODEL_METADATA` prices
|
|
113
|
+
// are host-based (CNY vs USD via `currencyForBaseUrl`).
|
|
114
|
+
//
|
|
115
|
+
// Source: https://bigmodel.cn/pricing (CN platform, CNY) +
|
|
116
|
+
// https://z.ai/pricing (international, USD). The 6 paths
|
|
117
|
+
// map to:
|
|
118
|
+
// - `/api/paas/v4` → 标准 API (Standard)
|
|
119
|
+
// - `/api/coding/paas/v4` → Coding Plan (订阅套餐)
|
|
120
|
+
// - `/api/anthropic` → Anthropic 兼容协议
|
|
121
|
+
//
|
|
122
|
+
// Earlier single-entry dropdown omitted the Coding Plan
|
|
123
|
+
// path and the international Z.ai host entirely — users on
|
|
124
|
+
// the Coding Plan subscription were 404'ing because they
|
|
125
|
+
// pasted `open.bigmodel.cn/api/paas/v4` into a Coding Plan
|
|
126
|
+
// key, and Z.ai users had no preset to pick.
|
|
127
|
+
// ── 国内 (open.bigmodel.cn — CNY) ───────────────────────
|
|
128
|
+
{
|
|
129
|
+
label: "\u56FD\u5185 \xB7 \u6807\u51C6 API",
|
|
130
|
+
baseUrl: "https://open.bigmodel.cn/api/paas/v4"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: "\u56FD\u5185 \xB7 Coding Plan",
|
|
134
|
+
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4"
|
|
135
|
+
},
|
|
136
|
+
// 重要:Anthropic 协议端点 **复用** Coding Plan 的 key(与
|
|
137
|
+
// `/api/coding/paas/v4` 共用同一凭证;不是 Standard API key,
|
|
138
|
+
// 也没有独立的 "Anthropic API key")。
|
|
139
|
+
// Reference: `docs/references/GLM-for-copilot-main/src/i18n.ts:578-579`
|
|
140
|
+
// "Coding Plan and Standard API credentials are independent.
|
|
141
|
+
// OpenAI and Anthropic endpoints in the same region share
|
|
142
|
+
// the Coding Plan key."
|
|
143
|
+
// label 故意重复 "Coding Plan" 两次,让用户从下拉里一眼看出:
|
|
144
|
+
// (a) 这个端点**只能配 Coding Plan key**;
|
|
145
|
+
// (b) 这是 Coding Plan 的**协议变体**,不是 Standard API 的。
|
|
146
|
+
{
|
|
147
|
+
label: "\u56FD\u5185 \xB7 Coding Plan \xB7 Anthropic \u534F\u8BAE",
|
|
148
|
+
baseUrl: "https://open.bigmodel.cn/api/anthropic"
|
|
149
|
+
},
|
|
150
|
+
// ── 国际 (api.z.ai — USD) ───────────────────────────────
|
|
151
|
+
{ label: "\u56FD\u9645 \xB7 \u6807\u51C6 API", baseUrl: "https://api.z.ai/api/paas/v4" },
|
|
152
|
+
{
|
|
153
|
+
label: "\u56FD\u9645 \xB7 Coding Plan",
|
|
154
|
+
baseUrl: "https://api.z.ai/api/coding/paas/v4"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: "\u56FD\u9645 \xB7 Coding Plan \xB7 Anthropic \u534F\u8BAE",
|
|
158
|
+
baseUrl: "https://api.z.ai/api/anthropic"
|
|
159
|
+
}
|
|
93
160
|
],
|
|
94
161
|
stepfun: [{ label: "\u5B98\u65B9", baseUrl: "https://api.stepfun.com/v1" }],
|
|
95
162
|
siliconflow: [
|
|
@@ -102,6 +169,8 @@ var PROVIDER_BASE_URL_PRESETS = {
|
|
|
102
169
|
{ label: "\u56FD\u5185", baseUrl: "https://api.agnes-ai.cn/v1" },
|
|
103
170
|
{ label: "\u5168\u7403", baseUrl: "https://apihub.agnes-ai.com/v1" }
|
|
104
171
|
],
|
|
172
|
+
// Medalsoft internal LLM gateway — single OpenAI-compatible endpoint.
|
|
173
|
+
medalsoft: [{ label: "\u5185\u90E8\u7F51\u5173", baseUrl: "https://llm.proxy.alio.wang/v1" }],
|
|
105
174
|
"vscode-builtin": []
|
|
106
175
|
};
|
|
107
176
|
function getProviderBaseUrlPresets(type) {
|
|
@@ -129,6 +198,12 @@ var PROVIDER_CACHE_CONTROL_METADATA = {
|
|
|
129
198
|
agnes: {
|
|
130
199
|
supportsCacheControl: true
|
|
131
200
|
},
|
|
201
|
+
// Medalsoft internal gateway — OpenAI-compatible pass-through; the
|
|
202
|
+
// upstream's prompt-cache behaviour is unknown from outside, so we
|
|
203
|
+
// don't declare support (no `prompt_cache_key` header is written).
|
|
204
|
+
// Flip to `supportsCacheControl: true` once the gateway is verified
|
|
205
|
+
// to honour stable prompt caching.
|
|
206
|
+
medalsoft: {},
|
|
132
207
|
"vscode-builtin": {}
|
|
133
208
|
};
|
|
134
209
|
function isProviderCacheControlAware(type) {
|
|
@@ -169,8 +244,17 @@ var PRIMARY_METADATA = {
|
|
|
169
244
|
detail: "M2.7 high-speed: same quality, faster (~100 TPS)",
|
|
170
245
|
imageInput: false,
|
|
171
246
|
toolCalling: true,
|
|
247
|
+
// Per https://minimax-ai.chat/pricing (2026-07 verified):
|
|
248
|
+
// M2.7-highspeed is 2× M2.7 base on input/output, but
|
|
249
|
+
// identical on cache hit (same model + same infra, just a
|
|
250
|
+
// serving-side TPS bump). The CNY values mirror USD at the
|
|
251
|
+
// project's 1:7 CNY-per-USD convention.
|
|
252
|
+
// Previously the CNY input/output were the same as base
|
|
253
|
+
// (¥2.1 / ¥8.4) while USD was already 2× — that left the
|
|
254
|
+
// USD/CNY ratio at 3.5× instead of 7× and silently
|
|
255
|
+
// under-reported CNY cost for users on the China platform.
|
|
172
256
|
pricingUSD: { input: 0.6, output: 2.4, cacheRead: 0.06 },
|
|
173
|
-
pricingCNY: { input: 2
|
|
257
|
+
pricingCNY: { input: 4.2, output: 16.8, cacheRead: 0.42 },
|
|
174
258
|
priceCategory: "low",
|
|
175
259
|
// Inherits M2.7's context window.
|
|
176
260
|
maxInputTokens: 131072,
|
|
@@ -180,8 +264,20 @@ var PRIMARY_METADATA = {
|
|
|
180
264
|
detail: "Fast, general-purpose model",
|
|
181
265
|
imageInput: true,
|
|
182
266
|
toolCalling: true,
|
|
183
|
-
|
|
184
|
-
|
|
267
|
+
// Per https://api-docs.deepseek.com/quick_start/pricing/ and
|
|
268
|
+
// https://new.qq.com/rain/a/20260813A0DROS00 (2026-08-13
|
|
269
|
+
// announcement, effective 2026-08-17 00:00 Beijing): peak/
|
|
270
|
+
// off-peak tiered pricing. Pinned the OFF-PEAK rate since
|
|
271
|
+
// peak hours (01:00–04:00 + 06:00–10:00 UTC = 09:00–12:00 +
|
|
272
|
+
// 14:00–18:00 Beijing) cover only 8 of 24 hours — most chat
|
|
273
|
+
// sessions land off-peak. Peak is exactly 2× off-peak per
|
|
274
|
+
// the official page.
|
|
275
|
+
// Off-peak: $0.007 cache hit / $0.22 input / $0.66 output
|
|
276
|
+
// ¥0.05 cache hit / ¥1.5 input / ¥4.5 output
|
|
277
|
+
// The pre-2026-08-17 rate was 1/3 of the current off-peak;
|
|
278
|
+
// 8/17 调价 raised cache hit 6× and output 2.25×.
|
|
279
|
+
pricingUSD: { input: 0.22, output: 0.66, cacheRead: 7e-3 },
|
|
280
|
+
pricingCNY: { input: 1.5, output: 4.5, cacheRead: 0.05 },
|
|
185
281
|
priceCategory: "low",
|
|
186
282
|
// Official docs (api-docs.deepseek.com/quick_start/pricing, fetched
|
|
187
283
|
// 2026-07-27): "THINKING MODE: Supports both non-thinking and
|
|
@@ -197,8 +293,20 @@ var PRIMARY_METADATA = {
|
|
|
197
293
|
detail: "Most capable reasoning model",
|
|
198
294
|
imageInput: true,
|
|
199
295
|
toolCalling: true,
|
|
200
|
-
|
|
201
|
-
|
|
296
|
+
// Per https://api-docs.deepseek.com/quick_start/pricing/ and
|
|
297
|
+
// https://new.qq.com/rain/a/20260813A0DROS00 (2026-08-13
|
|
298
|
+
// announcement, effective 2026-08-17 00:00 Beijing): peak/
|
|
299
|
+
// off-peak tiered pricing. Pinned the OFF-PEAK rate (peak
|
|
300
|
+
// hours are 8/24; most chat sessions land off-peak; peak is
|
|
301
|
+
// exactly 2× off-peak per the official page).
|
|
302
|
+
// Off-peak: $0.022 cache hit / $0.66 input / $1.98 output
|
|
303
|
+
// ¥0.15 cache hit / ¥4.5 input / ¥13.5 output
|
|
304
|
+
// The 8/17 调价 raised cache hit 6× (¥0.025 → ¥0.15),
|
|
305
|
+
// input 1.5×, and output 2.25×. The pre-08-17 USD values
|
|
306
|
+
// (0.435/0.87/0.003625) and CNY values (2.1/4.2/0.025) did
|
|
307
|
+
// not correspond to any DeepSeek-published rate; corrected.
|
|
308
|
+
pricingUSD: { input: 0.66, output: 1.98, cacheRead: 0.022 },
|
|
309
|
+
pricingCNY: { input: 4.5, output: 13.5, cacheRead: 0.15 },
|
|
202
310
|
priceCategory: "low",
|
|
203
311
|
thinkingSchema: "thinkingEnabled",
|
|
204
312
|
maxInputTokens: 655360,
|
|
@@ -241,6 +349,44 @@ var PRIMARY_METADATA = {
|
|
|
241
349
|
maxInputTokens: 934976,
|
|
242
350
|
maxOutputTokens: 65536
|
|
243
351
|
},
|
|
352
|
+
"agnes-2.5-pro": {
|
|
353
|
+
detail: "Paid reasoning model \u2014 commercial stable of 2.5 Pro Alpha (advanced coding, scientific reasoning, long context, multimodal). 1M context / 65K max output",
|
|
354
|
+
imageInput: true,
|
|
355
|
+
toolCalling: true,
|
|
356
|
+
// Official pricing per https://wiki.agnes-ai.com/en/docs/agnes-25-pro.md
|
|
357
|
+
// (fetched 2026-08-19) — identical to 2.5 Pro Alpha:
|
|
358
|
+
// $0.45 input / $0.0038 cache read / $0.90 output per 1M tokens.
|
|
359
|
+
// No separate CNY tier is published, so pricingCNY mirrors USD.
|
|
360
|
+
pricingUSD: { input: 0.45, output: 0.9, cacheRead: 38e-4 },
|
|
361
|
+
pricingCNY: { input: 0.45, output: 0.9, cacheRead: 38e-4 },
|
|
362
|
+
priceCategory: "medium",
|
|
363
|
+
// Same binary Thinking on/off switch as the other Agnes models
|
|
364
|
+
// (`chat_template_kwargs.enable_thinking` on the OpenAI wire).
|
|
365
|
+
thinkingSchema: "thinkingEnabled",
|
|
366
|
+
// Same published window as 2.5 Pro Alpha: 1M context /
|
|
367
|
+
// 65536 max output — input cap mirrors the alpha entry.
|
|
368
|
+
maxInputTokens: 934976,
|
|
369
|
+
maxOutputTokens: 65536
|
|
370
|
+
},
|
|
371
|
+
"agnes-2.5-flash": {
|
|
372
|
+
detail: "GA upgrade of Agnes 2.0 Flash \u2014 stronger coding, agent workflows, tool calling, image understanding (512K context)",
|
|
373
|
+
imageInput: true,
|
|
374
|
+
toolCalling: true,
|
|
375
|
+
// Standard (post-promo) pricing per
|
|
376
|
+
// https://wiki.agnes-ai.com/en/docs/agnes-25-flash.md (fetched
|
|
377
|
+
// 2026-08-19) — same list price as 2.0 Flash ($0.03 / $0.15 per
|
|
378
|
+
// 1M tokens); the temporary $0 / $0 promo is ignored per the
|
|
379
|
+
// same policy as the 2.0 Flash entry. No separate CNY tier is
|
|
380
|
+
// published, so pricingCNY mirrors the USD numbers.
|
|
381
|
+
pricingUSD: { input: 0.03, output: 0.15, cacheRead: null },
|
|
382
|
+
pricingCNY: { input: 0.03, output: 0.15, cacheRead: null },
|
|
383
|
+
priceCategory: "low",
|
|
384
|
+
// Same binary Thinking on/off switch as 2.0 Flash
|
|
385
|
+
// (`chat_template_kwargs.enable_thinking` on the OpenAI wire).
|
|
386
|
+
thinkingSchema: "thinkingEnabled",
|
|
387
|
+
maxInputTokens: 512e3,
|
|
388
|
+
maxOutputTokens: 65536
|
|
389
|
+
},
|
|
244
390
|
// ── Kimi (月之暗面 / Moonshot AI) ────────────────────────────────
|
|
245
391
|
// Source: https://platform.kimi.com/docs/pricing/chat-k3,
|
|
246
392
|
// chat-k27-code, chat-k26 (fetched 2026-07-27). Prices are per 1M
|
|
@@ -326,10 +472,21 @@ var PRIMARY_METADATA = {
|
|
|
326
472
|
// GLM-5's explicit "Agentic 长程规划与执行" description. Corrected
|
|
327
473
|
// from false (inconsistent with the rest of the GLM-5 family).
|
|
328
474
|
"glm-5.2": {
|
|
329
|
-
detail: "GLM-5.2 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K",
|
|
475
|
+
detail: "GLM-5.2 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF08\u5355\u6863 pricing\uFF09",
|
|
330
476
|
imageInput: false,
|
|
331
477
|
toolCalling: true,
|
|
332
|
-
//
|
|
478
|
+
// Thinking-mode dropdown + `reasoning_effort`. Zhipu official
|
|
479
|
+
// OpenAPI (fetched 2026-08-19): "仅 GLM-5.2 及其以上模型支持"
|
|
480
|
+
// reasoning_effort; for 5.2 the server maps none/minimal → give
|
|
481
|
+
// up thinking, low/medium → high, xhigh → max (we only send the
|
|
482
|
+
// native high/max so no client-side aliasing is needed).
|
|
483
|
+
thinkingSchema: "reasoningEffort",
|
|
484
|
+
supportsReasoningEffort: true,
|
|
485
|
+
// Single rate (no input-length tier split) per
|
|
486
|
+
// bigmodel.cn/pricing 2026-08-18:
|
|
487
|
+
// ¥8 input / ¥28 output / ¥2 cache hit per 1M tokens
|
|
488
|
+
// The previous entry's comment said "输入长度 32K+ 档" — that
|
|
489
|
+
// was wrong: GLM-5.2 has no tier split on the official page.
|
|
333
490
|
pricingUSD: { input: 1.12, output: 3.92, cacheRead: 0.28 },
|
|
334
491
|
pricingCNY: { input: 8, output: 28, cacheRead: 2 },
|
|
335
492
|
priceCategory: "high",
|
|
@@ -346,6 +503,14 @@ var PRIMARY_METADATA = {
|
|
|
346
503
|
detail: "GLM-5.3 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u540E\u8BAD\u7EC3\u589E\u5F3A\u4EE3\u7801 / \u7F51\u7EDC\u5B89\u5168",
|
|
347
504
|
imageInput: false,
|
|
348
505
|
toolCalling: true,
|
|
506
|
+
// Thinking-mode dropdown (思考模式 停用/标准/深度) + the
|
|
507
|
+
// `reasoning_effort` field. Zhipu official OpenAPI (fetched
|
|
508
|
+
// 2026-08-19): GLM-5.3 restricts `thinking.type` to "enabled"
|
|
509
|
+
// and controls depth via `reasoning_effort` (low/high/max
|
|
510
|
+
// only). Mirrors `supportsReasoningEffort: true` in
|
|
511
|
+
// `docs/references/GLM-for-copilot-main/src/consts.ts`.
|
|
512
|
+
thinkingSchema: "reasoningEffort",
|
|
513
|
+
supportsReasoningEffort: true,
|
|
349
514
|
// Vendor-published USD price (Decrypt, 2026-08-14). Cache-hit price
|
|
350
515
|
// has not been published — the picker shows "(not published)" rather
|
|
351
516
|
// than fabricating a number (the rate usually diverges 4–10× from
|
|
@@ -364,74 +529,105 @@ var PRIMARY_METADATA = {
|
|
|
364
529
|
// (model id `glm-5.1-highspeed`). Pricing mirrors GLM-5.1 since the
|
|
365
530
|
// rate is identical architecture — TileRT is a serving-side optim.
|
|
366
531
|
"glm-5.1-highspeed": {
|
|
367
|
-
detail: "GLM-5.1 HighSpeed \u2014 400 TPS \u9AD8\u541E\u5410\u751F\u4EA7\u53D8\u4F53",
|
|
532
|
+
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",
|
|
368
533
|
imageInput: false,
|
|
369
534
|
toolCalling: true,
|
|
535
|
+
// Thinking switch (no reasoning_effort — 5.1 < 5.2 threshold).
|
|
536
|
+
thinkingSchema: "reasoningEffort",
|
|
537
|
+
// Mirrors GLM-5.1 [0, 32K) tier per bigmodel.cn/pricing 2026-08-18.
|
|
538
|
+
// TileRT is a serving-side optim; the per-token rate is the same
|
|
539
|
+
// architecture as the base model.
|
|
370
540
|
pricingUSD: { input: 0.6, output: 2.2, cacheRead: 0.11 },
|
|
371
|
-
pricingCNY: { input:
|
|
541
|
+
pricingCNY: { input: 6, output: 24, cacheRead: 1.3 },
|
|
372
542
|
priceCategory: "medium",
|
|
373
543
|
maxInputTokens: 2e5,
|
|
374
544
|
maxOutputTokens: 128e3
|
|
375
545
|
},
|
|
376
|
-
// GLM-4.7-Flash (2026-01-19) —
|
|
377
|
-
//
|
|
378
|
-
//
|
|
379
|
-
//
|
|
380
|
-
//
|
|
546
|
+
// GLM-4.7-Flash (2026-01-19) — 200K context, fully-free tier on
|
|
547
|
+
// bigmodel.cn/pricing (fetched 2026-08-18). Lightweight + high-
|
|
548
|
+
// frequency optimised; coding / writing / translation / reasoning
|
|
549
|
+
// at "best-in-class-for-its-size" per the Zhipu release notes.
|
|
550
|
+
// Distinct from `glm-4.7-flashx` (the latter is the 快速版 with
|
|
551
|
+
// paid pricing).
|
|
381
552
|
"glm-4.7-flash": {
|
|
382
|
-
detail: "GLM-4.7 Flash \u2014 \
|
|
553
|
+
detail: "GLM-4.7 Flash \u2014 \u5B8C\u5168\u514D\u8D39\uFF08200K \u4E0A\u4E0B\u6587\uFF09",
|
|
383
554
|
imageInput: false,
|
|
384
555
|
toolCalling: true,
|
|
385
|
-
//
|
|
386
|
-
|
|
387
|
-
//
|
|
388
|
-
//
|
|
389
|
-
|
|
390
|
-
|
|
556
|
+
// Thinking switch (no reasoning_effort — 4.7 < 5.2 threshold).
|
|
557
|
+
thinkingSchema: "reasoningEffort",
|
|
558
|
+
// Free tier — input / output / cache hit all 0 (bigmodel.cn
|
|
559
|
+
// 2026-08-18 lists "免费" for every column). USD mirrors CNY
|
|
560
|
+
// rather than inventing a rate.
|
|
561
|
+
pricingUSD: { input: 0, output: 0, cacheRead: 0 },
|
|
562
|
+
pricingCNY: { input: 0, output: 0, cacheRead: 0 },
|
|
391
563
|
priceCategory: "low",
|
|
392
564
|
maxInputTokens: 2e5,
|
|
393
565
|
maxOutputTokens: 128e3
|
|
394
566
|
},
|
|
395
567
|
"glm-4.7": {
|
|
396
|
-
detail: "200K \u4E0A\u4E0B\u6587\uFF0C\u5DE5\u5177\u8C03\u7528",
|
|
568
|
+
detail: "GLM-4.7 \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u5DE5\u5177\u8C03\u7528\uFF083-tier pricing\uFF09",
|
|
397
569
|
imageInput: false,
|
|
398
570
|
toolCalling: true,
|
|
399
|
-
//
|
|
400
|
-
|
|
401
|
-
|
|
571
|
+
// Thinking switch (GLM-4.7 forces thinking when enabled per the
|
|
572
|
+
// official ChatThinking doc; no reasoning_effort — 4.7 < 5.2).
|
|
573
|
+
thinkingSchema: "reasoningEffort",
|
|
574
|
+
// Pinned the LOWEST tier per bigmodel.cn/pricing 2026-08-18:
|
|
575
|
+
// [0, 32K) input × [0, 0.2K) output — ¥2 / ¥8 / ¥0.4 cache hit
|
|
576
|
+
// [0, 32K) input × [0.2K+) output — ¥3 / ¥14 / ¥0.6 cache hit
|
|
577
|
+
// [32K, 200K) input — ¥4 / ¥16 / ¥0.8 cache hit
|
|
578
|
+
// Most real prompts are < 32K input and < 0.2K output, so the
|
|
579
|
+
// lowest tier is the most representative per-request price.
|
|
580
|
+
// Re-pick from a higher tier if the picker adds a length slider.
|
|
581
|
+
pricingUSD: { input: 0.28, output: 1.12, cacheRead: 0.056 },
|
|
582
|
+
pricingCNY: { input: 2, output: 8, cacheRead: 0.4 },
|
|
402
583
|
priceCategory: "medium",
|
|
403
584
|
maxInputTokens: 2e5,
|
|
404
585
|
maxOutputTokens: 128e3
|
|
405
586
|
},
|
|
406
587
|
"glm-5.1": {
|
|
407
|
-
detail: "GLM-5.1 \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K",
|
|
588
|
+
detail: "GLM-5.1 \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
408
589
|
imageInput: false,
|
|
409
590
|
toolCalling: true,
|
|
410
|
-
//
|
|
411
|
-
|
|
412
|
-
|
|
591
|
+
// Thinking switch (no reasoning_effort — 5.1 < 5.2 threshold).
|
|
592
|
+
thinkingSchema: "reasoningEffort",
|
|
593
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
594
|
+
// [0, 32K) — ¥6 input / ¥24 output / ¥1.3 cache hit
|
|
595
|
+
// [32K+) — ¥8 input / ¥28 output / ¥2 cache hit
|
|
596
|
+
// The previous entry had the higher tier; switched to the lower
|
|
597
|
+
// tier so a typical < 32K prompt shows the more accurate price.
|
|
598
|
+
pricingUSD: { input: 0.84, output: 3.36, cacheRead: 0.182 },
|
|
599
|
+
pricingCNY: { input: 6, output: 24, cacheRead: 1.3 },
|
|
413
600
|
priceCategory: "high",
|
|
414
601
|
maxInputTokens: 2e5,
|
|
415
602
|
maxOutputTokens: 128e3
|
|
416
603
|
},
|
|
417
604
|
"glm-5": {
|
|
418
|
-
detail: "GLM-5 \u2014 200K \u4E0A\u4E0B\u6587\uFF0CAgentic \u5DE5\u5177\u8C03\u7528\uFF0C\u6700\u5927\u8F93\u51FA 128K",
|
|
605
|
+
detail: "GLM-5 \u2014 200K \u4E0A\u4E0B\u6587\uFF0CAgentic \u5DE5\u5177\u8C03\u7528\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
419
606
|
imageInput: false,
|
|
420
607
|
toolCalling: true,
|
|
421
|
-
//
|
|
422
|
-
|
|
423
|
-
|
|
608
|
+
// Thinking switch (no reasoning_effort — 5 < 5.2 threshold).
|
|
609
|
+
thinkingSchema: "reasoningEffort",
|
|
610
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
611
|
+
// [0, 32K) — ¥4 input / ¥18 output / ¥1 cache hit
|
|
612
|
+
// [32K+) — ¥6 input / ¥22 output / ¥1.5 cache hit
|
|
613
|
+
pricingUSD: { input: 0.56, output: 2.52, cacheRead: 0.14 },
|
|
614
|
+
pricingCNY: { input: 4, output: 18, cacheRead: 1 },
|
|
424
615
|
priceCategory: "high",
|
|
425
616
|
maxInputTokens: 2e5,
|
|
426
617
|
maxOutputTokens: 128e3
|
|
427
618
|
},
|
|
428
619
|
"glm-5-turbo": {
|
|
429
|
-
detail: "GLM-5 Turbo \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K",
|
|
620
|
+
detail: "GLM-5 Turbo \u2014 200K \u4E0A\u4E0B\u6587\uFF0C\u6700\u5927\u8F93\u51FA 128K\uFF082-tier pricing\uFF09",
|
|
430
621
|
imageInput: false,
|
|
431
622
|
toolCalling: true,
|
|
432
|
-
//
|
|
433
|
-
|
|
434
|
-
|
|
623
|
+
// Thinking switch (listed in the official ChatThinking doc's
|
|
624
|
+
// auto-think family; no reasoning_effort — 5-Turbo < 5.2).
|
|
625
|
+
thinkingSchema: "reasoningEffort",
|
|
626
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
627
|
+
// [0, 32K) — ¥5 input / ¥22 output / ¥1.2 cache hit
|
|
628
|
+
// [32K+) — ¥7 input / ¥26 output / ¥1.8 cache hit
|
|
629
|
+
pricingUSD: { input: 0.7, output: 3.08, cacheRead: 0.168 },
|
|
630
|
+
pricingCNY: { input: 5, output: 22, cacheRead: 1.2 },
|
|
435
631
|
priceCategory: "medium",
|
|
436
632
|
maxInputTokens: 2e5,
|
|
437
633
|
maxOutputTokens: 128e3
|
|
@@ -440,6 +636,8 @@ var PRIMARY_METADATA = {
|
|
|
440
636
|
detail: "GLM-4.7 FlashX \u2014 \u5FEB\u901F\u7248",
|
|
441
637
|
imageInput: false,
|
|
442
638
|
toolCalling: false,
|
|
639
|
+
// Thinking switch (4.7 family; no reasoning_effort).
|
|
640
|
+
thinkingSchema: "reasoningEffort",
|
|
443
641
|
// ¥0.5 input / ¥3 output / ¥0.1 cache hit per 1M tokens
|
|
444
642
|
pricingUSD: { input: 0.07, output: 0.42, cacheRead: 0.014 },
|
|
445
643
|
pricingCNY: { input: 0.5, output: 3, cacheRead: 0.1 },
|
|
@@ -451,6 +649,9 @@ var PRIMARY_METADATA = {
|
|
|
451
649
|
detail: "GLM-4.6 \u2014 \u5DE5\u5177\u8C03\u7528",
|
|
452
650
|
imageInput: false,
|
|
453
651
|
toolCalling: true,
|
|
652
|
+
// Thinking switch (auto-think family per the official
|
|
653
|
+
// ChatThinking doc; no reasoning_effort — 4.6 < 5.2).
|
|
654
|
+
thinkingSchema: "reasoningEffort",
|
|
454
655
|
pricingUSD: { input: 0.6, output: 2.2, cacheRead: 0.11 },
|
|
455
656
|
pricingCNY: { input: 4.3, output: 15.7, cacheRead: 0.79 },
|
|
456
657
|
priceCategory: "medium",
|
|
@@ -472,6 +673,9 @@ var PRIMARY_METADATA = {
|
|
|
472
673
|
detail: "GLM-4.5 \u2014 \u5DE5\u5177\u8C03\u7528\uFF08\u88F8\u540D\uFF1BZhipu /v1/models \u66B4\u9732\u7684 legacy alias\uFF09",
|
|
473
674
|
imageInput: false,
|
|
474
675
|
toolCalling: true,
|
|
676
|
+
// Thinking switch (4.5 generation is the thinking-param floor
|
|
677
|
+
// per the official ChatThinking doc; no reasoning_effort).
|
|
678
|
+
thinkingSchema: "reasoningEffort",
|
|
475
679
|
pricingUSD: { input: 0, output: 0, cacheRead: null },
|
|
476
680
|
pricingCNY: { input: 0, output: 0, cacheRead: null },
|
|
477
681
|
priceCategory: "low",
|
|
@@ -479,23 +683,38 @@ var PRIMARY_METADATA = {
|
|
|
479
683
|
maxOutputTokens: 96e3
|
|
480
684
|
},
|
|
481
685
|
"glm-4.5-air": {
|
|
482
|
-
detail: "GLM-4.5 Air \u2014 \u5DE5\u5177\u8C03\u7528",
|
|
686
|
+
detail: "GLM-4.5 Air \u2014 \u5DE5\u5177\u8C03\u7528\uFF083-tier pricing\uFF09",
|
|
483
687
|
imageInput: false,
|
|
484
688
|
toolCalling: true,
|
|
485
|
-
|
|
486
|
-
|
|
689
|
+
// Thinking switch (4.5 family; no reasoning_effort).
|
|
690
|
+
thinkingSchema: "reasoningEffort",
|
|
691
|
+
// Pinned the LOWEST tier per bigmodel.cn/pricing 2026-08-18:
|
|
692
|
+
// [0, 32K) × [0, 0.2K) output — ¥0.8 / ¥2 / ¥0.16 cache hit
|
|
693
|
+
// [0, 32K) × [0.2K+) output — ¥0.8 / ¥6 / ¥0.16 cache hit
|
|
694
|
+
// [32K, 128K) — ¥1.2 / ¥8 / ¥0.24 cache hit
|
|
695
|
+
// All cache-hit rates are 4× lower than input — the
|
|
696
|
+
// explicit-cache-discount half of BYOM-depth #1.
|
|
697
|
+
pricingUSD: { input: 0.112, output: 0.28, cacheRead: 0.0224 },
|
|
698
|
+
pricingCNY: { input: 0.8, output: 2, cacheRead: 0.16 },
|
|
487
699
|
priceCategory: "low",
|
|
488
700
|
maxInputTokens: 128e3,
|
|
489
701
|
maxOutputTokens: 96e3
|
|
490
702
|
},
|
|
491
703
|
"glm-4.5-airx": {
|
|
492
|
-
detail: "GLM-4.5 AirX \u2014 \u5FEB\u901F\u7248",
|
|
704
|
+
detail: "GLM-4.5 AirX \u2014 \u5FEB\u901F\u7248\uFF08\xA510/M \u5355\u6863\uFF09",
|
|
493
705
|
imageInput: false,
|
|
494
706
|
toolCalling: false,
|
|
495
|
-
|
|
496
|
-
|
|
707
|
+
// Thinking switch (4.5 family; no reasoning_effort).
|
|
708
|
+
thinkingSchema: "reasoningEffort",
|
|
709
|
+
// ¥10 / M tokens (single rate, input == output) per
|
|
710
|
+
// bigmodel.cn/pricing 2026-08-18 — listed under the "模型推理
|
|
711
|
+
// → Language Models" sub-tab, NOT the flagship text section.
|
|
712
|
+
// 8K context window per the same sub-tab; 96K max output is a
|
|
713
|
+
// best-guess from sibling Air-tier models.
|
|
714
|
+
pricingUSD: { input: 1.4, output: 1.4, cacheRead: null },
|
|
715
|
+
pricingCNY: { input: 10, output: 10, cacheRead: null },
|
|
497
716
|
priceCategory: "low",
|
|
498
|
-
maxInputTokens:
|
|
717
|
+
maxInputTokens: 8192,
|
|
499
718
|
maxOutputTokens: 96e3
|
|
500
719
|
},
|
|
501
720
|
"glm-4-long": {
|
|
@@ -532,24 +751,69 @@ var PRIMARY_METADATA = {
|
|
|
532
751
|
maxOutputTokens: 4e3
|
|
533
752
|
},
|
|
534
753
|
"glm-4.5v": {
|
|
535
|
-
detail: "GLM-4.5V \u89C6\u89C9\u63A8\u7406\u6A21\u578B \u2014 \u56FE\u50CF/\u89C6\u9891/\u6587\u6863/GUI",
|
|
754
|
+
detail: "GLM-4.5V \u89C6\u89C9\u63A8\u7406\u6A21\u578B \u2014 \u56FE\u50CF/\u89C6\u9891/\u6587\u6863/GUI\uFF082-tier pricing\uFF09",
|
|
536
755
|
imageInput: true,
|
|
537
756
|
toolCalling: true,
|
|
538
|
-
|
|
539
|
-
|
|
757
|
+
// Thinking switch (official ChatThinking doc: GLM-4.5V 为强制
|
|
758
|
+
// 思考 when enabled; no reasoning_effort).
|
|
759
|
+
thinkingSchema: "reasoningEffort",
|
|
760
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
761
|
+
// [0, 32K) — ¥2 input / ¥6 output / ¥0.4 cache hit
|
|
762
|
+
// [32, 64K) — ¥4 input / ¥12 output / ¥0.8 cache hit
|
|
763
|
+
pricingUSD: { input: 0.28, output: 0.84, cacheRead: 0.056 },
|
|
764
|
+
pricingCNY: { input: 2, output: 6, cacheRead: 0.4 },
|
|
765
|
+
priceCategory: "medium",
|
|
766
|
+
maxInputTokens: 64e3,
|
|
767
|
+
maxOutputTokens: 8192
|
|
768
|
+
},
|
|
769
|
+
// GLM-4.6V (2026 H1) — 视觉推理模型 (paid version, 2-tier
|
|
770
|
+
// pricing). Distinct from `glm-4.6v-flash` (免费版, 0/0/0) and
|
|
771
|
+
// `glm-4.6v-flashx` (快速版, ¥0.15/¥1.5/¥0.03). Per
|
|
772
|
+
// bigmodel.cn/pricing 2026-08-18 (the same snapshot the
|
|
773
|
+
// §7 table in `byom-glm-learnings.md` was sourced from, where
|
|
774
|
+
// this row was first documented but never landed in
|
|
775
|
+
// MODEL_METADATA until 2026-08-19):
|
|
776
|
+
// [0, 32K) — ¥1 input / ¥3 output / ¥0.2 cache hit
|
|
777
|
+
// [32, 128K) — ¥2 input / ¥6 output / ¥0.4 cache hit
|
|
778
|
+
// The lower tier is pinned per the project's "multi-tier →
|
|
779
|
+
// lowest tier" convention (most prompts < 32K input × < 0.2K
|
|
780
|
+
// output). 4.6V sits between glm-4.5v (¥2/¥6/¥0.4) and the
|
|
781
|
+
// flashx variant — the 4.6 generation is meaningfully cheaper
|
|
782
|
+
// per the 2026 mid-year price reset.
|
|
783
|
+
"glm-4.6v": {
|
|
784
|
+
detail: "GLM-4.6V \u89C6\u89C9\u63A8\u7406\u6A21\u578B \u2014 \u56FE\u50CF/\u89C6\u9891/\u6587\u6863/GUI\uFF082-tier pricing\uFF09",
|
|
785
|
+
imageInput: true,
|
|
786
|
+
toolCalling: true,
|
|
787
|
+
// Thinking switch (same auto-think family as glm-4.5v;
|
|
788
|
+
// 4.6 < 5.2 threshold, so no reasoning_effort).
|
|
789
|
+
thinkingSchema: "reasoningEffort",
|
|
790
|
+
// Pinned the LOWER tier [0, 32K) per bigmodel.cn/pricing
|
|
791
|
+
// 2026-08-18. USD mirrors the CNY/7 ratio with 2-decimal
|
|
792
|
+
// rounding (matches glm-4.5v's USD rounding style).
|
|
793
|
+
pricingUSD: { input: 0.14, output: 0.42, cacheRead: 0.028 },
|
|
794
|
+
pricingCNY: { input: 1, output: 3, cacheRead: 0.2 },
|
|
795
|
+
// Tier boundary is 128K (vs glm-4.5v's 64K), so a
|
|
796
|
+
// `medium` tier tag is still appropriate — the 4.6V is
|
|
797
|
+
// cheaper than glm-4.5v but not a "low" tier like the
|
|
798
|
+
// 0.5/3/0.1 flashx family.
|
|
540
799
|
priceCategory: "medium",
|
|
541
800
|
maxInputTokens: 128e3,
|
|
542
801
|
maxOutputTokens: 8192
|
|
543
802
|
},
|
|
544
803
|
"glm-5v-turbo": {
|
|
545
|
-
detail: "GLM-5V Turbo \u2014 \u591A\u6A21\u6001 Coding \u6A21\u578B",
|
|
804
|
+
detail: "GLM-5V Turbo \u2014 \u591A\u6A21\u6001 Coding \u6A21\u578B\uFF082-tier pricing\uFF09",
|
|
546
805
|
imageInput: true,
|
|
547
806
|
toolCalling: true,
|
|
548
|
-
|
|
549
|
-
|
|
807
|
+
// Thinking switch (listed in the official ChatThinking doc's
|
|
808
|
+
// auto-think family; no reasoning_effort).
|
|
809
|
+
thinkingSchema: "reasoningEffort",
|
|
810
|
+
// Pinned the LOWER tier per bigmodel.cn/pricing 2026-08-18:
|
|
811
|
+
// [0, 32K) — ¥5 input / ¥22 output / ¥1.2 cache hit
|
|
812
|
+
// [32K+) — ¥7 input / ¥26 output / ¥1.8 cache hit
|
|
813
|
+
// Vendor-published context: 200K / 128K max output.
|
|
814
|
+
pricingUSD: { input: 0.7, output: 3.08, cacheRead: 0.168 },
|
|
815
|
+
pricingCNY: { input: 5, output: 22, cacheRead: 1.2 },
|
|
550
816
|
priceCategory: "medium",
|
|
551
|
-
// Official model overview: 200K context / 128K max output
|
|
552
|
-
// (previously mis-set to 128K/8_192 — corrected 2026-07-27).
|
|
553
817
|
maxInputTokens: 2e5,
|
|
554
818
|
maxOutputTokens: 128e3
|
|
555
819
|
},
|
|
@@ -577,8 +841,15 @@ var PRIMARY_METADATA = {
|
|
|
577
841
|
// Official model page lists "🛠️ 工具调用: 可靠的工具调用能力,支持多步
|
|
578
842
|
// 任务分解与计划执行" as a core capability — was mis-set to false.
|
|
579
843
|
toolCalling: true,
|
|
580
|
-
//
|
|
581
|
-
|
|
844
|
+
// Per https://platform.stepfun.com/docs/zh/pricing/details
|
|
845
|
+
// (2026-08-18 fetched): ¥1.35 input / ¥8.1 output /
|
|
846
|
+
// ¥0.27 cache hit per 1M tokens, USD = $0.20 / $1.15 /
|
|
847
|
+
// $0.04 (StepFun is USD-billed at the same rate as CNY/7
|
|
848
|
+
// with small rounding per the official pricing page).
|
|
849
|
+
// USD values previously 0.189/1.134/0.038 — slightly off
|
|
850
|
+
// from the official page (rounding error from dividing CNY
|
|
851
|
+
// by hand), corrected.
|
|
852
|
+
pricingUSD: { input: 0.2, output: 1.15, cacheRead: 0.04 },
|
|
582
853
|
pricingCNY: { input: 1.35, output: 8.1, cacheRead: 0.27 },
|
|
583
854
|
priceCategory: "medium",
|
|
584
855
|
thinkingSchema: "reasoningEffort",
|
|
@@ -594,8 +865,13 @@ var PRIMARY_METADATA = {
|
|
|
594
865
|
// Official model page lists "🛠️ 工具调用: 可靠的 tools / tool_choice
|
|
595
866
|
// 调用能力" as a core capability — was mis-set to false.
|
|
596
867
|
toolCalling: true,
|
|
597
|
-
//
|
|
598
|
-
|
|
868
|
+
// Per https://platform.stepfun.com/docs/zh/pricing/details
|
|
869
|
+
// (2026-08-18 fetched): ¥0.7 input / ¥2.1 output /
|
|
870
|
+
// ¥0.14 cache hit per 1M tokens, USD = $0.10 / $0.30 /
|
|
871
|
+
// $0.02. USD values previously 0.098/0.294/0.02 — slightly
|
|
872
|
+
// off from the official page (rounding error), corrected
|
|
873
|
+
// to the exact published values.
|
|
874
|
+
pricingUSD: { input: 0.1, output: 0.3, cacheRead: 0.02 },
|
|
599
875
|
pricingCNY: { input: 0.7, output: 2.1, cacheRead: 0.14 },
|
|
600
876
|
priceCategory: "low",
|
|
601
877
|
thinkingSchema: "reasoningEffort",
|
|
@@ -606,9 +882,13 @@ var PRIMARY_METADATA = {
|
|
|
606
882
|
detail: "Step 1o Turbo Vision \u2014 \u89C6\u89C9\u6A21\u578B",
|
|
607
883
|
imageInput: true,
|
|
608
884
|
toolCalling: false,
|
|
609
|
-
//
|
|
610
|
-
|
|
611
|
-
|
|
885
|
+
// Per https://platform.stepfun.com/docs/zh/pricing/details
|
|
886
|
+
// (2026-08-18 fetched): ¥2.5 cache miss / ¥0.5 cache hit /
|
|
887
|
+
// ¥8 output per 1M tokens. USD = $0.357 / $0.071 / $1.143
|
|
888
|
+
// (CNY/7 with rounding). Cache hit was previously
|
|
889
|
+
// undocumented in the curated entry — added.
|
|
890
|
+
pricingUSD: { input: 0.357, output: 1.143, cacheRead: 0.071 },
|
|
891
|
+
pricingCNY: { input: 2.5, output: 8, cacheRead: 0.5 },
|
|
612
892
|
priceCategory: "low",
|
|
613
893
|
// Official model overview: 32K context window.
|
|
614
894
|
maxInputTokens: 32768,
|
|
@@ -648,8 +928,13 @@ var PRIMARY_METADATA = {
|
|
|
648
928
|
detail: "MiniMax M2.5 \u2014 229B MoE, SOTA \u7F16\u7A0B / Agent / \u529E\u516C\u751F\u4EA7\u529B\uFF08192K \u4E0A\u4E0B\u6587\uFF09",
|
|
649
929
|
imageInput: false,
|
|
650
930
|
toolCalling: true,
|
|
651
|
-
//
|
|
652
|
-
//
|
|
931
|
+
// Per https://minimax-ai.chat/pricing (M2.5 legacy line):
|
|
932
|
+
// ¥2.1 input / ¥8.4 output / ¥0.21 cache hit per 1M tokens;
|
|
933
|
+
// USD = $0.30 / $1.20 / $0.03 (cloudprice.net 2026-08-13).
|
|
934
|
+
// Cache hit IS the published rate — the previous comment
|
|
935
|
+
// "按官方 10% cache 命中率回填" was wrong (it implied we
|
|
936
|
+
// were estimating, when actually the cache rate is
|
|
937
|
+
// documented at ¥0.21 / $0.03 per 1M tokens).
|
|
653
938
|
pricingUSD: { input: 0.3, output: 1.2, cacheRead: 0.03 },
|
|
654
939
|
pricingCNY: { input: 2.1, output: 8.4, cacheRead: 0.21 },
|
|
655
940
|
priceCategory: "medium",
|
|
@@ -700,6 +985,20 @@ var NAMESPACE_ALIASES = {
|
|
|
700
985
|
// from the curated detail / pricing / capability columns.
|
|
701
986
|
"glm-4-flashx-250414": "glm-4-flashx"
|
|
702
987
|
};
|
|
988
|
+
var NAMESPACE_ALIAS_FAMILY = {
|
|
989
|
+
// SiliconFlow
|
|
990
|
+
"deepseek-ai/DeepSeek-V4-Pro": "SiliconFlow (aggregator)",
|
|
991
|
+
"deepseek-ai/DeepSeek-V4-Flash": "SiliconFlow (aggregator)",
|
|
992
|
+
"zai-org/GLM-5.2": "SiliconFlow (aggregator)",
|
|
993
|
+
"Qwen/Qwen3.6-35B-A3B": "SiliconFlow (aggregator)",
|
|
994
|
+
"moonshotai/Kimi-K2.7-Code": "SiliconFlow (aggregator)",
|
|
995
|
+
// Novita
|
|
996
|
+
"deepseek/deepseek-v4-pro": "Novita (aggregator)",
|
|
997
|
+
"deepseek/deepseek-v4-flash": "Novita (aggregator)",
|
|
998
|
+
"zai/glm-5.2": "Novita (aggregator)",
|
|
999
|
+
"zai/glm-5.1": "Novita (aggregator)",
|
|
1000
|
+
"moonshotai/kimi-k3": "Novita (aggregator)"
|
|
1001
|
+
};
|
|
703
1002
|
var MODEL_METADATA = (() => {
|
|
704
1003
|
const merged = {
|
|
705
1004
|
...PRIMARY_METADATA
|
|
@@ -718,10 +1017,28 @@ function lookupModelMetadata(modelId) {
|
|
|
718
1017
|
function currencyForBaseUrl(baseUrl) {
|
|
719
1018
|
try {
|
|
720
1019
|
const hostname = new URL(baseUrl).hostname.toLowerCase();
|
|
721
|
-
if (hostname === "api.minimaxi.com" || hostname === "api.minimaxi.cn" || hostname === "api.
|
|
1020
|
+
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
|
|
1021
|
+
// (`docs/references/GLM-for-copilot-main/src/endpoint.ts:4`)
|
|
1022
|
+
// this was retired to `bigmodel.cn` but is still
|
|
1023
|
+
// resolvable for accounts that haven't migrated — we
|
|
1024
|
+
// don't surface it in the baseUrl dropdown, but a user
|
|
1025
|
+
// may paste it from a saved settings.json, so the
|
|
1026
|
+
// currency has to match (CNY, same as the new host).
|
|
1027
|
+
hostname === "dev.bigmodel.cn") {
|
|
722
1028
|
return "CNY";
|
|
723
1029
|
}
|
|
724
|
-
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"
|
|
1030
|
+
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
|
|
1031
|
+
// official `bigmodel.cn/pricing` page (the CNY-billed
|
|
1032
|
+
// list is the China-domiciled `open.bigmodel.cn` only;
|
|
1033
|
+
// the international `api.z.ai` is USD regardless of
|
|
1034
|
+
// which apiMode / protocol path the user picked). The
|
|
1035
|
+
// GLM-for-copilot reference uses the same split
|
|
1036
|
+
// (`docs/references/GLM-for-copilot-main/src/endpoint.ts:160-173`).
|
|
1037
|
+
// Without this explicit entry, `api.z.ai` would still
|
|
1038
|
+
// resolve to USD via the catch-all below — adding it
|
|
1039
|
+
// here makes the intent grep-able and pins the host
|
|
1040
|
+
// list against accidental removal.
|
|
1041
|
+
hostname === "api.z.ai") {
|
|
725
1042
|
return "USD";
|
|
726
1043
|
}
|
|
727
1044
|
} catch {
|
|
@@ -730,13 +1047,14 @@ function currencyForBaseUrl(baseUrl) {
|
|
|
730
1047
|
}
|
|
731
1048
|
|
|
732
1049
|
// src/ai/providers.presets.ts
|
|
733
|
-
function buildPresetModel(id, displayName) {
|
|
1050
|
+
function buildPresetModel(id, displayName, baseUrl) {
|
|
734
1051
|
const meta = MODEL_METADATA[id];
|
|
735
1052
|
if (!meta) {
|
|
736
1053
|
throw new Error(
|
|
737
1054
|
`buildPresetModel: no curated MODEL_METADATA entry for '${id}' \u2014 add one before referencing it from BUILTIN_PROVIDER_PRESETS.`
|
|
738
1055
|
);
|
|
739
1056
|
}
|
|
1057
|
+
const currency = baseUrl ? currencyForBaseUrl(baseUrl) : "USD";
|
|
740
1058
|
return {
|
|
741
1059
|
id,
|
|
742
1060
|
displayName,
|
|
@@ -747,11 +1065,95 @@ function buildPresetModel(id, displayName) {
|
|
|
747
1065
|
supportsImageToText: meta.imageInput,
|
|
748
1066
|
supportsToolCalling: meta.toolCalling
|
|
749
1067
|
},
|
|
750
|
-
pricing: meta
|
|
1068
|
+
pricing: meta[`pricing${currency}`],
|
|
751
1069
|
priceCategory: meta.priceCategory,
|
|
752
1070
|
thinkingSchema: meta.thinkingSchema ?? "none"
|
|
753
1071
|
};
|
|
754
1072
|
}
|
|
1073
|
+
function unionProviderModelWithPreset(fetched, baseUrl) {
|
|
1074
|
+
const meta = MODEL_METADATA[fetched.id];
|
|
1075
|
+
if (!meta) {
|
|
1076
|
+
return fetched;
|
|
1077
|
+
}
|
|
1078
|
+
const currency = baseUrl ? currencyForBaseUrl(baseUrl) : "USD";
|
|
1079
|
+
const presetDisplayName = getPresetModelDisplayName(fetched.id);
|
|
1080
|
+
const displayName = typeof fetched.displayName === "string" && fetched.displayName.length > 0 ? fetched.displayName : presetDisplayName;
|
|
1081
|
+
return {
|
|
1082
|
+
// Spread fetched first so `id` wins, then overlay the
|
|
1083
|
+
// curated fields. (Curated fields ALWAYS win over fetched
|
|
1084
|
+
// per the precedence above — that's why they're explicit,
|
|
1085
|
+
// not relying on spread order.)
|
|
1086
|
+
...fetched,
|
|
1087
|
+
displayName,
|
|
1088
|
+
detail: meta.detail,
|
|
1089
|
+
capabilities: {
|
|
1090
|
+
supportsImageToText: meta.imageInput,
|
|
1091
|
+
supportsToolCalling: meta.toolCalling
|
|
1092
|
+
},
|
|
1093
|
+
pricing: meta[`pricing${currency}`],
|
|
1094
|
+
priceCategory: meta.priceCategory,
|
|
1095
|
+
// thinkingSchema: prefer preset (curated), fall back to
|
|
1096
|
+
// fetched (in case the API publishes a schema the
|
|
1097
|
+
// preset doesn't know about), then "none" to match
|
|
1098
|
+
// `buildPresetModel`'s explicit-none convention so the
|
|
1099
|
+
// picker renders identically for preset vs fetched rows.
|
|
1100
|
+
thinkingSchema: meta.thinkingSchema ?? fetched.thinkingSchema ?? "none",
|
|
1101
|
+
// Token caps: preset is curated; if the preset doesn't
|
|
1102
|
+
// publish a cap, keep whatever fetched supplied (the
|
|
1103
|
+
// user may have entered it by hand earlier).
|
|
1104
|
+
maxInputTokens: meta.maxInputTokens ?? fetched.maxInputTokens,
|
|
1105
|
+
maxOutputTokens: meta.maxOutputTokens ?? fetched.maxOutputTokens
|
|
1106
|
+
};
|
|
1107
|
+
}
|
|
1108
|
+
var PRESET_MODEL_FAMILIES = [
|
|
1109
|
+
"GLM",
|
|
1110
|
+
"DeepSeek",
|
|
1111
|
+
"Kimi",
|
|
1112
|
+
"StepFun",
|
|
1113
|
+
"MiniMax",
|
|
1114
|
+
"Agnes",
|
|
1115
|
+
"Qwen",
|
|
1116
|
+
"SiliconFlow (aggregator)",
|
|
1117
|
+
"Novita (aggregator)",
|
|
1118
|
+
"OpenRouter (aggregator)"
|
|
1119
|
+
];
|
|
1120
|
+
function vendorFamilyForId(id) {
|
|
1121
|
+
const aliasFamily = NAMESPACE_ALIAS_FAMILY[id];
|
|
1122
|
+
if (aliasFamily) return aliasFamily;
|
|
1123
|
+
if (id.startsWith("glm-")) return "GLM";
|
|
1124
|
+
if (id.startsWith("deepseek-")) return "DeepSeek";
|
|
1125
|
+
if (id.startsWith("kimi-")) return "Kimi";
|
|
1126
|
+
if (id.startsWith("step-")) return "StepFun";
|
|
1127
|
+
if (id.startsWith("MiniMax-")) return "MiniMax";
|
|
1128
|
+
if (id.startsWith("agnes-")) return "Agnes";
|
|
1129
|
+
if (id.startsWith("Qwen")) return "Qwen";
|
|
1130
|
+
if (id.startsWith("openrouter/")) return "OpenRouter (aggregator)";
|
|
1131
|
+
return "Other";
|
|
1132
|
+
}
|
|
1133
|
+
var LISTABLE_PRESET_MODELS = (() => {
|
|
1134
|
+
const aggregatorAliasKeys = new Set(Object.keys(NAMESPACE_ALIAS_FAMILY));
|
|
1135
|
+
const allIds = Object.keys(MODEL_METADATA).filter((id) => {
|
|
1136
|
+
if (NAMESPACE_ALIASES[id] === void 0) return true;
|
|
1137
|
+
return aggregatorAliasKeys.has(id);
|
|
1138
|
+
}).sort();
|
|
1139
|
+
return allIds.map((id) => ({
|
|
1140
|
+
id,
|
|
1141
|
+
displayName: id,
|
|
1142
|
+
vendorFamily: vendorFamilyForId(id)
|
|
1143
|
+
}));
|
|
1144
|
+
})();
|
|
1145
|
+
function listPresetModelGroups() {
|
|
1146
|
+
const byFamily = /* @__PURE__ */ new Map();
|
|
1147
|
+
for (const entry of LISTABLE_PRESET_MODELS) {
|
|
1148
|
+
const bucket = byFamily.get(entry.vendorFamily) ?? [];
|
|
1149
|
+
bucket.push(entry);
|
|
1150
|
+
byFamily.set(entry.vendorFamily, bucket);
|
|
1151
|
+
}
|
|
1152
|
+
return PRESET_MODEL_FAMILIES.filter((f) => byFamily.has(f)).map((family) => ({
|
|
1153
|
+
family,
|
|
1154
|
+
entries: byFamily.get(family) ?? []
|
|
1155
|
+
}));
|
|
1156
|
+
}
|
|
755
1157
|
var BUILTIN_PROVIDER_PRESETS = {
|
|
756
1158
|
minimax: {
|
|
757
1159
|
displayName: "MiniMax",
|
|
@@ -777,14 +1179,18 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
777
1179
|
// (otherwise the user's added model never shows up in the
|
|
778
1180
|
// Copilot Chat picker).
|
|
779
1181
|
models: [
|
|
780
|
-
buildPresetModel("MiniMax-M3", "MiniMax-M3"),
|
|
781
|
-
buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7"),
|
|
782
|
-
buildPresetModel(
|
|
1182
|
+
buildPresetModel("MiniMax-M3", "MiniMax-M3", "https://api.minimaxi.com/anthropic"),
|
|
1183
|
+
buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7", "https://api.minimaxi.com/anthropic"),
|
|
1184
|
+
buildPresetModel(
|
|
1185
|
+
"MiniMax-M2.7-highspeed",
|
|
1186
|
+
"MiniMax-M2.7-highspeed",
|
|
1187
|
+
"https://api.minimaxi.com/anthropic"
|
|
1188
|
+
),
|
|
783
1189
|
// M2.5 (2026-02-13, 80.2% SWE-Bench Verified) — the
|
|
784
1190
|
// predecessor of M2.7. Still in the catalog and often
|
|
785
1191
|
// available on MiniMax's promotional $0.30/$1.20 rate, so
|
|
786
1192
|
// keep it as a preset for users on the M2.5 plan tier.
|
|
787
|
-
buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5")
|
|
1193
|
+
buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5", "https://api.minimaxi.com/anthropic")
|
|
788
1194
|
]
|
|
789
1195
|
},
|
|
790
1196
|
deepseek: {
|
|
@@ -806,8 +1212,8 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
806
1212
|
// the recommended default — users still on V3 can override
|
|
807
1213
|
// these defaults in the ProvidersTab form.
|
|
808
1214
|
models: [
|
|
809
|
-
buildPresetModel("deepseek-v4-flash", "DeepSeek V4 Flash"),
|
|
810
|
-
buildPresetModel("deepseek-v4-pro", "DeepSeek V4 Pro")
|
|
1215
|
+
buildPresetModel("deepseek-v4-flash", "DeepSeek V4 Flash", "https://api.deepseek.com/v1"),
|
|
1216
|
+
buildPresetModel("deepseek-v4-pro", "DeepSeek V4 Pro", "https://api.deepseek.com/v1")
|
|
811
1217
|
]
|
|
812
1218
|
},
|
|
813
1219
|
agnes: {
|
|
@@ -815,19 +1221,34 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
815
1221
|
// Sapiens AI's Agnes — OpenAI-compatible endpoint per
|
|
816
1222
|
// https://wiki.agnes-ai.com (`POST /v1/chat/completions`).
|
|
817
1223
|
baseUrl: "https://apihub.agnes-ai.com/v1",
|
|
1224
|
+
// Order mirrors the vendor docs index (wiki.agnes-ai.com,
|
|
1225
|
+
// fetched 2026-08-19): paid reasoning models first — the
|
|
1226
|
+
// commercial stable `agnes-2.5-pro` leads, then the
|
|
1227
|
+
// benchmark-listed alpha — followed by the flash tier
|
|
1228
|
+
// newest-first.
|
|
818
1229
|
models: [
|
|
819
|
-
buildPresetModel("agnes-2.5-pro
|
|
820
|
-
buildPresetModel(
|
|
1230
|
+
buildPresetModel("agnes-2.5-pro", "Agnes 2.5 Pro", "https://apihub.agnes-ai.com/v1"),
|
|
1231
|
+
buildPresetModel(
|
|
1232
|
+
"agnes-2.5-pro-alpha",
|
|
1233
|
+
"Agnes 2.5 Pro Alpha",
|
|
1234
|
+
"https://apihub.agnes-ai.com/v1"
|
|
1235
|
+
),
|
|
1236
|
+
buildPresetModel("agnes-2.5-flash", "Agnes 2.5 Flash", "https://apihub.agnes-ai.com/v1"),
|
|
1237
|
+
buildPresetModel("agnes-2.0-flash", "Agnes 2.0 Flash", "https://apihub.agnes-ai.com/v1")
|
|
821
1238
|
]
|
|
822
1239
|
},
|
|
823
1240
|
kimi: {
|
|
824
1241
|
displayName: "Kimi",
|
|
825
1242
|
baseUrl: "https://api.moonshot.cn/v1",
|
|
826
1243
|
models: [
|
|
827
|
-
buildPresetModel("kimi-k3", "Kimi K3"),
|
|
828
|
-
buildPresetModel("kimi-k2.7-code", "Kimi K2.7 Code"),
|
|
829
|
-
buildPresetModel(
|
|
830
|
-
|
|
1244
|
+
buildPresetModel("kimi-k3", "Kimi K3", "https://api.moonshot.cn/v1"),
|
|
1245
|
+
buildPresetModel("kimi-k2.7-code", "Kimi K2.7 Code", "https://api.moonshot.cn/v1"),
|
|
1246
|
+
buildPresetModel(
|
|
1247
|
+
"kimi-k2.7-code-highspeed",
|
|
1248
|
+
"Kimi K2.7 Code HighSpeed",
|
|
1249
|
+
"https://api.moonshot.cn/v1"
|
|
1250
|
+
),
|
|
1251
|
+
buildPresetModel("kimi-k2.6", "Kimi K2.6", "https://api.moonshot.cn/v1")
|
|
831
1252
|
]
|
|
832
1253
|
},
|
|
833
1254
|
zhipu: {
|
|
@@ -899,24 +1320,28 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
899
1320
|
// `MODEL_METADATA` entries are kept so the id is still
|
|
900
1321
|
// resolvable for the curated detail / pricing columns.
|
|
901
1322
|
models: [
|
|
902
|
-
buildPresetModel("glm-5.3", "GLM-5.3"),
|
|
903
|
-
buildPresetModel("glm-5.2", "GLM-5.2"),
|
|
904
|
-
buildPresetModel("glm-5.1", "GLM-5.1"),
|
|
905
|
-
buildPresetModel("glm-5", "GLM-5"),
|
|
906
|
-
buildPresetModel("glm-5-turbo", "GLM-5 Turbo"),
|
|
907
|
-
buildPresetModel("glm-4.7", "GLM-4.7"),
|
|
908
|
-
buildPresetModel("glm-4.6", "GLM-4.6"),
|
|
909
|
-
buildPresetModel("glm-4.5-air", "GLM-4.5 Air"),
|
|
910
|
-
buildPresetModel("glm-4.5", "GLM-4.5")
|
|
1323
|
+
buildPresetModel("glm-5.3", "GLM-5.3", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1324
|
+
buildPresetModel("glm-5.2", "GLM-5.2", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1325
|
+
buildPresetModel("glm-5.1", "GLM-5.1", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1326
|
+
buildPresetModel("glm-5", "GLM-5", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1327
|
+
buildPresetModel("glm-5-turbo", "GLM-5 Turbo", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1328
|
+
buildPresetModel("glm-4.7", "GLM-4.7", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1329
|
+
buildPresetModel("glm-4.6", "GLM-4.6", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1330
|
+
buildPresetModel("glm-4.5-air", "GLM-4.5 Air", "https://open.bigmodel.cn/api/paas/v4"),
|
|
1331
|
+
buildPresetModel("glm-4.5", "GLM-4.5", "https://open.bigmodel.cn/api/paas/v4")
|
|
911
1332
|
]
|
|
912
1333
|
},
|
|
913
1334
|
stepfun: {
|
|
914
1335
|
displayName: "StepFun",
|
|
915
1336
|
baseUrl: "https://api.stepfun.com/v1",
|
|
916
1337
|
models: [
|
|
917
|
-
buildPresetModel("step-3.7-flash", "Step 3.7 Flash"),
|
|
918
|
-
buildPresetModel("step-3.5-flash", "Step 3.5 Flash"),
|
|
919
|
-
buildPresetModel(
|
|
1338
|
+
buildPresetModel("step-3.7-flash", "Step 3.7 Flash", "https://api.stepfun.com/v1"),
|
|
1339
|
+
buildPresetModel("step-3.5-flash", "Step 3.5 Flash", "https://api.stepfun.com/v1"),
|
|
1340
|
+
buildPresetModel(
|
|
1341
|
+
"step-1o-turbo-vision",
|
|
1342
|
+
"Step 1o Turbo Vision",
|
|
1343
|
+
"https://api.stepfun.com/v1"
|
|
1344
|
+
)
|
|
920
1345
|
]
|
|
921
1346
|
},
|
|
922
1347
|
siliconflow: {
|
|
@@ -930,20 +1355,42 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
930
1355
|
// 与 MODEL_METADATA 的 alias 严格一致。
|
|
931
1356
|
models: [
|
|
932
1357
|
// DeepSeek V4 系列 (2026-04)
|
|
933
|
-
buildPresetModel(
|
|
934
|
-
|
|
1358
|
+
buildPresetModel(
|
|
1359
|
+
"deepseek-ai/DeepSeek-V4-Pro",
|
|
1360
|
+
"DeepSeek V4 Pro (via SiliconFlow)",
|
|
1361
|
+
"https://api.siliconflow.cn/v1"
|
|
1362
|
+
),
|
|
1363
|
+
buildPresetModel(
|
|
1364
|
+
"deepseek-ai/DeepSeek-V4-Flash",
|
|
1365
|
+
"DeepSeek V4 Flash (via SiliconFlow)",
|
|
1366
|
+
"https://api.siliconflow.cn/v1"
|
|
1367
|
+
),
|
|
935
1368
|
// GLM-5.2 (2026-06-17) — open-weight 编程旗舰,1M context
|
|
936
|
-
buildPresetModel(
|
|
1369
|
+
buildPresetModel(
|
|
1370
|
+
"zai-org/GLM-5.2",
|
|
1371
|
+
"GLM-5.2 (via SiliconFlow)",
|
|
1372
|
+
"https://api.siliconflow.cn/v1"
|
|
1373
|
+
),
|
|
937
1374
|
// Qwen3.6-35B-A3B (2026-04) — 35B MoE, 3B 激活,"小而强"
|
|
938
|
-
buildPresetModel(
|
|
1375
|
+
buildPresetModel(
|
|
1376
|
+
"Qwen/Qwen3.6-35B-A3B",
|
|
1377
|
+
"Qwen3.6-35B-A3B (via SiliconFlow)",
|
|
1378
|
+
"https://api.siliconflow.cn/v1"
|
|
1379
|
+
),
|
|
939
1380
|
// Kimi K2.7-Code (2026-06-12) — Moonshot coding 旗舰
|
|
940
|
-
buildPresetModel(
|
|
1381
|
+
buildPresetModel(
|
|
1382
|
+
"moonshotai/Kimi-K2.7-Code",
|
|
1383
|
+
"Kimi K2.7 Code (via SiliconFlow)",
|
|
1384
|
+
"https://api.siliconflow.cn/v1"
|
|
1385
|
+
)
|
|
941
1386
|
]
|
|
942
1387
|
},
|
|
943
1388
|
openrouter: {
|
|
944
1389
|
displayName: "OpenRouter",
|
|
945
1390
|
baseUrl: "https://openrouter.ai/api/v1",
|
|
946
|
-
models: [
|
|
1391
|
+
models: [
|
|
1392
|
+
buildPresetModel("openrouter/auto", "OpenRouter Auto", "https://openrouter.ai/api/v1")
|
|
1393
|
+
]
|
|
947
1394
|
},
|
|
948
1395
|
novita: {
|
|
949
1396
|
displayName: "Novita",
|
|
@@ -955,16 +1402,76 @@ var BUILTIN_PROVIDER_PRESETS = {
|
|
|
955
1402
|
// 完整列表。id 严格匹配 Novita API 的 namespaced 字符串。
|
|
956
1403
|
models: [
|
|
957
1404
|
// DeepSeek V4 系列 (2026-04)
|
|
958
|
-
buildPresetModel(
|
|
959
|
-
|
|
1405
|
+
buildPresetModel(
|
|
1406
|
+
"deepseek/deepseek-v4-pro",
|
|
1407
|
+
"DeepSeek V4 Pro (via Novita)",
|
|
1408
|
+
"https://api.novita.ai/openai/v1"
|
|
1409
|
+
),
|
|
1410
|
+
buildPresetModel(
|
|
1411
|
+
"deepseek/deepseek-v4-flash",
|
|
1412
|
+
"DeepSeek V4 Flash (via Novita)",
|
|
1413
|
+
"https://api.novita.ai/openai/v1"
|
|
1414
|
+
),
|
|
960
1415
|
// GLM-5 系列 (2026-04/06)
|
|
961
|
-
buildPresetModel("zai/glm-5.2", "GLM-5.2 (via Novita)"),
|
|
962
|
-
buildPresetModel("zai/glm-5.1", "GLM-5.1 (via Novita)"),
|
|
1416
|
+
buildPresetModel("zai/glm-5.2", "GLM-5.2 (via Novita)", "https://api.novita.ai/openai/v1"),
|
|
1417
|
+
buildPresetModel("zai/glm-5.1", "GLM-5.1 (via Novita)", "https://api.novita.ai/openai/v1"),
|
|
963
1418
|
// Kimi K3 (2026-07-16 API, 2026-07-27 开源) — 1M context, 2.8T MoE
|
|
964
|
-
buildPresetModel(
|
|
1419
|
+
buildPresetModel(
|
|
1420
|
+
"moonshotai/kimi-k3",
|
|
1421
|
+
"Kimi K3 (via Novita)",
|
|
1422
|
+
"https://api.novita.ai/openai/v1"
|
|
1423
|
+
)
|
|
965
1424
|
]
|
|
1425
|
+
},
|
|
1426
|
+
medalsoft: {
|
|
1427
|
+
displayName: "Medalsoft",
|
|
1428
|
+
// Medalsoft internal LLM gateway (公司内部代理) — OpenAI-compatible
|
|
1429
|
+
// `/v1/chat/completions`. The gateway forwards to upstream vendors
|
|
1430
|
+
// (GLM / DeepSeek / Kimi / ...), so the model catalogue is dynamic
|
|
1431
|
+
// and NOT curated here: the preset ships an EMPTY starter list and
|
|
1432
|
+
// the user populates it via "Fetch from API" (`GET /v1/models`) in
|
|
1433
|
+
// the ProvidersTab. `buildPresetModel`'s fail-loudly contract is
|
|
1434
|
+
// why we don't guess ids — a curated `MODEL_METADATA` entry only
|
|
1435
|
+
// exists for vendor-native ids, not the gateway's routing table.
|
|
1436
|
+
//
|
|
1437
|
+
// NOTE: models fetched from the gateway carry the upstream model
|
|
1438
|
+
// ids, so the curated metadata (pricing / thinking dropdown /
|
|
1439
|
+
// token caps) still resolves via `MODEL_METADATA` after the fetch.
|
|
1440
|
+
baseUrl: "https://llm.proxy.alio.wang/v1",
|
|
1441
|
+
models: []
|
|
966
1442
|
}
|
|
967
1443
|
};
|
|
1444
|
+
var PRESET_MODEL_DISPLAY_NAMES = (() => {
|
|
1445
|
+
const map = {};
|
|
1446
|
+
for (const preset of Object.values(BUILTIN_PROVIDER_PRESETS)) {
|
|
1447
|
+
for (const model of preset.models) {
|
|
1448
|
+
if (model.displayName !== void 0) {
|
|
1449
|
+
map[model.id] = model.displayName;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
return Object.freeze(map);
|
|
1454
|
+
})();
|
|
1455
|
+
function getPresetModelDisplayName(id) {
|
|
1456
|
+
const explicit = PRESET_MODEL_DISPLAY_NAMES[id];
|
|
1457
|
+
if (explicit !== void 0) {
|
|
1458
|
+
return explicit;
|
|
1459
|
+
}
|
|
1460
|
+
const meta = MODEL_METADATA[id];
|
|
1461
|
+
if (meta === void 0) {
|
|
1462
|
+
return void 0;
|
|
1463
|
+
}
|
|
1464
|
+
const detail = meta.detail;
|
|
1465
|
+
if (typeof detail !== "string" || detail.trim() === "") {
|
|
1466
|
+
return void 0;
|
|
1467
|
+
}
|
|
1468
|
+
const dashIndex = detail.indexOf(" \u2014 ");
|
|
1469
|
+
if (dashIndex === -1) {
|
|
1470
|
+
return detail;
|
|
1471
|
+
}
|
|
1472
|
+
const head = detail.slice(0, dashIndex).trim();
|
|
1473
|
+
return head === "" ? void 0 : head;
|
|
1474
|
+
}
|
|
968
1475
|
function getBuiltinProviderPreset(type) {
|
|
969
1476
|
switch (type) {
|
|
970
1477
|
case "minimax":
|
|
@@ -976,6 +1483,7 @@ function getBuiltinProviderPreset(type) {
|
|
|
976
1483
|
case "siliconflow":
|
|
977
1484
|
case "openrouter":
|
|
978
1485
|
case "novita":
|
|
1486
|
+
case "medalsoft":
|
|
979
1487
|
return BUILTIN_PROVIDER_PRESETS[type];
|
|
980
1488
|
default:
|
|
981
1489
|
return null;
|
|
@@ -1399,6 +1907,8 @@ var WebviewMessageType = /* @__PURE__ */ ((WebviewMessageType2) => {
|
|
|
1399
1907
|
WebviewMessageType2["SetProviderOrder"] = "setProviderOrder";
|
|
1400
1908
|
WebviewMessageType2["TestProvider"] = "testProvider";
|
|
1401
1909
|
WebviewMessageType2["ProviderTestResultMessage"] = "providerTestResult";
|
|
1910
|
+
WebviewMessageType2["TestProviderModel"] = "testProviderModel";
|
|
1911
|
+
WebviewMessageType2["ProviderTestModelResultMessage"] = "providerTestModelResult";
|
|
1402
1912
|
WebviewMessageType2["DefaultProviderChanged"] = "defaultProviderChanged";
|
|
1403
1913
|
WebviewMessageType2["FetchProviderModels"] = "fetchProviderModels";
|
|
1404
1914
|
WebviewMessageType2["FetchProviderModelsResult"] = "fetchProviderModelsResult";
|
|
@@ -1490,8 +2000,12 @@ function safeJson(text, fallback) {
|
|
|
1490
2000
|
GetCachedServerUrl,
|
|
1491
2001
|
GetServerProxyState,
|
|
1492
2002
|
GetUtilityModels,
|
|
2003
|
+
LISTABLE_PRESET_MODELS,
|
|
1493
2004
|
LogLevel,
|
|
1494
2005
|
MODEL_METADATA,
|
|
2006
|
+
NAMESPACE_ALIASES,
|
|
2007
|
+
NAMESPACE_ALIAS_FAMILY,
|
|
2008
|
+
PRESET_MODEL_FAMILIES,
|
|
1495
2009
|
PROVIDER_BASE_URL_PRESETS,
|
|
1496
2010
|
PROVIDER_CACHE_CONTROL_METADATA,
|
|
1497
2011
|
ServerProxyStateResponse,
|
|
@@ -1504,21 +2018,27 @@ function safeJson(text, fallback) {
|
|
|
1504
2018
|
__internal,
|
|
1505
2019
|
asAbortSignal,
|
|
1506
2020
|
buildGitHubLocalEmail,
|
|
2021
|
+
buildPresetModel,
|
|
1507
2022
|
checkGitHubOrgMembership,
|
|
1508
2023
|
createConsoleLogger,
|
|
1509
2024
|
currencyForBaseUrl,
|
|
2025
|
+
effectiveAdapterType,
|
|
1510
2026
|
fetchGitHubUser,
|
|
1511
2027
|
getBuiltinProviderPreset,
|
|
1512
2028
|
getGitHubOrgMembership,
|
|
2029
|
+
getPresetModelDisplayName,
|
|
1513
2030
|
getProviderBaseUrlPresets,
|
|
1514
2031
|
isGitHubLocalEmail,
|
|
1515
2032
|
isProviderCacheControlAware,
|
|
1516
2033
|
isValidCanonicalSlug,
|
|
2034
|
+
listPresetModelGroups,
|
|
1517
2035
|
lookupModelMetadata,
|
|
1518
2036
|
normalizeCanonicalSlug,
|
|
1519
2037
|
normalizeErrorForLog,
|
|
1520
2038
|
normalizeGitUrl,
|
|
1521
2039
|
parsePayload,
|
|
2040
|
+
protocolForBaseUrl,
|
|
1522
2041
|
resolvePrimaryEmail,
|
|
1523
|
-
safeJson
|
|
2042
|
+
safeJson,
|
|
2043
|
+
unionProviderModelWithPreset
|
|
1524
2044
|
});
|