@lobehub/chat 1.111.1 → 1.111.3

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 (131) hide show
  1. package/.cursor/rules/code-review.mdc +2 -19
  2. package/.cursor/rules/cursor-ux.mdc +0 -72
  3. package/.cursor/rules/project-introduce.mdc +5 -5
  4. package/.cursor/rules/react-component.mdc +92 -73
  5. package/.cursor/rules/rules-attach.mdc +28 -61
  6. package/.cursor/rules/system-role.mdc +8 -20
  7. package/.cursor/rules/typescript.mdc +55 -14
  8. package/CHANGELOG.md +52 -0
  9. package/changelog/v1.json +14 -0
  10. package/locales/ar/models.json +21 -3
  11. package/locales/bg-BG/models.json +21 -3
  12. package/locales/de-DE/models.json +21 -3
  13. package/locales/en-US/models.json +21 -3
  14. package/locales/es-ES/models.json +21 -3
  15. package/locales/fa-IR/models.json +21 -3
  16. package/locales/fr-FR/models.json +21 -3
  17. package/locales/it-IT/models.json +21 -3
  18. package/locales/ja-JP/models.json +21 -3
  19. package/locales/ko-KR/models.json +21 -3
  20. package/locales/nl-NL/models.json +21 -3
  21. package/locales/pl-PL/models.json +21 -3
  22. package/locales/pt-BR/models.json +21 -3
  23. package/locales/ru-RU/models.json +21 -3
  24. package/locales/tr-TR/models.json +21 -3
  25. package/locales/vi-VN/models.json +21 -3
  26. package/locales/zh-CN/models.json +21 -3
  27. package/locales/zh-TW/models.json +21 -3
  28. package/package.json +1 -1
  29. package/packages/types/src/aiModel.ts +67 -46
  30. package/packages/types/src/hotkey.ts +2 -0
  31. package/packages/types/src/llm.ts +3 -3
  32. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/PinList/index.tsx +3 -3
  33. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.test.tsx +1 -0
  34. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +11 -2
  35. package/src/app/[variants]/(main)/_layout/Desktop/SideBar/index.tsx +2 -2
  36. package/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +2 -2
  37. package/src/app/[variants]/(main)/chat/_layout/Desktop/SessionPanel.tsx +2 -2
  38. package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/Overview/ProviderList/index.tsx +23 -12
  39. package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Overview/ModelList/index.tsx +23 -10
  40. package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +21 -12
  41. package/src/components/Thinking/index.tsx +53 -13
  42. package/src/config/aiModels/ai21.ts +8 -4
  43. package/src/config/aiModels/ai360.ts +28 -14
  44. package/src/config/aiModels/aihubmix.ts +174 -86
  45. package/src/config/aiModels/anthropic.ts +97 -38
  46. package/src/config/aiModels/azure.ts +54 -32
  47. package/src/config/aiModels/azureai.ts +63 -37
  48. package/src/config/aiModels/baichuan.ts +24 -12
  49. package/src/config/aiModels/bedrock.ts +60 -30
  50. package/src/config/aiModels/cohere.ts +60 -30
  51. package/src/config/aiModels/deepseek.ts +10 -6
  52. package/src/config/aiModels/fireworksai.ts +88 -44
  53. package/src/config/aiModels/giteeai.ts +1 -1
  54. package/src/config/aiModels/github.ts +44 -26
  55. package/src/config/aiModels/google.ts +119 -68
  56. package/src/config/aiModels/groq.ts +48 -24
  57. package/src/config/aiModels/higress.ts +617 -310
  58. package/src/config/aiModels/hunyuan.ts +105 -54
  59. package/src/config/aiModels/infiniai.ts +104 -52
  60. package/src/config/aiModels/internlm.ts +16 -8
  61. package/src/config/aiModels/jina.ts +4 -2
  62. package/src/config/aiModels/minimax.ts +11 -10
  63. package/src/config/aiModels/mistral.ts +40 -20
  64. package/src/config/aiModels/moonshot.ts +42 -22
  65. package/src/config/aiModels/novita.ts +196 -98
  66. package/src/config/aiModels/openai.ts +270 -137
  67. package/src/config/aiModels/openrouter.ts +205 -100
  68. package/src/config/aiModels/perplexity.ts +36 -6
  69. package/src/config/aiModels/ppio.ts +76 -38
  70. package/src/config/aiModels/qwen.ts +257 -133
  71. package/src/config/aiModels/sambanova.ts +56 -28
  72. package/src/config/aiModels/sensenova.ts +100 -50
  73. package/src/config/aiModels/siliconcloud.ts +224 -112
  74. package/src/config/aiModels/stepfun.ts +44 -22
  75. package/src/config/aiModels/taichu.ts +8 -4
  76. package/src/config/aiModels/tencentcloud.ts +12 -6
  77. package/src/config/aiModels/upstage.ts +8 -4
  78. package/src/config/aiModels/v0.ts +15 -12
  79. package/src/config/aiModels/vertexai.ts +49 -27
  80. package/src/config/aiModels/volcengine.ts +110 -51
  81. package/src/config/aiModels/wenxin.ts +179 -73
  82. package/src/config/aiModels/xai.ts +33 -19
  83. package/src/config/aiModels/zeroone.ts +48 -24
  84. package/src/config/aiModels/zhipu.ts +118 -69
  85. package/src/config/modelProviders/ai21.ts +0 -8
  86. package/src/config/modelProviders/ai360.ts +0 -20
  87. package/src/config/modelProviders/anthropic.ts +0 -56
  88. package/src/config/modelProviders/baichuan.ts +0 -30
  89. package/src/config/modelProviders/bedrock.ts +0 -74
  90. package/src/config/modelProviders/deepseek.ts +0 -13
  91. package/src/config/modelProviders/fireworksai.ts +0 -88
  92. package/src/config/modelProviders/google.ts +0 -59
  93. package/src/config/modelProviders/groq.ts +0 -48
  94. package/src/config/modelProviders/higress.ts +0 -727
  95. package/src/config/modelProviders/hunyuan.ts +0 -45
  96. package/src/config/modelProviders/infiniai.ts +0 -60
  97. package/src/config/modelProviders/internlm.ts +0 -8
  98. package/src/config/modelProviders/mistral.ts +0 -48
  99. package/src/config/modelProviders/modelscope.ts +2 -1
  100. package/src/config/modelProviders/openai.ts +5 -100
  101. package/src/config/modelProviders/openrouter.ts +0 -77
  102. package/src/config/modelProviders/ppio.ts +0 -95
  103. package/src/config/modelProviders/qwen.ts +0 -165
  104. package/src/config/modelProviders/sensenova.ts +0 -45
  105. package/src/config/modelProviders/siliconcloud.ts +0 -266
  106. package/src/config/modelProviders/stepfun.ts +0 -60
  107. package/src/config/modelProviders/taichu.ts +0 -10
  108. package/src/config/modelProviders/wenxin.ts +0 -90
  109. package/src/config/modelProviders/xai.ts +0 -16
  110. package/src/config/modelProviders/zeroone.ts +0 -60
  111. package/src/config/modelProviders/zhipu.ts +0 -80
  112. package/src/const/hotkeys.ts +6 -0
  113. package/src/features/Conversation/Extras/Usage/UsageDetail/ModelCard.tsx +4 -3
  114. package/src/features/Conversation/Extras/Usage/UsageDetail/pricing.ts +25 -15
  115. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.test.ts +7 -5
  116. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.ts +6 -5
  117. package/src/hooks/useHotkeys/chatScope.ts +2 -2
  118. package/src/hooks/useHotkeys/globalScope.ts +16 -4
  119. package/src/hooks/usePinnedAgentState.ts +21 -0
  120. package/src/hooks/useSwitchSession.ts +1 -1
  121. package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.test.ts +54 -8
  122. package/src/locales/default/hotkey.ts +4 -0
  123. package/src/server/routers/lambda/agent.ts +2 -2
  124. package/src/server/routers/lambda/config/__snapshots__/index.test.ts.snap +0 -28
  125. package/src/server/services/discover/index.ts +7 -6
  126. package/src/server/services/user/index.ts +1 -2
  127. package/src/utils/__snapshots__/parseModels.test.ts.snap +28 -4
  128. package/src/utils/_deprecated/__snapshots__/parseModels.test.ts.snap +0 -8
  129. package/src/utils/parseModels.test.ts +60 -9
  130. package/src/utils/pricing.test.ts +183 -0
  131. package/src/utils/pricing.ts +90 -0
@@ -12,8 +12,10 @@ const wenxinChatModels: AIChatModelCard[] = [
12
12
  id: 'ernie-x1-turbo-32k',
13
13
  pricing: {
14
14
  currency: 'CNY',
15
- input: 1,
16
- output: 4,
15
+ units: [
16
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
17
+ { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
18
+ ],
17
19
  },
18
20
  releasedAt: '2025-04-24',
19
21
  type: 'chat',
@@ -29,8 +31,10 @@ const wenxinChatModels: AIChatModelCard[] = [
29
31
  id: 'ernie-x1-32k',
30
32
  pricing: {
31
33
  currency: 'CNY',
32
- input: 2,
33
- output: 8,
34
+ units: [
35
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
36
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
37
+ ],
34
38
  },
35
39
  releasedAt: '2025-04-15',
36
40
  type: 'chat',
@@ -46,8 +50,10 @@ const wenxinChatModels: AIChatModelCard[] = [
46
50
  id: 'ernie-x1-32k-preview',
47
51
  pricing: {
48
52
  currency: 'CNY',
49
- input: 2,
50
- output: 8,
53
+ units: [
54
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
55
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
56
+ ],
51
57
  },
52
58
  releasedAt: '2025-03-16',
53
59
  type: 'chat',
@@ -65,8 +71,10 @@ const wenxinChatModels: AIChatModelCard[] = [
65
71
  id: 'ernie-4.5-turbo-128k',
66
72
  pricing: {
67
73
  currency: 'CNY',
68
- input: 0.8,
69
- output: 3.2,
74
+ units: [
75
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
76
+ { name: 'textOutput', rate: 3.2, strategy: 'fixed', unit: 'millionTokens' },
77
+ ],
70
78
  },
71
79
  releasedAt: '2025-04-24',
72
80
  settings: {
@@ -86,8 +94,10 @@ const wenxinChatModels: AIChatModelCard[] = [
86
94
  id: 'ernie-4.5-turbo-32k',
87
95
  pricing: {
88
96
  currency: 'CNY',
89
- input: 0.8,
90
- output: 3.2,
97
+ units: [
98
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
99
+ { name: 'textOutput', rate: 3.2, strategy: 'fixed', unit: 'millionTokens' },
100
+ ],
91
101
  },
92
102
  releasedAt: '2025-04-24',
93
103
  settings: {
@@ -107,8 +117,10 @@ const wenxinChatModels: AIChatModelCard[] = [
107
117
  id: 'ernie-4.5-turbo-vl-32k',
108
118
  pricing: {
109
119
  currency: 'CNY',
110
- input: 3,
111
- output: 9,
120
+ units: [
121
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
122
+ { name: 'textOutput', rate: 9, strategy: 'fixed', unit: 'millionTokens' },
123
+ ],
112
124
  },
113
125
  releasedAt: '2025-04-24',
114
126
  type: 'chat',
@@ -124,8 +136,10 @@ const wenxinChatModels: AIChatModelCard[] = [
124
136
  id: 'ernie-4.5-8k-preview',
125
137
  pricing: {
126
138
  currency: 'CNY',
127
- input: 4,
128
- output: 16,
139
+ units: [
140
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
141
+ { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
142
+ ],
129
143
  },
130
144
  releasedAt: '2025-03-16',
131
145
  type: 'chat',
@@ -142,8 +156,10 @@ const wenxinChatModels: AIChatModelCard[] = [
142
156
  id: 'ernie-4.0-8k-latest',
143
157
  pricing: {
144
158
  currency: 'CNY',
145
- input: 30,
146
- output: 90,
159
+ units: [
160
+ { name: 'textInput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
161
+ { name: 'textOutput', rate: 90, strategy: 'fixed', unit: 'millionTokens' },
162
+ ],
147
163
  },
148
164
  settings: {
149
165
  searchImpl: 'params',
@@ -162,8 +178,10 @@ const wenxinChatModels: AIChatModelCard[] = [
162
178
  id: 'ernie-4.0-8k-preview',
163
179
  pricing: {
164
180
  currency: 'CNY',
165
- input: 30,
166
- output: 90,
181
+ units: [
182
+ { name: 'textInput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
183
+ { name: 'textOutput', rate: 90, strategy: 'fixed', unit: 'millionTokens' },
184
+ ],
167
185
  },
168
186
  settings: {
169
187
  searchImpl: 'params',
@@ -182,8 +200,10 @@ const wenxinChatModels: AIChatModelCard[] = [
182
200
  id: 'ernie-4.0-turbo-8k-latest',
183
201
  pricing: {
184
202
  currency: 'CNY',
185
- input: 20,
186
- output: 60,
203
+ units: [
204
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
205
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
206
+ ],
187
207
  },
188
208
  settings: {
189
209
  searchImpl: 'params',
@@ -202,8 +222,10 @@ const wenxinChatModels: AIChatModelCard[] = [
202
222
  id: 'ernie-4.0-turbo-128k',
203
223
  pricing: {
204
224
  currency: 'CNY',
205
- input: 20,
206
- output: 60,
225
+ units: [
226
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
227
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
228
+ ],
207
229
  },
208
230
  settings: {
209
231
  searchImpl: 'params',
@@ -222,8 +244,10 @@ const wenxinChatModels: AIChatModelCard[] = [
222
244
  id: 'ernie-4.0-turbo-8k-preview',
223
245
  pricing: {
224
246
  currency: 'CNY',
225
- input: 20,
226
- output: 60,
247
+ units: [
248
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
249
+ { name: 'textOutput', rate: 60, strategy: 'fixed', unit: 'millionTokens' },
250
+ ],
227
251
  },
228
252
  settings: {
229
253
  searchImpl: 'params',
@@ -242,8 +266,10 @@ const wenxinChatModels: AIChatModelCard[] = [
242
266
  id: 'ernie-3.5-8k',
243
267
  pricing: {
244
268
  currency: 'CNY',
245
- input: 0.8,
246
- output: 2,
269
+ units: [
270
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
271
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
272
+ ],
247
273
  },
248
274
  settings: {
249
275
  searchImpl: 'params',
@@ -262,8 +288,10 @@ const wenxinChatModels: AIChatModelCard[] = [
262
288
  id: 'ernie-3.5-8k-preview',
263
289
  pricing: {
264
290
  currency: 'CNY',
265
- input: 0.8,
266
- output: 2,
291
+ units: [
292
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
293
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
294
+ ],
267
295
  },
268
296
  settings: {
269
297
  searchImpl: 'params',
@@ -282,8 +310,10 @@ const wenxinChatModels: AIChatModelCard[] = [
282
310
  id: 'ernie-3.5-128k',
283
311
  pricing: {
284
312
  currency: 'CNY',
285
- input: 0.8,
286
- output: 2,
313
+ units: [
314
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
315
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
316
+ ],
287
317
  },
288
318
  settings: {
289
319
  searchImpl: 'params',
@@ -298,8 +328,10 @@ const wenxinChatModels: AIChatModelCard[] = [
298
328
  id: 'ernie-lite-8k',
299
329
  pricing: {
300
330
  currency: 'CNY',
301
- input: 0,
302
- output: 0,
331
+ units: [
332
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
333
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
334
+ ],
303
335
  },
304
336
  type: 'chat',
305
337
  },
@@ -314,8 +346,10 @@ const wenxinChatModels: AIChatModelCard[] = [
314
346
  id: 'ernie-lite-pro-128k',
315
347
  pricing: {
316
348
  currency: 'CNY',
317
- input: 0.2,
318
- output: 0.4,
349
+ units: [
350
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
351
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
352
+ ],
319
353
  },
320
354
  type: 'chat',
321
355
  },
@@ -326,8 +360,10 @@ const wenxinChatModels: AIChatModelCard[] = [
326
360
  id: 'ernie-tiny-8k',
327
361
  pricing: {
328
362
  currency: 'CNY',
329
- input: 0,
330
- output: 0,
363
+ units: [
364
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
365
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
366
+ ],
331
367
  },
332
368
  type: 'chat',
333
369
  },
@@ -339,8 +375,10 @@ const wenxinChatModels: AIChatModelCard[] = [
339
375
  id: 'ernie-speed-128k',
340
376
  pricing: {
341
377
  currency: 'CNY',
342
- input: 0,
343
- output: 0,
378
+ units: [
379
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
380
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
381
+ ],
344
382
  },
345
383
  type: 'chat',
346
384
  },
@@ -352,8 +390,10 @@ const wenxinChatModels: AIChatModelCard[] = [
352
390
  id: 'ernie-speed-pro-128k',
353
391
  pricing: {
354
392
  currency: 'CNY',
355
- input: 0.3,
356
- output: 0.6,
393
+ units: [
394
+ { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
395
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
396
+ ],
357
397
  },
358
398
  type: 'chat',
359
399
  },
@@ -365,8 +405,10 @@ const wenxinChatModels: AIChatModelCard[] = [
365
405
  id: 'ernie-char-8k',
366
406
  pricing: {
367
407
  currency: 'CNY',
368
- input: 4,
369
- output: 8,
408
+ units: [
409
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
410
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
411
+ ],
370
412
  },
371
413
  type: 'chat',
372
414
  },
@@ -378,8 +420,10 @@ const wenxinChatModels: AIChatModelCard[] = [
378
420
  id: 'ernie-char-fiction-8k',
379
421
  pricing: {
380
422
  currency: 'CNY',
381
- input: 4,
382
- output: 8,
423
+ units: [
424
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
425
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
426
+ ],
383
427
  },
384
428
  type: 'chat',
385
429
  },
@@ -390,8 +434,10 @@ const wenxinChatModels: AIChatModelCard[] = [
390
434
  id: 'ernie-novel-8k',
391
435
  pricing: {
392
436
  currency: 'CNY',
393
- input: 40,
394
- output: 120,
437
+ units: [
438
+ { name: 'textInput', rate: 40, strategy: 'fixed', unit: 'millionTokens' },
439
+ { name: 'textOutput', rate: 120, strategy: 'fixed', unit: 'millionTokens' },
440
+ ],
395
441
  },
396
442
  type: 'chat',
397
443
  },
@@ -403,8 +449,10 @@ const wenxinChatModels: AIChatModelCard[] = [
403
449
  id: 'deepseek-v3',
404
450
  pricing: {
405
451
  currency: 'CNY',
406
- input: 0.8,
407
- output: 1.6,
452
+ units: [
453
+ { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
454
+ { name: 'textOutput', rate: 1.6, strategy: 'fixed', unit: 'millionTokens' },
455
+ ],
408
456
  },
409
457
  type: 'chat',
410
458
  },
@@ -419,8 +467,10 @@ const wenxinChatModels: AIChatModelCard[] = [
419
467
  id: 'deepseek-r1',
420
468
  pricing: {
421
469
  currency: 'CNY',
422
- input: 2,
423
- output: 8,
470
+ units: [
471
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
472
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
473
+ ],
424
474
  },
425
475
  type: 'chat',
426
476
  },
@@ -434,8 +484,10 @@ const wenxinChatModels: AIChatModelCard[] = [
434
484
  id: 'deepseek-r1-distill-qwen-1.5b',
435
485
  pricing: {
436
486
  currency: 'CNY',
437
- input: 2,
438
- output: 8,
487
+ units: [
488
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
489
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
490
+ ],
439
491
  },
440
492
  type: 'chat',
441
493
  },
@@ -449,8 +501,10 @@ const wenxinChatModels: AIChatModelCard[] = [
449
501
  id: 'deepseek-r1-distill-qwen-7b',
450
502
  pricing: {
451
503
  currency: 'CNY',
452
- input: 0.6,
453
- output: 2.4,
504
+ units: [
505
+ { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
506
+ { name: 'textOutput', rate: 2.4, strategy: 'fixed', unit: 'millionTokens' },
507
+ ],
454
508
  },
455
509
  type: 'chat',
456
510
  },
@@ -464,8 +518,10 @@ const wenxinChatModels: AIChatModelCard[] = [
464
518
  id: 'deepseek-r1-distill-qwen-14b',
465
519
  pricing: {
466
520
  currency: 'CNY',
467
- input: 0.6,
468
- output: 2.4,
521
+ units: [
522
+ { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
523
+ { name: 'textOutput', rate: 2.4, strategy: 'fixed', unit: 'millionTokens' },
524
+ ],
469
525
  },
470
526
  type: 'chat',
471
527
  },
@@ -479,8 +535,10 @@ const wenxinChatModels: AIChatModelCard[] = [
479
535
  id: 'deepseek-r1-distill-qwen-32b',
480
536
  pricing: {
481
537
  currency: 'CNY',
482
- input: 1.5,
483
- output: 6,
538
+ units: [
539
+ { name: 'textInput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
540
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
541
+ ],
484
542
  },
485
543
  type: 'chat',
486
544
  },
@@ -494,8 +552,10 @@ const wenxinChatModels: AIChatModelCard[] = [
494
552
  id: 'deepseek-r1-distill-llama-8b',
495
553
  pricing: {
496
554
  currency: 'CNY',
497
- input: 1.5,
498
- output: 6,
555
+ units: [
556
+ { name: 'textInput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
557
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
558
+ ],
499
559
  },
500
560
  type: 'chat',
501
561
  },
@@ -509,8 +569,10 @@ const wenxinChatModels: AIChatModelCard[] = [
509
569
  id: 'deepseek-r1-distill-llama-70b',
510
570
  pricing: {
511
571
  currency: 'CNY',
512
- input: 2,
513
- output: 8,
572
+ units: [
573
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
574
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
575
+ ],
514
576
  },
515
577
  type: 'chat',
516
578
  },
@@ -525,8 +587,10 @@ const wenxinChatModels: AIChatModelCard[] = [
525
587
  id: 'deepseek-r1-distill-qianfan-llama-8b',
526
588
  pricing: {
527
589
  currency: 'CNY',
528
- input: 1,
529
- output: 4,
590
+ units: [
591
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
592
+ { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
593
+ ],
530
594
  },
531
595
  type: 'chat',
532
596
  },
@@ -541,8 +605,10 @@ const wenxinChatModels: AIChatModelCard[] = [
541
605
  id: 'deepseek-r1-distill-qianfan-llama-70b',
542
606
  pricing: {
543
607
  currency: 'CNY',
544
- input: 2,
545
- output: 8,
608
+ units: [
609
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
610
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
611
+ ],
546
612
  },
547
613
  type: 'chat',
548
614
  },
@@ -557,8 +623,10 @@ const wenxinChatModels: AIChatModelCard[] = [
557
623
  id: 'qwq-32b',
558
624
  pricing: {
559
625
  currency: 'CNY',
560
- input: 2,
561
- output: 8,
626
+ units: [
627
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
628
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
629
+ ],
562
630
  },
563
631
  type: 'chat',
564
632
  },
@@ -577,7 +645,20 @@ const wenxinImageModels: AIImageModelCard[] = [
577
645
  },
578
646
  size: {
579
647
  default: '1024x1024',
580
- enum: ['768x768', '1024x1024', '1536x1536', '2048x2048', '1024x768', '2048x1536', '768x1024', '1536x2048', '1024x576', '2048x1152', '576x1024', '1152x2048'],
648
+ enum: [
649
+ '768x768',
650
+ '1024x1024',
651
+ '1536x1536',
652
+ '2048x2048',
653
+ '1024x768',
654
+ '2048x1536',
655
+ '768x1024',
656
+ '1536x2048',
657
+ '1024x576',
658
+ '2048x1152',
659
+ '576x1024',
660
+ '1152x2048',
661
+ ],
581
662
  },
582
663
  },
583
664
  releasedAt: '2025-02-05',
@@ -596,15 +677,27 @@ const wenxinImageModels: AIImageModelCard[] = [
596
677
  },
597
678
  size: {
598
679
  default: '1024x1024',
599
- enum: ['768x768', '1024x1024', '1536x1536', '2048x2048', '1024x768', '2048x1536', '768x1024', '1536x2048', '1024x576', '2048x1152', '576x1024', '1152x2048'],
680
+ enum: [
681
+ '768x768',
682
+ '1024x1024',
683
+ '1536x1536',
684
+ '2048x2048',
685
+ '1024x768',
686
+ '2048x1536',
687
+ '768x1024',
688
+ '1536x2048',
689
+ '1024x576',
690
+ '2048x1152',
691
+ '576x1024',
692
+ '1152x2048',
693
+ ],
600
694
  },
601
695
  },
602
696
  releasedAt: '2025-04-17',
603
697
  type: 'image',
604
698
  },
605
699
  {
606
- description:
607
- '具有120亿参数的修正流变换器,能够根据文本描述生成图像。',
700
+ description: '具有120亿参数的修正流变换器,能够根据文本描述生成图像。',
608
701
  displayName: 'FLUX.1-schnell',
609
702
  enabled: true,
610
703
  id: 'flux.1-schnell',
@@ -615,7 +708,20 @@ const wenxinImageModels: AIImageModelCard[] = [
615
708
  seed: { default: null },
616
709
  size: {
617
710
  default: '1024x1024',
618
- enum: ['768x768', '1024x1024', '1536x1536', '2048x2048', '1024x768', '2048x1536', '768x1024', '1536x2048', '1024x576', '2048x1152', '576x1024', '1152x2048'],
711
+ enum: [
712
+ '768x768',
713
+ '1024x1024',
714
+ '1536x1536',
715
+ '2048x2048',
716
+ '1024x768',
717
+ '2048x1536',
718
+ '768x1024',
719
+ '1536x2048',
720
+ '1024x576',
721
+ '2048x1152',
722
+ '576x1024',
723
+ '1152x2048',
724
+ ],
619
725
  },
620
726
  steps: { default: 25, max: 50, min: 1 },
621
727
  },
@@ -16,9 +16,11 @@ const xaiChatModels: AIChatModelCard[] = [
16
16
  enabled: true,
17
17
  id: 'grok-4',
18
18
  pricing: {
19
- cachedInput: 0.75,
20
- input: 3,
21
- output: 15,
19
+ units: [
20
+ { name: 'textInput_cacheRead', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
21
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
22
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
23
+ ],
22
24
  },
23
25
  releasedAt: '2025-07-09',
24
26
  settings: {
@@ -39,9 +41,11 @@ const xaiChatModels: AIChatModelCard[] = [
39
41
  displayName: 'Grok 3',
40
42
  id: 'grok-3',
41
43
  pricing: {
42
- cachedInput: 0.75,
43
- input: 3,
44
- output: 15,
44
+ units: [
45
+ { name: 'textInput_cacheRead', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
46
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
47
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
48
+ ],
45
49
  },
46
50
  releasedAt: '2025-04-03',
47
51
  settings: {
@@ -60,9 +64,11 @@ const xaiChatModels: AIChatModelCard[] = [
60
64
  displayName: 'Grok 3 (Fast mode)',
61
65
  id: 'grok-3-fast',
62
66
  pricing: {
63
- cachedInput: 1.25,
64
- input: 5,
65
- output: 25,
67
+ units: [
68
+ { name: 'textInput_cacheRead', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
69
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
70
+ { name: 'textOutput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
71
+ ],
66
72
  },
67
73
  releasedAt: '2025-04-03',
68
74
  settings: {
@@ -83,9 +89,11 @@ const xaiChatModels: AIChatModelCard[] = [
83
89
  enabled: true,
84
90
  id: 'grok-3-mini',
85
91
  pricing: {
86
- cachedInput: 0.075,
87
- input: 0.3,
88
- output: 0.5,
92
+ units: [
93
+ { name: 'textInput_cacheRead', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
94
+ { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
95
+ { name: 'textOutput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
96
+ ],
89
97
  },
90
98
  releasedAt: '2025-04-03',
91
99
  settings: {
@@ -106,9 +114,11 @@ const xaiChatModels: AIChatModelCard[] = [
106
114
  displayName: 'Grok 3 Mini (Fast mode)',
107
115
  id: 'grok-3-mini-fast',
108
116
  pricing: {
109
- cachedInput: 0.15,
110
- input: 0.6,
111
- output: 4,
117
+ units: [
118
+ { name: 'textInput_cacheRead', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
119
+ { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
120
+ { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
121
+ ],
112
122
  },
113
123
  releasedAt: '2025-04-03',
114
124
  settings: {
@@ -127,8 +137,10 @@ const xaiChatModels: AIChatModelCard[] = [
127
137
  displayName: 'Grok 2 1212',
128
138
  id: 'grok-2-1212', // legacy
129
139
  pricing: {
130
- input: 2,
131
- output: 10,
140
+ units: [
141
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
142
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
143
+ ],
132
144
  },
133
145
  releasedAt: '2024-12-12',
134
146
  settings: {
@@ -147,8 +159,10 @@ const xaiChatModels: AIChatModelCard[] = [
147
159
  displayName: 'Grok 2 Vision 1212',
148
160
  id: 'grok-2-vision-1212',
149
161
  pricing: {
150
- input: 2,
151
- output: 10,
162
+ units: [
163
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
164
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
165
+ ],
152
166
  },
153
167
  releasedAt: '2024-12-12',
154
168
  settings: {