@lobehub/chat 1.133.2 → 1.133.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/.github/workflows/claude-translator.yml +2 -3
  2. package/.github/workflows/issue-auto-comments.yml +4 -9
  3. package/.github/workflows/issue-close-require.yml +3 -6
  4. package/CHANGELOG.md +66 -0
  5. package/changelog/v1.json +24 -0
  6. package/locales/ar/image.json +7 -0
  7. package/locales/ar/models.json +1 -1
  8. package/locales/bg-BG/image.json +7 -0
  9. package/locales/de-DE/image.json +7 -0
  10. package/locales/en-US/image.json +7 -0
  11. package/locales/es-ES/image.json +7 -0
  12. package/locales/es-ES/tool.json +1 -1
  13. package/locales/fa-IR/image.json +7 -0
  14. package/locales/fa-IR/models.json +1 -1
  15. package/locales/fr-FR/image.json +7 -0
  16. package/locales/fr-FR/models.json +1 -1
  17. package/locales/it-IT/image.json +7 -0
  18. package/locales/ja-JP/image.json +7 -0
  19. package/locales/ko-KR/image.json +7 -0
  20. package/locales/nl-NL/image.json +7 -0
  21. package/locales/pl-PL/image.json +7 -0
  22. package/locales/pt-BR/image.json +7 -0
  23. package/locales/ru-RU/image.json +7 -0
  24. package/locales/ru-RU/tool.json +1 -1
  25. package/locales/tr-TR/image.json +7 -0
  26. package/locales/tr-TR/models.json +1 -1
  27. package/locales/vi-VN/image.json +7 -0
  28. package/locales/zh-CN/image.json +7 -0
  29. package/locales/zh-TW/image.json +7 -0
  30. package/package.json +4 -5
  31. package/packages/const/package.json +4 -0
  32. package/packages/const/src/currency.ts +2 -0
  33. package/packages/const/src/index.ts +1 -0
  34. package/packages/model-bank/package.json +2 -1
  35. package/packages/model-bank/src/aiModels/aihubmix.ts +34 -1
  36. package/packages/model-bank/src/aiModels/anthropic.ts +3 -64
  37. package/packages/model-bank/src/aiModels/google.ts +6 -0
  38. package/packages/model-bank/src/aiModels/novita.ts +2 -2
  39. package/packages/model-bank/src/aiModels/openai.ts +6 -22
  40. package/packages/model-bank/src/aiModels/qwen.ts +21 -0
  41. package/packages/model-bank/src/aiModels/zhipu.ts +255 -62
  42. package/packages/model-bank/src/standard-parameters/index.ts +56 -46
  43. package/packages/model-runtime/package.json +1 -0
  44. package/packages/model-runtime/src/core/RouterRuntime/createRuntime.ts +4 -2
  45. package/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.ts +12 -2
  46. package/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts +16 -5
  47. package/packages/model-runtime/src/core/streams/anthropic.ts +25 -36
  48. package/packages/model-runtime/src/core/streams/google/google-ai.test.ts +1 -1
  49. package/packages/model-runtime/src/core/streams/google/index.ts +18 -42
  50. package/packages/model-runtime/src/core/streams/openai/openai.test.ts +7 -10
  51. package/packages/model-runtime/src/core/streams/openai/openai.ts +14 -11
  52. package/packages/model-runtime/src/core/streams/openai/responsesStream.ts +11 -5
  53. package/packages/model-runtime/src/core/streams/protocol.ts +25 -6
  54. package/packages/model-runtime/src/core/streams/qwen.ts +2 -2
  55. package/packages/model-runtime/src/core/streams/spark.ts +3 -3
  56. package/packages/model-runtime/src/core/streams/vertex-ai.test.ts +2 -2
  57. package/packages/model-runtime/src/core/streams/vertex-ai.ts +14 -23
  58. package/packages/model-runtime/src/core/usageConverters/anthropic.test.ts +99 -0
  59. package/packages/model-runtime/src/core/usageConverters/anthropic.ts +73 -0
  60. package/packages/model-runtime/src/core/usageConverters/google-ai.test.ts +88 -0
  61. package/packages/model-runtime/src/core/usageConverters/google-ai.ts +55 -0
  62. package/packages/model-runtime/src/core/usageConverters/index.ts +4 -0
  63. package/packages/model-runtime/src/core/usageConverters/openai.test.ts +429 -0
  64. package/packages/model-runtime/src/core/usageConverters/openai.ts +152 -0
  65. package/packages/model-runtime/src/core/usageConverters/utils/computeChatCost.test.ts +455 -0
  66. package/packages/model-runtime/src/core/usageConverters/utils/computeChatCost.ts +293 -0
  67. package/packages/model-runtime/src/core/usageConverters/utils/computeImageCost.test.ts +47 -0
  68. package/packages/model-runtime/src/core/usageConverters/utils/computeImageCost.ts +121 -0
  69. package/packages/model-runtime/src/core/usageConverters/utils/index.ts +11 -0
  70. package/packages/model-runtime/src/core/usageConverters/utils/withUsageCost.ts +19 -0
  71. package/packages/model-runtime/src/index.ts +2 -0
  72. package/packages/model-runtime/src/providers/anthropic/index.test.ts +0 -12
  73. package/packages/model-runtime/src/providers/anthropic/index.ts +48 -1
  74. package/packages/model-runtime/src/providers/google/createImage.ts +11 -2
  75. package/packages/model-runtime/src/providers/google/index.ts +8 -1
  76. package/packages/model-runtime/src/providers/novita/index.ts +2 -1
  77. package/packages/model-runtime/src/providers/novita/type.ts +4 -0
  78. package/packages/model-runtime/src/providers/ollamacloud/index.ts +1 -1
  79. package/packages/model-runtime/src/providers/openai/__snapshots__/index.test.ts.snap +7 -0
  80. package/packages/model-runtime/src/providers/openrouter/index.ts +11 -4
  81. package/packages/model-runtime/src/providers/zhipu/index.ts +3 -1
  82. package/packages/model-runtime/src/types/chat.ts +5 -3
  83. package/packages/model-runtime/src/types/image.ts +20 -9
  84. package/packages/model-runtime/src/utils/getModelPricing.ts +36 -0
  85. package/packages/obervability-otel/package.json +2 -2
  86. package/packages/ssrf-safe-fetch/index.test.ts +343 -0
  87. package/packages/ssrf-safe-fetch/index.ts +37 -0
  88. package/packages/ssrf-safe-fetch/package.json +17 -0
  89. package/packages/ssrf-safe-fetch/vitest.config.mts +10 -0
  90. package/packages/types/src/message/base.ts +43 -17
  91. package/packages/utils/package.json +0 -1
  92. package/packages/utils/src/client/apiKeyManager.test.ts +70 -0
  93. package/packages/utils/src/client/apiKeyManager.ts +41 -0
  94. package/packages/utils/src/client/index.ts +2 -0
  95. package/packages/utils/src/fetch/fetchSSE.ts +4 -4
  96. package/packages/utils/src/index.ts +1 -0
  97. package/packages/utils/src/toolManifest.ts +2 -1
  98. package/src/app/(backend)/webapi/proxy/route.ts +2 -13
  99. package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatMinimap/index.tsx +51 -23
  100. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/QualitySelect.tsx +23 -0
  101. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/index.tsx +9 -0
  102. package/src/config/modelProviders/anthropic.ts +0 -30
  103. package/src/config/modelProviders/ollamacloud.ts +1 -0
  104. package/src/config/modelProviders/zhipu.ts +4 -21
  105. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.test.ts +13 -13
  106. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.ts +1 -1
  107. package/src/features/Conversation/components/WideScreenContainer/index.tsx +3 -0
  108. package/src/locales/default/image.ts +7 -0
  109. package/src/server/modules/EdgeConfig/index.ts +1 -1
  110. package/src/server/routers/async/image.ts +9 -1
  111. package/src/services/_auth.ts +12 -12
  112. package/src/services/chat/contextEngineering.ts +2 -3
@@ -22,7 +22,7 @@ const anthropicChatModels: AIChatModelCard[] = [
22
22
  { name: 'textInput_cacheWrite', rate: 3.75, strategy: 'fixed', unit: 'millionTokens' },
23
23
  ],
24
24
  },
25
- releasedAt: '2025-09-30',
25
+ releasedAt: '2025-09-29',
26
26
  settings: {
27
27
  extendParams: ['disableContextCaching', 'enableReasoning', 'reasoningBudgetToken'],
28
28
  searchImpl: 'params',
@@ -107,7 +107,6 @@ const anthropicChatModels: AIChatModelCard[] = [
107
107
  description:
108
108
  'Claude Sonnet 4 可以产生近乎即时的响应或延长的逐步思考,用户可以清晰地看到这些过程。API 用户还可以对模型思考的时间进行细致的控制',
109
109
  displayName: 'Claude Sonnet 4',
110
- enabled: true,
111
110
  id: 'claude-sonnet-4-20250514',
112
111
  maxOutput: 64_000,
113
112
  pricing: {
@@ -172,7 +171,7 @@ const anthropicChatModels: AIChatModelCard[] = [
172
171
  contextWindowTokens: 200_000,
173
172
  description:
174
173
  'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
175
- displayName: 'Claude 3.5 Sonnet v2',
174
+ displayName: 'Claude 3.5 Sonnet (New)',
176
175
  id: 'claude-3-5-sonnet-20241022',
177
176
  maxOutput: 8192,
178
177
  pricing: {
@@ -203,7 +202,7 @@ const anthropicChatModels: AIChatModelCard[] = [
203
202
  contextWindowTokens: 200_000,
204
203
  description:
205
204
  'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
206
- displayName: 'Claude 3.5 Sonnet',
205
+ displayName: 'Claude 3.5 Sonnet (Old)',
207
206
  id: 'claude-3-5-sonnet-20240620',
208
207
  maxOutput: 8192,
209
208
  pricing: {
@@ -235,7 +234,6 @@ const anthropicChatModels: AIChatModelCard[] = [
235
234
  description:
236
235
  'Claude 3.5 Haiku 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.5 Haiku 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。',
237
236
  displayName: 'Claude 3.5 Haiku',
238
- enabled: true,
239
237
  id: 'claude-3-5-haiku-20241022',
240
238
  maxOutput: 8192,
241
239
  pricing: {
@@ -287,33 +285,6 @@ const anthropicChatModels: AIChatModelCard[] = [
287
285
  },
288
286
  type: 'chat',
289
287
  },
290
- {
291
- abilities: {
292
- functionCall: true,
293
- vision: true,
294
- },
295
- contextWindowTokens: 200_000,
296
- description:
297
- 'Claude 3 Sonnet 在智能和速度方面为企业工作负载提供了理想的平衡。它以更低的价格提供最大效用,可靠且适合大规模部署。',
298
- displayName: 'Claude 3 Sonnet',
299
- id: 'claude-3-sonnet-20240229', // 弃用日期 2025年7月21日
300
- maxOutput: 4096,
301
- pricing: {
302
- units: [
303
- { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
304
- { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
305
- { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
306
- {
307
- lookup: { prices: { '1h': 6, '5m': 3.75 }, pricingParams: ['ttl'] },
308
- name: 'textInput_cacheWrite',
309
- strategy: 'lookup',
310
- unit: 'millionTokens',
311
- },
312
- ],
313
- },
314
- releasedAt: '2024-02-29',
315
- type: 'chat',
316
- },
317
288
  {
318
289
  abilities: {
319
290
  functionCall: true,
@@ -344,38 +315,6 @@ const anthropicChatModels: AIChatModelCard[] = [
344
315
  },
345
316
  type: 'chat',
346
317
  },
347
- {
348
- contextWindowTokens: 200_000,
349
- description:
350
- 'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
351
- displayName: 'Claude 2.1',
352
- id: 'claude-2.1', // 弃用日期 2025年7月21日
353
- maxOutput: 4096,
354
- pricing: {
355
- units: [
356
- { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
357
- { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
358
- ],
359
- },
360
- releasedAt: '2023-11-21',
361
- type: 'chat',
362
- },
363
- {
364
- contextWindowTokens: 100_000,
365
- description:
366
- 'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
367
- displayName: 'Claude 2.0',
368
- id: 'claude-2.0', // 弃用日期 2025年7月21日
369
- maxOutput: 4096,
370
- pricing: {
371
- units: [
372
- { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
373
- { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
374
- ],
375
- },
376
- releasedAt: '2023-07-11',
377
- type: 'chat',
378
- },
379
318
  ];
380
319
 
381
320
  export const allModels = [...anthropicChatModels];
@@ -1,6 +1,11 @@
1
1
  import { CHAT_MODEL_IMAGE_GENERATION_PARAMS, ModelParamsSchema } from '../standard-parameters';
2
2
  import { AIChatModelCard, AIImageModelCard } from '../types';
3
3
 
4
+ /**
5
+ * gemini implicit caching not extra cost
6
+ * https://openrouter.ai/docs/features/prompt-caching#implicit-caching
7
+ */
8
+
4
9
  const googleChatModels: AIChatModelCard[] = [
5
10
  {
6
11
  abilities: {
@@ -233,6 +238,7 @@ const googleChatModels: AIChatModelCard[] = [
233
238
  pricing: {
234
239
  units: [
235
240
  { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
241
+ { name: 'imageInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
236
242
  { name: 'textOutput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
237
243
  { name: 'imageOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
238
244
  ],
@@ -30,8 +30,8 @@ const novitaChatModels: AIChatModelCard[] = [
30
30
  maxOutput: 32_768,
31
31
  pricing: {
32
32
  units: [
33
- { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
34
- { name: 'textOutput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
33
+ { name: 'textInput', rate: 0.98, strategy: 'fixed', unit: 'millionTokens' },
34
+ { name: 'textOutput', rate: 3.95, strategy: 'fixed', unit: 'millionTokens' },
35
35
  ],
36
36
  },
37
37
  type: 'chat',
@@ -26,8 +26,7 @@ export const openaiChatModels: AIChatModelCard[] = [
26
26
  vision: true,
27
27
  },
28
28
  contextWindowTokens: 400_000,
29
- description:
30
- 'GPT-5 Codex 是一个针对 Codex 或类似环境中的代理编码任务优化的 GPT-5 版本。',
29
+ description: 'GPT-5 Codex 是一个针对 Codex 或类似环境中的代理编码任务优化的 GPT-5 版本。',
31
30
  displayName: 'GPT-5 Codex',
32
31
  id: 'gpt-5-codex',
33
32
  maxOutput: 128_000,
@@ -1047,25 +1046,6 @@ export const openaiImageModels: AIImageModelCard[] = [
1047
1046
  { name: 'imageInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
1048
1047
  { name: 'imageInput_cacheRead', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
1049
1048
  { name: 'imageOutput', rate: 40, strategy: 'fixed', unit: 'millionTokens' },
1050
- {
1051
- lookup: {
1052
- prices: {
1053
- low_1024x1024: 0.011,
1054
- low_1024x1536: 0.016,
1055
- low_1536x1024: 0.016,
1056
- medium_1024x1024: 0.042,
1057
- medium_1024x1536: 0.063,
1058
- medium_1536x1024: 0.063,
1059
- high_1024x1024: 0.167,
1060
- high_1024x1536: 0.25,
1061
- high_1536x1024: 0.25,
1062
- },
1063
- pricingParams: ['quality', 'size'],
1064
- },
1065
- name: 'imageGeneration',
1066
- strategy: 'lookup',
1067
- unit: 'image',
1068
- },
1069
1049
  ],
1070
1050
  },
1071
1051
  resolutions: ['1024x1024', '1024x1536', '1536x1024'],
@@ -1078,6 +1058,10 @@ export const openaiImageModels: AIImageModelCard[] = [
1078
1058
  id: 'dall-e-3',
1079
1059
  parameters: {
1080
1060
  prompt: { default: '' },
1061
+ quality: {
1062
+ default: 'standard',
1063
+ enum: ['standard', 'hd'],
1064
+ },
1081
1065
  size: {
1082
1066
  default: '1024x1024',
1083
1067
  enum: ['1024x1024', '1792x1024', '1024x1792'],
@@ -1151,7 +1135,7 @@ export const openaiRealtimeModels: AIRealtimeModelCard[] = [
1151
1135
  description: '通用实时模型,支持文本与音频的实时输入输出,并支持图像输入。',
1152
1136
  displayName: 'GPT Realtime',
1153
1137
  id: 'gpt-realtime',
1154
- maxOutput: 4_096,
1138
+ maxOutput: 4096,
1155
1139
  pricing: {
1156
1140
  units: [
1157
1141
  { name: 'audioInput', rate: 32, strategy: 'fixed', unit: 'millionTokens' },
@@ -55,6 +55,27 @@ const qwenChatModels: AIChatModelCard[] = [
55
55
  },
56
56
  type: 'chat',
57
57
  },
58
+ {
59
+ abilities: {
60
+ reasoning: true,
61
+ },
62
+ contextWindowTokens: 131_072,
63
+ description: 'deepseek-v3.2-exp 引入稀疏注意力机制,旨在提升处理长文本时的训练与推理效率,价格低于 deepseek-v3.1。',
64
+ displayName: 'DeepSeek V3.2 Exp',
65
+ id: 'deepseek-v3.2-exp',
66
+ maxOutput: 65_536,
67
+ pricing: {
68
+ currency: 'CNY',
69
+ units: [
70
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
71
+ { name: 'textOutput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
72
+ ],
73
+ },
74
+ settings: {
75
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
76
+ },
77
+ type: 'chat',
78
+ },
58
79
  {
59
80
  abilities: {
60
81
  reasoning: true,
@@ -1,6 +1,72 @@
1
1
  import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
2
2
 
3
+ // price: https://bigmodel.cn/pricing
4
+ // ref: https://docs.bigmodel.cn/cn/guide/start/model-overview
5
+
3
6
  const zhipuChatModels: AIChatModelCard[] = [
7
+ {
8
+ abilities: {
9
+ functionCall: true,
10
+ reasoning: true,
11
+ search: true,
12
+ },
13
+ contextWindowTokens: 200_000,
14
+ description:
15
+ '智谱最新旗舰模型 GLM-4.6 (355B) 在高级编码、长文本处理、推理与智能体能力上全面超越前代,尤其在编程能力上对齐 Claude Sonnet 4,成为国内顶尖的 Coding 模型。',
16
+ displayName: 'GLM-4.6',
17
+ enabled: true,
18
+ id: 'glm-4.6',
19
+ maxOutput: 128_000,
20
+ pricing: {
21
+ currency: 'CNY',
22
+ units: [
23
+ {
24
+ lookup: {
25
+ prices: {
26
+ '[0, 32_000]_[0, 200]': 0.4,
27
+ '[0, 32_000]_[200, infinity]': 0.6,
28
+ '[32_000, 200_000]': 0.8,
29
+ },
30
+ pricingParams: ['textInput', 'textOutput'],
31
+ },
32
+ name: 'textInput_cacheRead',
33
+ strategy: 'lookup',
34
+ unit: 'millionTokens',
35
+ },
36
+ {
37
+ lookup: {
38
+ prices: {
39
+ '[0, 32_000]_[0, 200]': 2,
40
+ '[0, 32_000]_[200, infinity]': 3,
41
+ '[32_000, 200_000]': 4,
42
+ },
43
+ pricingParams: ['textInput', 'textOutput'],
44
+ },
45
+ name: 'textInput',
46
+ strategy: 'lookup',
47
+ unit: 'millionTokens',
48
+ },
49
+ {
50
+ lookup: {
51
+ prices: {
52
+ '[0, 32_000]_[0, 200]': 8,
53
+ '[0, 32_000]_[200, infinity]': 14,
54
+ '[32_000, 200_000]': 16,
55
+ },
56
+ pricingParams: ['textInput', 'textOutput'],
57
+ },
58
+ name: 'textOutput',
59
+ strategy: 'lookup',
60
+ unit: 'millionTokens',
61
+ },
62
+ ],
63
+ },
64
+ settings: {
65
+ extendParams: ['enableReasoning'],
66
+ searchImpl: 'params',
67
+ },
68
+ type: 'chat',
69
+ },
4
70
  {
5
71
  abilities: {
6
72
  functionCall: true,
@@ -18,10 +84,42 @@ const zhipuChatModels: AIChatModelCard[] = [
18
84
  pricing: {
19
85
  currency: 'CNY',
20
86
  units: [
21
- // 输入长度 [0, 32]
22
- { name: 'textInput_cacheRead', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
23
- { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
24
- { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
87
+ {
88
+ lookup: {
89
+ prices: {
90
+ '[0, 32_000]': 0.4,
91
+ '[32_000, 65_536]': 0.8,
92
+ },
93
+ pricingParams: ['textInput'],
94
+ },
95
+ name: 'textInput_cacheRead',
96
+ strategy: 'lookup',
97
+ unit: 'millionTokens',
98
+ },
99
+ {
100
+ lookup: {
101
+ prices: {
102
+ '[0, 32_000]': 2,
103
+ '[32_000, 65_536]': 4,
104
+ },
105
+ pricingParams: ['textInput'],
106
+ },
107
+ name: 'textInput',
108
+ strategy: 'lookup',
109
+ unit: 'millionTokens',
110
+ },
111
+ {
112
+ lookup: {
113
+ prices: {
114
+ '[0, 32_000]': 6,
115
+ '[32_000, 65_536]': 12,
116
+ },
117
+ pricingParams: ['textInput'],
118
+ },
119
+ name: 'textOutput',
120
+ strategy: 'lookup',
121
+ unit: 'millionTokens',
122
+ },
25
123
  ],
26
124
  },
27
125
  settings: {
@@ -38,17 +136,52 @@ const zhipuChatModels: AIChatModelCard[] = [
38
136
  },
39
137
  contextWindowTokens: 128_000,
40
138
  description:
41
- '智谱最新旗舰模型,支持思考模式切换,综合能力达到开源模型的 SOTA 水平,上下文长度可达128K。',
139
+ '智谱旗舰模型,支持思考模式切换,综合能力达到开源模型的 SOTA 水平,上下文长度可达128K。',
42
140
  displayName: 'GLM-4.5',
43
- enabled: true,
44
141
  id: 'glm-4.5',
45
142
  maxOutput: 32_768,
46
143
  pricing: {
47
144
  currency: 'CNY',
48
145
  units: [
49
- { name: 'textInput_cacheRead', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
50
- { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
51
- { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
146
+ {
147
+ lookup: {
148
+ prices: {
149
+ '[0, 32_000]_[0, 200]': 0.4,
150
+ '[0, 32_000]_[200, infinity]': 0.6,
151
+ '[32_000, 128_000]': 0.8,
152
+ },
153
+ pricingParams: ['textInput', 'textOutput'],
154
+ },
155
+ name: 'textInput_cacheRead',
156
+ strategy: 'lookup',
157
+ unit: 'millionTokens',
158
+ },
159
+ {
160
+ lookup: {
161
+ prices: {
162
+ '[0, 32_000]_[0, 200]': 2,
163
+ '[0, 32_000]_[200, infinity]': 3,
164
+ '[32_000, 128_000]': 4,
165
+ },
166
+ pricingParams: ['textInput', 'textOutput'],
167
+ },
168
+ name: 'textInput',
169
+ strategy: 'lookup',
170
+ unit: 'millionTokens',
171
+ },
172
+ {
173
+ lookup: {
174
+ prices: {
175
+ '[0, 32_000]_[0, 200]': 8,
176
+ '[0, 32_000]_[200, infinity]': 14,
177
+ '[32_000, 128_000]': 16,
178
+ },
179
+ pricingParams: ['textInput', 'textOutput'],
180
+ },
181
+ name: 'textOutput',
182
+ strategy: 'lookup',
183
+ unit: 'millionTokens',
184
+ },
52
185
  ],
53
186
  },
54
187
  settings: {
@@ -71,9 +204,45 @@ const zhipuChatModels: AIChatModelCard[] = [
71
204
  pricing: {
72
205
  currency: 'CNY',
73
206
  units: [
74
- { name: 'textInput_cacheRead', rate: 3.2, strategy: 'fixed', unit: 'millionTokens' },
75
- { name: 'textInput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
76
- { name: 'textOutput', rate: 64, strategy: 'fixed', unit: 'millionTokens' },
207
+ {
208
+ lookup: {
209
+ prices: {
210
+ '[0, 32_000]': 1.6,
211
+ '[0, 32_000]_[200, infinity]': 2.4,
212
+ '[32_000, 128_000]': 3.2,
213
+ },
214
+ pricingParams: ['textInput', 'textOutput'],
215
+ },
216
+ name: 'textInput_cacheRead',
217
+ strategy: 'lookup',
218
+ unit: 'millionTokens',
219
+ },
220
+ {
221
+ lookup: {
222
+ prices: {
223
+ '[0, 32_000]_[0, 200]': 8,
224
+ '[0, 32_000]_[200, infinity]': 12,
225
+ '[32_000, 128_000]': 16,
226
+ },
227
+ pricingParams: ['textInput', 'textOutput'],
228
+ },
229
+ name: 'textInput',
230
+ strategy: 'lookup',
231
+ unit: 'millionTokens',
232
+ },
233
+ {
234
+ lookup: {
235
+ prices: {
236
+ '[0, 32_000]_[0, 200]': 16,
237
+ '[0, 32_000]_[200, infinity]': 32,
238
+ '[32_000, 128_000]': 64,
239
+ },
240
+ pricingParams: ['textInput', 'textOutput'],
241
+ },
242
+ name: 'textOutput',
243
+ strategy: 'lookup',
244
+ unit: 'millionTokens',
245
+ },
77
246
  ],
78
247
  },
79
248
  settings: {
@@ -96,9 +265,43 @@ const zhipuChatModels: AIChatModelCard[] = [
96
265
  pricing: {
97
266
  currency: 'CNY',
98
267
  units: [
99
- { name: 'textInput_cacheRead', rate: 0.24, strategy: 'fixed', unit: 'millionTokens' },
100
- { name: 'textInput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
101
- { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
268
+ {
269
+ lookup: {
270
+ prices: {
271
+ '[0, 32_000]': 0.16,
272
+ '[32_000, 128_000]': 0.24,
273
+ },
274
+ pricingParams: ['textInput'],
275
+ },
276
+ name: 'textInput_cacheRead',
277
+ strategy: 'lookup',
278
+ unit: 'millionTokens',
279
+ },
280
+ {
281
+ lookup: {
282
+ prices: {
283
+ '[0, 32_000]': 0.8,
284
+ '[32_000, 128_000]': 1.2,
285
+ },
286
+ pricingParams: ['textInput'],
287
+ },
288
+ name: 'textInput',
289
+ strategy: 'lookup',
290
+ unit: 'millionTokens',
291
+ },
292
+ {
293
+ lookup: {
294
+ prices: {
295
+ '[0, 32_000]_[0, 200]': 2,
296
+ '[0, 32_000]_[200, infinity]': 6,
297
+ '[32_000, 128_000]': 8,
298
+ },
299
+ pricingParams: ['textInput', 'textOutput'],
300
+ },
301
+ name: 'textOutput',
302
+ strategy: 'lookup',
303
+ unit: 'millionTokens',
304
+ },
102
305
  ],
103
306
  },
104
307
  settings: {
@@ -121,9 +324,43 @@ const zhipuChatModels: AIChatModelCard[] = [
121
324
  pricing: {
122
325
  currency: 'CNY',
123
326
  units: [
124
- { name: 'textInput_cacheRead', rate: 1.6, strategy: 'fixed', unit: 'millionTokens' },
125
- { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
126
- { name: 'textOutput', rate: 32, strategy: 'fixed', unit: 'millionTokens' },
327
+ {
328
+ lookup: {
329
+ prices: {
330
+ '[0, 32_000]': 0.8,
331
+ '[32_000, 128_000]': 1.6,
332
+ },
333
+ pricingParams: ['textInput'],
334
+ },
335
+ name: 'textInput_cacheRead',
336
+ strategy: 'lookup',
337
+ unit: 'millionTokens',
338
+ },
339
+ {
340
+ lookup: {
341
+ prices: {
342
+ '[0, 32_000]': 4,
343
+ '[32_000, 128_000]': 8,
344
+ },
345
+ pricingParams: ['textInput'],
346
+ },
347
+ name: 'textInput',
348
+ strategy: 'lookup',
349
+ unit: 'millionTokens',
350
+ },
351
+ {
352
+ lookup: {
353
+ prices: {
354
+ '[0, 32_000]_[0, 200]': 12,
355
+ '[0, 32_000]_[200, infinity]': 16,
356
+ '[32_000, 128_000]': 32,
357
+ },
358
+ pricingParams: ['textInput', 'textOutput'],
359
+ },
360
+ name: 'textOutput',
361
+ strategy: 'lookup',
362
+ unit: 'millionTokens',
363
+ },
127
364
  ],
128
365
  },
129
366
  settings: {
@@ -187,7 +424,6 @@ const zhipuChatModels: AIChatModelCard[] = [
187
424
  description:
188
425
  'GLM-4.1V-Thinking 系列模型是目前已知10B级别的VLM模型中性能最强的视觉模型,融合了同级别SOTA的各项视觉语言任务,包括视频理解、图片问答、学科解题、OCR文字识别、文档和图表解读、GUI Agent、前端网页Coding、Grounding等,多项任务能力甚至超过8倍参数量的Qwen2.5-VL-72B。通过领先的强化学习技术,模型掌握了通过思维链推理的方式提升回答的准确性和丰富度,从最终效果和可解释性等维度都显著超过传统的非thinking模型。',
189
426
  displayName: 'GLM-4.1V-Thinking-Flash',
190
- enabled: true,
191
427
  id: 'glm-4.1v-thinking-flash',
192
428
  maxOutput: 16_384,
193
429
  pricing: {
@@ -414,28 +650,6 @@ const zhipuChatModels: AIChatModelCard[] = [
414
650
  },
415
651
  type: 'chat',
416
652
  },
417
- {
418
- abilities: {
419
- functionCall: true,
420
- search: true,
421
- },
422
- contextWindowTokens: 128_000,
423
- description:
424
- 'GLM-4-AllTools 是一个多功能智能体模型,优化以支持复杂指令规划与工具调用,如网络浏览、代码解释和文本生成,适用于多任务执行。',
425
- displayName: 'GLM-4-AllTools',
426
- id: 'glm-4-alltools',
427
- pricing: {
428
- currency: 'CNY',
429
- units: [
430
- { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
431
- { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
432
- ],
433
- },
434
- settings: {
435
- searchImpl: 'params',
436
- },
437
- type: 'chat',
438
- },
439
653
  {
440
654
  abilities: {
441
655
  functionCall: true,
@@ -479,27 +693,6 @@ const zhipuChatModels: AIChatModelCard[] = [
479
693
  },
480
694
  type: 'chat',
481
695
  },
482
- {
483
- abilities: {
484
- functionCall: true,
485
- search: true,
486
- },
487
- contextWindowTokens: 128_000,
488
- description: 'GLM-4 是发布于2024年1月的旧旗舰版本,目前已被更强的 GLM-4-0520 取代。',
489
- displayName: 'GLM-4',
490
- id: 'glm-4', // 弃用时间 2025年6月30日
491
- pricing: {
492
- currency: 'CNY',
493
- units: [
494
- { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
495
- { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
496
- ],
497
- },
498
- settings: {
499
- searchImpl: 'params',
500
- },
501
- type: 'chat',
502
- },
503
696
  {
504
697
  abilities: {
505
698
  vision: true,