@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
@@ -13,8 +13,10 @@ const ppioChatModels: AIChatModelCard[] = [
13
13
  id: 'deepseek/deepseek-r1/community',
14
14
  pricing: {
15
15
  currency: 'CNY',
16
- input: 4,
17
- output: 16,
16
+ units: [
17
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
18
+ { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
19
+ ],
18
20
  },
19
21
  type: 'chat',
20
22
  },
@@ -27,8 +29,10 @@ const ppioChatModels: AIChatModelCard[] = [
27
29
  id: 'deepseek/deepseek-v3/community',
28
30
  pricing: {
29
31
  currency: 'CNY',
30
- input: 1,
31
- output: 2,
32
+ units: [
33
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
34
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
35
+ ],
32
36
  },
33
37
  type: 'chat',
34
38
  },
@@ -44,8 +48,10 @@ const ppioChatModels: AIChatModelCard[] = [
44
48
  id: 'deepseek/deepseek-r1',
45
49
  pricing: {
46
50
  currency: 'CNY',
47
- input: 4,
48
- output: 16,
51
+ units: [
52
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
53
+ { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
54
+ ],
49
55
  },
50
56
  type: 'chat',
51
57
  },
@@ -58,8 +64,10 @@ const ppioChatModels: AIChatModelCard[] = [
58
64
  id: 'deepseek/deepseek-v3',
59
65
  pricing: {
60
66
  currency: 'CNY',
61
- input: 1,
62
- output: 2,
67
+ units: [
68
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
69
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
70
+ ],
63
71
  },
64
72
  type: 'chat',
65
73
  },
@@ -75,8 +83,10 @@ const ppioChatModels: AIChatModelCard[] = [
75
83
  id: 'deepseek/deepseek-r1-distill-llama-70b',
76
84
  pricing: {
77
85
  currency: 'CNY',
78
- input: 5.8,
79
- output: 5.8,
86
+ units: [
87
+ { name: 'textInput', rate: 5.8, strategy: 'fixed', unit: 'millionTokens' },
88
+ { name: 'textOutput', rate: 5.8, strategy: 'fixed', unit: 'millionTokens' },
89
+ ],
80
90
  },
81
91
  type: 'chat',
82
92
  },
@@ -92,8 +102,10 @@ const ppioChatModels: AIChatModelCard[] = [
92
102
  id: 'deepseek/deepseek-r1-distill-qwen-32b',
93
103
  pricing: {
94
104
  currency: 'CNY',
95
- input: 2.18,
96
- output: 2.18,
105
+ units: [
106
+ { name: 'textInput', rate: 2.18, strategy: 'fixed', unit: 'millionTokens' },
107
+ { name: 'textOutput', rate: 2.18, strategy: 'fixed', unit: 'millionTokens' },
108
+ ],
97
109
  },
98
110
  type: 'chat',
99
111
  },
@@ -109,8 +121,10 @@ const ppioChatModels: AIChatModelCard[] = [
109
121
  id: 'deepseek/deepseek-r1-distill-qwen-14b',
110
122
  pricing: {
111
123
  currency: 'CNY',
112
- input: 1,
113
- output: 1,
124
+ units: [
125
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
126
+ { name: 'textOutput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
127
+ ],
114
128
  },
115
129
  type: 'chat',
116
130
  },
@@ -126,8 +140,10 @@ const ppioChatModels: AIChatModelCard[] = [
126
140
  id: 'deepseek/deepseek-r1-distill-llama-8b',
127
141
  pricing: {
128
142
  currency: 'CNY',
129
- input: 0.3,
130
- output: 0.3,
143
+ units: [
144
+ { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
145
+ { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
146
+ ],
131
147
  },
132
148
  type: 'chat',
133
149
  },
@@ -140,8 +156,10 @@ const ppioChatModels: AIChatModelCard[] = [
140
156
  id: 'qwen/qwen-2.5-72b-instruct',
141
157
  pricing: {
142
158
  currency: 'CNY',
143
- input: 2.75,
144
- output: 2.88,
159
+ units: [
160
+ { name: 'textInput', rate: 2.75, strategy: 'fixed', unit: 'millionTokens' },
161
+ { name: 'textOutput', rate: 2.88, strategy: 'fixed', unit: 'millionTokens' },
162
+ ],
145
163
  },
146
164
  type: 'chat',
147
165
  },
@@ -157,8 +175,10 @@ const ppioChatModels: AIChatModelCard[] = [
157
175
  id: 'qwen/qwen-2-vl-72b-instruct',
158
176
  pricing: {
159
177
  currency: 'CNY',
160
- input: 4.5,
161
- output: 4.5,
178
+ units: [
179
+ { name: 'textInput', rate: 4.5, strategy: 'fixed', unit: 'millionTokens' },
180
+ { name: 'textOutput', rate: 4.5, strategy: 'fixed', unit: 'millionTokens' },
181
+ ],
162
182
  },
163
183
  type: 'chat',
164
184
  },
@@ -170,8 +190,10 @@ const ppioChatModels: AIChatModelCard[] = [
170
190
  id: 'meta-llama/llama-3.2-3b-instruct',
171
191
  pricing: {
172
192
  currency: 'CNY',
173
- input: 0.216,
174
- output: 0.36,
193
+ units: [
194
+ { name: 'textInput', rate: 0.216, strategy: 'fixed', unit: 'millionTokens' },
195
+ { name: 'textOutput', rate: 0.36, strategy: 'fixed', unit: 'millionTokens' },
196
+ ],
175
197
  },
176
198
  type: 'chat',
177
199
  },
@@ -184,8 +206,10 @@ const ppioChatModels: AIChatModelCard[] = [
184
206
  id: 'qwen/qwen2.5-32b-instruct',
185
207
  pricing: {
186
208
  currency: 'CNY',
187
- input: 1.26,
188
- output: 1.26,
209
+ units: [
210
+ { name: 'textInput', rate: 1.26, strategy: 'fixed', unit: 'millionTokens' },
211
+ { name: 'textOutput', rate: 1.26, strategy: 'fixed', unit: 'millionTokens' },
212
+ ],
189
213
  },
190
214
  type: 'chat',
191
215
  },
@@ -198,8 +222,10 @@ const ppioChatModels: AIChatModelCard[] = [
198
222
  id: 'baichuan/baichuan2-13b-chat',
199
223
  pricing: {
200
224
  currency: 'CNY',
201
- input: 1.75,
202
- output: 1.75,
225
+ units: [
226
+ { name: 'textInput', rate: 1.75, strategy: 'fixed', unit: 'millionTokens' },
227
+ { name: 'textOutput', rate: 1.75, strategy: 'fixed', unit: 'millionTokens' },
228
+ ],
203
229
  },
204
230
  type: 'chat',
205
231
  },
@@ -212,8 +238,10 @@ const ppioChatModels: AIChatModelCard[] = [
212
238
  id: 'meta-llama/llama-3.1-70b-instruct',
213
239
  pricing: {
214
240
  currency: 'CNY',
215
- input: 2.45,
216
- output: 2.82,
241
+ units: [
242
+ { name: 'textInput', rate: 2.45, strategy: 'fixed', unit: 'millionTokens' },
243
+ { name: 'textOutput', rate: 2.82, strategy: 'fixed', unit: 'millionTokens' },
244
+ ],
217
245
  },
218
246
  type: 'chat',
219
247
  },
@@ -226,8 +254,10 @@ const ppioChatModels: AIChatModelCard[] = [
226
254
  id: 'meta-llama/llama-3.1-8b-instruct',
227
255
  pricing: {
228
256
  currency: 'CNY',
229
- input: 0.4,
230
- output: 0.4,
257
+ units: [
258
+ { name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
259
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
260
+ ],
231
261
  },
232
262
  type: 'chat',
233
263
  },
@@ -240,8 +270,10 @@ const ppioChatModels: AIChatModelCard[] = [
240
270
  id: '01-ai/yi-1.5-34b-chat',
241
271
  pricing: {
242
272
  currency: 'CNY',
243
- input: 1.1,
244
- output: 1.1,
273
+ units: [
274
+ { name: 'textInput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
275
+ { name: 'textOutput', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
276
+ ],
245
277
  },
246
278
  type: 'chat',
247
279
  },
@@ -254,8 +286,10 @@ const ppioChatModels: AIChatModelCard[] = [
254
286
  id: '01-ai/yi-1.5-9b-chat',
255
287
  pricing: {
256
288
  currency: 'CNY',
257
- input: 0.4,
258
- output: 0.4,
289
+ units: [
290
+ { name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
291
+ { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
292
+ ],
259
293
  },
260
294
  type: 'chat',
261
295
  },
@@ -267,8 +301,10 @@ const ppioChatModels: AIChatModelCard[] = [
267
301
  id: 'thudm/glm-4-9b-chat',
268
302
  pricing: {
269
303
  currency: 'CNY',
270
- input: 0.5,
271
- output: 0.5,
304
+ units: [
305
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
306
+ { name: 'textOutput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
307
+ ],
272
308
  },
273
309
  type: 'chat',
274
310
  },
@@ -281,8 +317,10 @@ const ppioChatModels: AIChatModelCard[] = [
281
317
  id: 'qwen/qwen-2-7b-instruct',
282
318
  pricing: {
283
319
  currency: 'CNY',
284
- input: 0.32,
285
- output: 0.32,
320
+ units: [
321
+ { name: 'textInput', rate: 0.32, strategy: 'fixed', unit: 'millionTokens' },
322
+ { name: 'textOutput', rate: 0.32, strategy: 'fixed', unit: 'millionTokens' },
323
+ ],
286
324
  },
287
325
  type: 'chat',
288
326
  },