@lobehub/chat 1.111.1 → 1.111.2

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 (99) 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 +25 -0
  9. package/changelog/v1.json +5 -0
  10. package/package.json +1 -1
  11. package/packages/types/src/aiModel.ts +67 -46
  12. package/packages/types/src/llm.ts +3 -3
  13. package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/features/Details/Overview/ProviderList/index.tsx +23 -12
  14. package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Details/Overview/ModelList/index.tsx +23 -10
  15. package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +21 -12
  16. package/src/config/aiModels/ai21.ts +8 -4
  17. package/src/config/aiModels/ai360.ts +28 -14
  18. package/src/config/aiModels/aihubmix.ts +174 -86
  19. package/src/config/aiModels/anthropic.ts +97 -38
  20. package/src/config/aiModels/azure.ts +54 -32
  21. package/src/config/aiModels/azureai.ts +63 -37
  22. package/src/config/aiModels/baichuan.ts +24 -12
  23. package/src/config/aiModels/bedrock.ts +60 -30
  24. package/src/config/aiModels/cohere.ts +60 -30
  25. package/src/config/aiModels/deepseek.ts +10 -6
  26. package/src/config/aiModels/fireworksai.ts +88 -44
  27. package/src/config/aiModels/giteeai.ts +1 -1
  28. package/src/config/aiModels/github.ts +44 -26
  29. package/src/config/aiModels/google.ts +119 -68
  30. package/src/config/aiModels/groq.ts +48 -24
  31. package/src/config/aiModels/higress.ts +617 -310
  32. package/src/config/aiModels/hunyuan.ts +105 -54
  33. package/src/config/aiModels/infiniai.ts +104 -52
  34. package/src/config/aiModels/internlm.ts +16 -8
  35. package/src/config/aiModels/jina.ts +4 -2
  36. package/src/config/aiModels/minimax.ts +11 -10
  37. package/src/config/aiModels/mistral.ts +40 -20
  38. package/src/config/aiModels/moonshot.ts +42 -22
  39. package/src/config/aiModels/novita.ts +196 -98
  40. package/src/config/aiModels/openai.ts +270 -137
  41. package/src/config/aiModels/openrouter.ts +205 -100
  42. package/src/config/aiModels/perplexity.ts +36 -6
  43. package/src/config/aiModels/ppio.ts +76 -38
  44. package/src/config/aiModels/qwen.ts +257 -133
  45. package/src/config/aiModels/sambanova.ts +56 -28
  46. package/src/config/aiModels/sensenova.ts +100 -50
  47. package/src/config/aiModels/siliconcloud.ts +224 -112
  48. package/src/config/aiModels/stepfun.ts +44 -22
  49. package/src/config/aiModels/taichu.ts +8 -4
  50. package/src/config/aiModels/tencentcloud.ts +12 -6
  51. package/src/config/aiModels/upstage.ts +8 -4
  52. package/src/config/aiModels/v0.ts +15 -12
  53. package/src/config/aiModels/vertexai.ts +49 -27
  54. package/src/config/aiModels/volcengine.ts +110 -51
  55. package/src/config/aiModels/wenxin.ts +179 -73
  56. package/src/config/aiModels/xai.ts +33 -19
  57. package/src/config/aiModels/zeroone.ts +48 -24
  58. package/src/config/aiModels/zhipu.ts +118 -69
  59. package/src/config/modelProviders/ai21.ts +0 -8
  60. package/src/config/modelProviders/ai360.ts +0 -20
  61. package/src/config/modelProviders/anthropic.ts +0 -56
  62. package/src/config/modelProviders/baichuan.ts +0 -30
  63. package/src/config/modelProviders/bedrock.ts +0 -74
  64. package/src/config/modelProviders/deepseek.ts +0 -13
  65. package/src/config/modelProviders/fireworksai.ts +0 -88
  66. package/src/config/modelProviders/google.ts +0 -59
  67. package/src/config/modelProviders/groq.ts +0 -48
  68. package/src/config/modelProviders/higress.ts +0 -727
  69. package/src/config/modelProviders/hunyuan.ts +0 -45
  70. package/src/config/modelProviders/infiniai.ts +0 -60
  71. package/src/config/modelProviders/internlm.ts +0 -8
  72. package/src/config/modelProviders/mistral.ts +0 -48
  73. package/src/config/modelProviders/modelscope.ts +2 -1
  74. package/src/config/modelProviders/openai.ts +5 -100
  75. package/src/config/modelProviders/openrouter.ts +0 -77
  76. package/src/config/modelProviders/ppio.ts +0 -95
  77. package/src/config/modelProviders/qwen.ts +0 -165
  78. package/src/config/modelProviders/sensenova.ts +0 -45
  79. package/src/config/modelProviders/siliconcloud.ts +0 -266
  80. package/src/config/modelProviders/stepfun.ts +0 -60
  81. package/src/config/modelProviders/taichu.ts +0 -10
  82. package/src/config/modelProviders/wenxin.ts +0 -90
  83. package/src/config/modelProviders/xai.ts +0 -16
  84. package/src/config/modelProviders/zeroone.ts +0 -60
  85. package/src/config/modelProviders/zhipu.ts +0 -80
  86. package/src/features/Conversation/Extras/Usage/UsageDetail/ModelCard.tsx +4 -3
  87. package/src/features/Conversation/Extras/Usage/UsageDetail/pricing.ts +25 -15
  88. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.test.ts +7 -5
  89. package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.ts +6 -5
  90. package/src/libs/model-runtime/utils/openaiCompatibleFactory/index.test.ts +54 -8
  91. package/src/server/routers/lambda/agent.ts +2 -2
  92. package/src/server/routers/lambda/config/__snapshots__/index.test.ts.snap +0 -28
  93. package/src/server/services/discover/index.ts +7 -6
  94. package/src/server/services/user/index.ts +1 -2
  95. package/src/utils/__snapshots__/parseModels.test.ts.snap +28 -4
  96. package/src/utils/_deprecated/__snapshots__/parseModels.test.ts.snap +0 -8
  97. package/src/utils/parseModels.test.ts +60 -9
  98. package/src/utils/pricing.test.ts +183 -0
  99. package/src/utils/pricing.ts +90 -0
@@ -17,9 +17,11 @@ const googleChatModels: AIChatModelCard[] = [
17
17
  id: 'gemini-2.5-pro',
18
18
  maxOutput: 65_536,
19
19
  pricing: {
20
- cachedInput: 0.31, // prompts <= 200k tokens
21
- input: 1.25, // prompts <= 200k tokens
22
- output: 10, // prompts <= 200k tokens
20
+ units: [
21
+ { name: 'textInput_cacheRead', rate: 0.31, strategy: 'fixed', unit: 'millionTokens' },
22
+ { name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
23
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
24
+ ],
23
25
  },
24
26
  releasedAt: '2025-06-17',
25
27
  settings: {
@@ -43,9 +45,11 @@ const googleChatModels: AIChatModelCard[] = [
43
45
  id: 'gemini-2.5-pro-preview-06-05',
44
46
  maxOutput: 65_536,
45
47
  pricing: {
46
- cachedInput: 0.31, // prompts <= 200k tokens
47
- input: 1.25, // prompts <= 200k tokens
48
- output: 10, // prompts <= 200k tokens
48
+ units: [
49
+ { name: 'textInput_cacheRead', rate: 0.31, strategy: 'fixed', unit: 'millionTokens' },
50
+ { name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
51
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
52
+ ],
49
53
  },
50
54
  releasedAt: '2025-06-05',
51
55
  settings: {
@@ -69,9 +73,11 @@ const googleChatModels: AIChatModelCard[] = [
69
73
  id: 'gemini-2.5-pro-preview-05-06',
70
74
  maxOutput: 65_536,
71
75
  pricing: {
72
- cachedInput: 0.31, // prompts <= 200k tokens
73
- input: 1.25, // prompts <= 200k tokens
74
- output: 10, // prompts <= 200k tokens
76
+ units: [
77
+ { name: 'textInput_cacheRead', rate: 0.31, strategy: 'fixed', unit: 'millionTokens' },
78
+ { name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
79
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
80
+ ],
75
81
  },
76
82
  releasedAt: '2025-05-06',
77
83
  settings: {
@@ -94,9 +100,11 @@ const googleChatModels: AIChatModelCard[] = [
94
100
  id: 'gemini-2.5-flash',
95
101
  maxOutput: 65_536,
96
102
  pricing: {
97
- cachedInput: 0.075,
98
- input: 0.3,
99
- output: 2.5,
103
+ units: [
104
+ { name: 'textInput_cacheRead', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
105
+ { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
106
+ { name: 'textOutput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
107
+ ],
100
108
  },
101
109
  releasedAt: '2025-06-17',
102
110
  settings: {
@@ -119,9 +127,11 @@ const googleChatModels: AIChatModelCard[] = [
119
127
  id: 'gemini-2.5-flash-preview-05-20',
120
128
  maxOutput: 65_536,
121
129
  pricing: {
122
- cachedInput: 0.0375,
123
- input: 0.15,
124
- output: 3.5, // Thinking
130
+ units: [
131
+ { name: 'textInput_cacheRead', rate: 0.0375, strategy: 'fixed', unit: 'millionTokens' },
132
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
133
+ { name: 'textOutput', rate: 3.5, strategy: 'fixed', unit: 'millionTokens' },
134
+ ],
125
135
  },
126
136
  releasedAt: '2025-05-20',
127
137
  settings: {
@@ -144,9 +154,11 @@ const googleChatModels: AIChatModelCard[] = [
144
154
  id: 'gemini-2.5-flash-lite',
145
155
  maxOutput: 65_536,
146
156
  pricing: {
147
- cachedInput: 0.025,
148
- input: 0.1,
149
- output: 0.4,
157
+ units: [
158
+ { name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
159
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
160
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
161
+ ],
150
162
  },
151
163
  releasedAt: '2025-07-22',
152
164
  settings: {
@@ -170,9 +182,11 @@ const googleChatModels: AIChatModelCard[] = [
170
182
  id: 'gemini-2.5-flash-lite-preview-06-17',
171
183
  maxOutput: 65_536,
172
184
  pricing: {
173
- cachedInput: 0.025,
174
- input: 0.1,
175
- output: 0.4,
185
+ units: [
186
+ { name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
187
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
188
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
189
+ ],
176
190
  },
177
191
  releasedAt: '2025-06-11',
178
192
  settings: {
@@ -195,9 +209,11 @@ const googleChatModels: AIChatModelCard[] = [
195
209
  id: 'gemini-2.0-flash',
196
210
  maxOutput: 8192,
197
211
  pricing: {
198
- cachedInput: 0.025,
199
- input: 0.1,
200
- output: 0.4,
212
+ units: [
213
+ { name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
214
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
215
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
216
+ ],
201
217
  },
202
218
  releasedAt: '2025-02-05',
203
219
  settings: {
@@ -219,9 +235,11 @@ const googleChatModels: AIChatModelCard[] = [
219
235
  id: 'gemini-2.0-flash-001',
220
236
  maxOutput: 8192,
221
237
  pricing: {
222
- cachedInput: 0.025,
223
- input: 0.1,
224
- output: 0.4,
238
+ units: [
239
+ { name: 'textInput_cacheRead', rate: 0.025, strategy: 'fixed', unit: 'millionTokens' },
240
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
241
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
242
+ ],
225
243
  },
226
244
  releasedAt: '2025-02-05',
227
245
  settings: {
@@ -242,8 +260,11 @@ const googleChatModels: AIChatModelCard[] = [
242
260
  id: 'gemini-2.0-flash-preview-image-generation',
243
261
  maxOutput: 8192,
244
262
  pricing: {
245
- input: 0.1,
246
- output: 0.039, // per image
263
+ units: [
264
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
265
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
266
+ { name: 'imageGeneration', rate: 0.039, strategy: 'fixed', unit: 'image' },
267
+ ],
247
268
  },
248
269
  releasedAt: '2025-05-07',
249
270
  type: 'chat',
@@ -259,8 +280,10 @@ const googleChatModels: AIChatModelCard[] = [
259
280
  id: 'gemini-2.0-flash-exp-image-generation',
260
281
  maxOutput: 8192,
261
282
  pricing: {
262
- input: 0,
263
- output: 0,
283
+ units: [
284
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
285
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
286
+ ],
264
287
  },
265
288
  releasedAt: '2025-03-14',
266
289
  type: 'chat',
@@ -275,8 +298,10 @@ const googleChatModels: AIChatModelCard[] = [
275
298
  id: 'gemini-2.0-flash-lite',
276
299
  maxOutput: 8192,
277
300
  pricing: {
278
- input: 0.075,
279
- output: 0.3,
301
+ units: [
302
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
303
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
304
+ ],
280
305
  },
281
306
  releasedAt: '2025-02-05',
282
307
  type: 'chat',
@@ -291,8 +316,10 @@ const googleChatModels: AIChatModelCard[] = [
291
316
  id: 'gemini-2.0-flash-lite-001',
292
317
  maxOutput: 8192,
293
318
  pricing: {
294
- input: 0.075,
295
- output: 0.3,
319
+ units: [
320
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
321
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
322
+ ],
296
323
  },
297
324
  releasedAt: '2025-02-05',
298
325
  type: 'chat',
@@ -308,8 +335,10 @@ const googleChatModels: AIChatModelCard[] = [
308
335
  id: 'gemini-2.0-flash-exp',
309
336
  maxOutput: 8192,
310
337
  pricing: {
311
- input: 0,
312
- output: 0,
338
+ units: [
339
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
340
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
341
+ ],
313
342
  },
314
343
  releasedAt: '2025-02-05',
315
344
  type: 'chat',
@@ -325,8 +354,10 @@ const googleChatModels: AIChatModelCard[] = [
325
354
  id: 'learnlm-2.0-flash-experimental',
326
355
  maxOutput: 32_768,
327
356
  pricing: {
328
- input: 0,
329
- output: 0,
357
+ units: [
358
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
359
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
360
+ ],
330
361
  },
331
362
  type: 'chat',
332
363
  },
@@ -341,8 +372,10 @@ const googleChatModels: AIChatModelCard[] = [
341
372
  id: 'learnlm-1.5-pro-experimental',
342
373
  maxOutput: 8192,
343
374
  pricing: {
344
- input: 0,
345
- output: 0,
375
+ units: [
376
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
377
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
378
+ ],
346
379
  },
347
380
  releasedAt: '2024-11-19',
348
381
  type: 'chat',
@@ -358,9 +391,11 @@ const googleChatModels: AIChatModelCard[] = [
358
391
  id: 'gemini-1.5-flash-002', // Deprecated on 2025-09-24
359
392
  maxOutput: 8192,
360
393
  pricing: {
361
- cachedInput: 0.018_75,
362
- input: 0.075,
363
- output: 0.3,
394
+ units: [
395
+ { name: 'textInput_cacheRead', rate: 0.018, strategy: 'fixed', unit: 'millionTokens' },
396
+ { name: 'textInput', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
397
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
398
+ ],
364
399
  },
365
400
  releasedAt: '2024-09-25',
366
401
  type: 'chat',
@@ -377,9 +412,11 @@ const googleChatModels: AIChatModelCard[] = [
377
412
  id: 'gemini-1.5-pro-002', // Deprecated on 2025-09-24
378
413
  maxOutput: 8192,
379
414
  pricing: {
380
- cachedInput: 0.3125,
381
- input: 1.25,
382
- output: 5,
415
+ units: [
416
+ { name: 'textInput_cacheRead', rate: 0.3125, strategy: 'fixed', unit: 'millionTokens' },
417
+ { name: 'textInput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
418
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
419
+ ],
383
420
  },
384
421
  releasedAt: '2024-09-24',
385
422
  type: 'chat',
@@ -395,9 +432,11 @@ const googleChatModels: AIChatModelCard[] = [
395
432
  id: 'gemini-1.5-flash-8b-latest',
396
433
  maxOutput: 8192,
397
434
  pricing: {
398
- cachedInput: 0.01,
399
- input: 0.0375,
400
- output: 0.15,
435
+ units: [
436
+ { name: 'textInput_cacheRead', rate: 0.01, strategy: 'fixed', unit: 'millionTokens' },
437
+ { name: 'textInput', rate: 0.0375, strategy: 'fixed', unit: 'millionTokens' },
438
+ { name: 'textOutput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
439
+ ],
401
440
  },
402
441
  releasedAt: '2024-10-03',
403
442
  type: 'chat',
@@ -408,9 +447,11 @@ const googleChatModels: AIChatModelCard[] = [
408
447
  id: 'gemma-3-1b-it',
409
448
  maxOutput: 8192,
410
449
  pricing: {
411
- cachedInput: 0,
412
- input: 0,
413
- output: 0,
450
+ units: [
451
+ { name: 'textInput_cacheRead', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
452
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
453
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
454
+ ],
414
455
  },
415
456
  type: 'chat',
416
457
  },
@@ -420,9 +461,11 @@ const googleChatModels: AIChatModelCard[] = [
420
461
  id: 'gemma-3-4b-it',
421
462
  maxOutput: 8192,
422
463
  pricing: {
423
- cachedInput: 0,
424
- input: 0,
425
- output: 0,
464
+ units: [
465
+ { name: 'textInput_cacheRead', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
466
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
467
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
468
+ ],
426
469
  },
427
470
  type: 'chat',
428
471
  },
@@ -432,9 +475,11 @@ const googleChatModels: AIChatModelCard[] = [
432
475
  id: 'gemma-3-12b-it',
433
476
  maxOutput: 8192,
434
477
  pricing: {
435
- cachedInput: 0,
436
- input: 0,
437
- output: 0,
478
+ units: [
479
+ { name: 'textInput_cacheRead', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
480
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
481
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
482
+ ],
438
483
  },
439
484
  type: 'chat',
440
485
  },
@@ -444,9 +489,11 @@ const googleChatModels: AIChatModelCard[] = [
444
489
  id: 'gemma-3-27b-it',
445
490
  maxOutput: 8192,
446
491
  pricing: {
447
- cachedInput: 0,
448
- input: 0,
449
- output: 0,
492
+ units: [
493
+ { name: 'textInput_cacheRead', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
494
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
495
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
496
+ ],
450
497
  },
451
498
  type: 'chat',
452
499
  },
@@ -456,9 +503,11 @@ const googleChatModels: AIChatModelCard[] = [
456
503
  id: 'gemma-3n-e2b-it',
457
504
  maxOutput: 2048,
458
505
  pricing: {
459
- cachedInput: 0,
460
- input: 0,
461
- output: 0,
506
+ units: [
507
+ { name: 'textInput_cacheRead', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
508
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
509
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
510
+ ],
462
511
  },
463
512
  type: 'chat',
464
513
  },
@@ -468,9 +517,11 @@ const googleChatModels: AIChatModelCard[] = [
468
517
  id: 'gemma-3n-e4b-it',
469
518
  maxOutput: 2048,
470
519
  pricing: {
471
- cachedInput: 0,
472
- input: 0,
473
- output: 0,
520
+ units: [
521
+ { name: 'textInput_cacheRead', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
522
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
523
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
524
+ ],
474
525
  },
475
526
  type: 'chat',
476
527
  },
@@ -35,8 +35,10 @@ const groqChatModels: AIChatModelCard[] = [
35
35
  id: 'openai/gpt-oss-120b',
36
36
  maxOutput: 32_768,
37
37
  pricing: {
38
- input: 0.15,
39
- output: 0.75,
38
+ units: [
39
+ { name: 'textInput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
40
+ { name: 'textOutput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
41
+ ],
40
42
  },
41
43
  releasedAt: '2025-08-06',
42
44
  type: 'chat',
@@ -53,8 +55,10 @@ const groqChatModels: AIChatModelCard[] = [
53
55
  id: 'openai/gpt-oss-20b',
54
56
  maxOutput: 32_768,
55
57
  pricing: {
56
- input: 0.1,
57
- output: 0.5,
58
+ units: [
59
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
60
+ { name: 'textOutput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
61
+ ],
58
62
  },
59
63
  releasedAt: '2025-08-06',
60
64
  type: 'chat',
@@ -71,8 +75,10 @@ const groqChatModels: AIChatModelCard[] = [
71
75
  id: 'moonshotai/kimi-k2-instruct',
72
76
  maxOutput: 16_384,
73
77
  pricing: {
74
- input: 1,
75
- output: 3,
78
+ units: [
79
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
80
+ { name: 'textOutput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
81
+ ],
76
82
  },
77
83
  releasedAt: '2025-07-11',
78
84
  type: 'chat',
@@ -84,8 +90,10 @@ const groqChatModels: AIChatModelCard[] = [
84
90
  id: 'meta-llama/llama-4-scout-17b-16e-instruct',
85
91
  maxOutput: 8192,
86
92
  pricing: {
87
- input: 0.11,
88
- output: 0.34,
93
+ units: [
94
+ { name: 'textInput', rate: 0.11, strategy: 'fixed', unit: 'millionTokens' },
95
+ { name: 'textOutput', rate: 0.34, strategy: 'fixed', unit: 'millionTokens' },
96
+ ],
89
97
  },
90
98
  type: 'chat',
91
99
  },
@@ -99,8 +107,10 @@ const groqChatModels: AIChatModelCard[] = [
99
107
  id: 'meta-llama/llama-4-maverick-17b-128e-instruct',
100
108
  maxOutput: 8192,
101
109
  pricing: {
102
- input: 0.2,
103
- output: 0.6,
110
+ units: [
111
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
112
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
113
+ ],
104
114
  },
105
115
  type: 'chat',
106
116
  },
@@ -113,8 +123,10 @@ const groqChatModels: AIChatModelCard[] = [
113
123
  id: 'qwen/qwen3-32b',
114
124
  maxOutput: 131_072,
115
125
  pricing: {
116
- input: 0.29,
117
- output: 0.59,
126
+ units: [
127
+ { name: 'textInput', rate: 0.29, strategy: 'fixed', unit: 'millionTokens' },
128
+ { name: 'textOutput', rate: 0.59, strategy: 'fixed', unit: 'millionTokens' },
129
+ ],
118
130
  },
119
131
  type: 'chat',
120
132
  },
@@ -128,8 +140,10 @@ const groqChatModels: AIChatModelCard[] = [
128
140
  id: 'deepseek-r1-distill-llama-70b',
129
141
  maxOutput: 131_072,
130
142
  pricing: {
131
- input: 0.75, // 0.75 - 5.00
132
- output: 0.99, // 0.99 - 5.00
143
+ units: [
144
+ { name: 'textInput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
145
+ { name: 'textOutput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
146
+ ],
133
147
  },
134
148
  type: 'chat',
135
149
  },
@@ -143,8 +157,10 @@ const groqChatModels: AIChatModelCard[] = [
143
157
  id: 'gemma2-9b-it',
144
158
  maxOutput: 8192,
145
159
  pricing: {
146
- input: 0.2,
147
- output: 0.2,
160
+ units: [
161
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
162
+ { name: 'textOutput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
163
+ ],
148
164
  },
149
165
  type: 'chat',
150
166
  },
@@ -159,8 +175,10 @@ const groqChatModels: AIChatModelCard[] = [
159
175
  id: 'llama-3.1-8b-instant',
160
176
  maxOutput: 131_072,
161
177
  pricing: {
162
- input: 0.05,
163
- output: 0.08,
178
+ units: [
179
+ { name: 'textInput', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
180
+ { name: 'textOutput', rate: 0.08, strategy: 'fixed', unit: 'millionTokens' },
181
+ ],
164
182
  },
165
183
  type: 'chat',
166
184
  },
@@ -175,8 +193,10 @@ const groqChatModels: AIChatModelCard[] = [
175
193
  id: 'llama-3.3-70b-versatile',
176
194
  maxOutput: 32_768,
177
195
  pricing: {
178
- input: 0.59,
179
- output: 0.79,
196
+ units: [
197
+ { name: 'textInput', rate: 0.59, strategy: 'fixed', unit: 'millionTokens' },
198
+ { name: 'textOutput', rate: 0.79, strategy: 'fixed', unit: 'millionTokens' },
199
+ ],
180
200
  },
181
201
  type: 'chat',
182
202
  },
@@ -186,8 +206,10 @@ const groqChatModels: AIChatModelCard[] = [
186
206
  id: 'mistral-saba-24b',
187
207
  maxOutput: 32_768,
188
208
  pricing: {
189
- input: 0.79,
190
- output: 0.79,
209
+ units: [
210
+ { name: 'textInput', rate: 0.79, strategy: 'fixed', unit: 'millionTokens' },
211
+ { name: 'textOutput', rate: 0.79, strategy: 'fixed', unit: 'millionTokens' },
212
+ ],
191
213
  },
192
214
  type: 'chat',
193
215
  },
@@ -197,8 +219,10 @@ const groqChatModels: AIChatModelCard[] = [
197
219
  id: 'meta-llama/llama-guard-4-12b',
198
220
  maxOutput: 1024,
199
221
  pricing: {
200
- input: 0.2,
201
- output: 0.2,
222
+ units: [
223
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
224
+ { name: 'textOutput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
225
+ ],
202
226
  },
203
227
  type: 'chat',
204
228
  },