@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
@@ -9,8 +9,10 @@ const zerooneChatModels: AIChatModelCard[] = [
9
9
  id: 'yi-lightning',
10
10
  pricing: {
11
11
  currency: 'CNY',
12
- input: 0.99,
13
- output: 0.99,
12
+ units: [
13
+ { name: 'textInput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
14
+ { name: 'textOutput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
15
+ ],
14
16
  },
15
17
  type: 'chat',
16
18
  },
@@ -25,8 +27,10 @@ const zerooneChatModels: AIChatModelCard[] = [
25
27
  id: 'yi-vision-v2',
26
28
  pricing: {
27
29
  currency: 'CNY',
28
- input: 6,
29
- output: 6,
30
+ units: [
31
+ { name: 'textInput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
32
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
33
+ ],
30
34
  },
31
35
  type: 'chat',
32
36
  },
@@ -37,8 +41,10 @@ const zerooneChatModels: AIChatModelCard[] = [
37
41
  id: 'yi-spark',
38
42
  pricing: {
39
43
  currency: 'CNY',
40
- input: 1,
41
- output: 1,
44
+ units: [
45
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
46
+ { name: 'textOutput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
47
+ ],
42
48
  },
43
49
  type: 'chat',
44
50
  },
@@ -49,8 +55,10 @@ const zerooneChatModels: AIChatModelCard[] = [
49
55
  id: 'yi-medium',
50
56
  pricing: {
51
57
  currency: 'CNY',
52
- input: 2.5,
53
- output: 2.5,
58
+ units: [
59
+ { name: 'textInput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
60
+ { name: 'textOutput', rate: 2.5, strategy: 'fixed', unit: 'millionTokens' },
61
+ ],
54
62
  },
55
63
  type: 'chat',
56
64
  },
@@ -61,8 +69,10 @@ const zerooneChatModels: AIChatModelCard[] = [
61
69
  id: 'yi-medium-200k',
62
70
  pricing: {
63
71
  currency: 'CNY',
64
- input: 12,
65
- output: 12,
72
+ units: [
73
+ { name: 'textInput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
74
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
75
+ ],
66
76
  },
67
77
  type: 'chat',
68
78
  },
@@ -73,8 +83,10 @@ const zerooneChatModels: AIChatModelCard[] = [
73
83
  id: 'yi-large-turbo',
74
84
  pricing: {
75
85
  currency: 'CNY',
76
- input: 12,
77
- output: 12,
86
+ units: [
87
+ { name: 'textInput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
88
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
89
+ ],
78
90
  },
79
91
  type: 'chat',
80
92
  },
@@ -86,8 +98,10 @@ const zerooneChatModels: AIChatModelCard[] = [
86
98
  id: 'yi-large-rag',
87
99
  pricing: {
88
100
  currency: 'CNY',
89
- input: 25,
90
- output: 25,
101
+ units: [
102
+ { name: 'textInput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
103
+ { name: 'textOutput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
104
+ ],
91
105
  },
92
106
  type: 'chat',
93
107
  },
@@ -102,8 +116,10 @@ const zerooneChatModels: AIChatModelCard[] = [
102
116
  id: 'yi-large-fc',
103
117
  pricing: {
104
118
  currency: 'CNY',
105
- input: 20,
106
- output: 20,
119
+ units: [
120
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
121
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
122
+ ],
107
123
  },
108
124
  type: 'chat',
109
125
  },
@@ -114,8 +130,10 @@ const zerooneChatModels: AIChatModelCard[] = [
114
130
  id: 'yi-large',
115
131
  pricing: {
116
132
  currency: 'CNY',
117
- input: 20,
118
- output: 20,
133
+ units: [
134
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
135
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
136
+ ],
119
137
  },
120
138
  type: 'chat',
121
139
  },
@@ -129,8 +147,10 @@ const zerooneChatModels: AIChatModelCard[] = [
129
147
  id: 'yi-vision',
130
148
  pricing: {
131
149
  currency: 'CNY',
132
- input: 6,
133
- output: 6,
150
+ units: [
151
+ { name: 'textInput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
152
+ { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
153
+ ],
134
154
  },
135
155
  type: 'chat',
136
156
  },
@@ -141,8 +161,10 @@ const zerooneChatModels: AIChatModelCard[] = [
141
161
  id: 'yi-large-preview',
142
162
  pricing: {
143
163
  currency: 'CNY',
144
- input: 20,
145
- output: 20,
164
+ units: [
165
+ { name: 'textInput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
166
+ { name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
167
+ ],
146
168
  },
147
169
  type: 'chat',
148
170
  },
@@ -153,8 +175,10 @@ const zerooneChatModels: AIChatModelCard[] = [
153
175
  id: 'yi-lightning-lite',
154
176
  pricing: {
155
177
  currency: 'CNY',
156
- input: 0.99,
157
- output: 0.99,
178
+ units: [
179
+ { name: 'textInput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
180
+ { name: 'textOutput', rate: 0.99, strategy: 'fixed', unit: 'millionTokens' },
181
+ ],
158
182
  },
159
183
  type: 'chat',
160
184
  },
@@ -15,10 +15,12 @@ const zhipuChatModels: AIChatModelCard[] = [
15
15
  id: 'glm-4.5',
16
16
  maxOutput: 32_768,
17
17
  pricing: {
18
- cachedInput: 0.8,
19
18
  currency: 'CNY',
20
- input: 4, // 输入长度 [32k, 128k]
21
- output: 16,
19
+ units: [
20
+ { name: 'textInput_cacheRead', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
21
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
22
+ { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
23
+ ],
22
24
  },
23
25
  settings: {
24
26
  extendParams: ['enableReasoning'],
@@ -33,16 +35,17 @@ const zhipuChatModels: AIChatModelCard[] = [
33
35
  search: true,
34
36
  },
35
37
  contextWindowTokens: 128_000,
36
- description:
37
- 'GLM-4.5 的极速版,在性能强劲的同时,生成速度可达 100 tokens/秒。',
38
+ description: 'GLM-4.5 的极速版,在性能强劲的同时,生成速度可达 100 tokens/秒。',
38
39
  displayName: 'GLM-4.5-X',
39
40
  id: 'glm-4.5-x',
40
41
  maxOutput: 32_768,
41
42
  pricing: {
42
- cachedInput: 3.2,
43
43
  currency: 'CNY',
44
- input: 16, // 输入长度 [32k, 128k]
45
- output: 64,
44
+ units: [
45
+ { name: 'textInput_cacheRead', rate: 3.2, strategy: 'fixed', unit: 'millionTokens' },
46
+ { name: 'textInput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
47
+ { name: 'textOutput', rate: 64, strategy: 'fixed', unit: 'millionTokens' },
48
+ ],
46
49
  },
47
50
  settings: {
48
51
  extendParams: ['enableReasoning'],
@@ -57,16 +60,17 @@ const zhipuChatModels: AIChatModelCard[] = [
57
60
  search: true,
58
61
  },
59
62
  contextWindowTokens: 128_000,
60
- description:
61
- 'GLM-4.5 的轻量版,兼顾性能与性价比,可灵活切换混合思考模型。',
63
+ description: 'GLM-4.5 的轻量版,兼顾性能与性价比,可灵活切换混合思考模型。',
62
64
  displayName: 'GLM-4.5-Air',
63
65
  id: 'glm-4.5-air',
64
66
  maxOutput: 32_768,
65
67
  pricing: {
66
- cachedInput: 0.24,
67
68
  currency: 'CNY',
68
- input: 1.2, // 输入长度 [32k, 128k]
69
- output: 8,
69
+ units: [
70
+ { name: 'textInput_cacheRead', rate: 0.24, strategy: 'fixed', unit: 'millionTokens' },
71
+ { name: 'textInput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
72
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
73
+ ],
70
74
  },
71
75
  settings: {
72
76
  extendParams: ['enableReasoning'],
@@ -81,16 +85,17 @@ const zhipuChatModels: AIChatModelCard[] = [
81
85
  search: true,
82
86
  },
83
87
  contextWindowTokens: 128_000,
84
- description:
85
- 'GLM-4.5-Air 的极速版,响应速度更快,专为大规模高速度需求打造。',
88
+ description: 'GLM-4.5-Air 的极速版,响应速度更快,专为大规模高速度需求打造。',
86
89
  displayName: 'GLM-4.5-AirX',
87
90
  id: 'glm-4.5-airx',
88
91
  maxOutput: 32_768,
89
92
  pricing: {
90
- cachedInput: 1.6,
91
93
  currency: 'CNY',
92
- input: 8, // 输入长度 [32k, 128k]
93
- output: 32,
94
+ units: [
95
+ { name: 'textInput_cacheRead', rate: 1.6, strategy: 'fixed', unit: 'millionTokens' },
96
+ { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
97
+ { name: 'textOutput', rate: 32, strategy: 'fixed', unit: 'millionTokens' },
98
+ ],
94
99
  },
95
100
  settings: {
96
101
  extendParams: ['enableReasoning'],
@@ -105,17 +110,18 @@ const zhipuChatModels: AIChatModelCard[] = [
105
110
  search: true,
106
111
  },
107
112
  contextWindowTokens: 128_000,
108
- description:
109
- 'GLM-4.5 的免费版,推理、代码、智能体等任务表现出色。',
113
+ description: 'GLM-4.5 的免费版,推理、代码、智能体等任务表现出色。',
110
114
  displayName: 'GLM-4.5-Flash',
111
115
  enabled: true,
112
116
  id: 'glm-4.5-flash',
113
117
  maxOutput: 32_768,
114
118
  pricing: {
115
- cachedInput: 0,
116
119
  currency: 'CNY',
117
- input: 0,
118
- output: 0,
120
+ units: [
121
+ { name: 'textInput_cacheRead', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
122
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
123
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
124
+ ],
119
125
  },
120
126
  settings: {
121
127
  extendParams: ['enableReasoning'],
@@ -137,8 +143,10 @@ const zhipuChatModels: AIChatModelCard[] = [
137
143
  maxOutput: 16_384,
138
144
  pricing: {
139
145
  currency: 'CNY',
140
- input: 2,
141
- output: 2,
146
+ units: [
147
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
148
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
149
+ ],
142
150
  },
143
151
  settings: {
144
152
  searchImpl: 'params',
@@ -160,8 +168,10 @@ const zhipuChatModels: AIChatModelCard[] = [
160
168
  maxOutput: 16_384,
161
169
  pricing: {
162
170
  currency: 'CNY',
163
- input: 0,
164
- output: 0,
171
+ units: [
172
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
173
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
174
+ ],
165
175
  },
166
176
  settings: {
167
177
  searchImpl: 'params',
@@ -178,8 +188,10 @@ const zhipuChatModels: AIChatModelCard[] = [
178
188
  id: 'glm-zero-preview',
179
189
  pricing: {
180
190
  currency: 'CNY',
181
- input: 10,
182
- output: 10,
191
+ units: [
192
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
193
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
194
+ ],
183
195
  },
184
196
  type: 'chat',
185
197
  },
@@ -195,8 +207,10 @@ const zhipuChatModels: AIChatModelCard[] = [
195
207
  maxOutput: 32_768,
196
208
  pricing: {
197
209
  currency: 'CNY',
198
- input: 0.5,
199
- output: 0.5,
210
+ units: [
211
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
212
+ { name: 'textOutput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
213
+ ],
200
214
  },
201
215
  settings: {
202
216
  searchImpl: 'params',
@@ -215,8 +229,10 @@ const zhipuChatModels: AIChatModelCard[] = [
215
229
  maxOutput: 30_000,
216
230
  pricing: {
217
231
  currency: 'CNY',
218
- input: 5,
219
- output: 5,
232
+ units: [
233
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
234
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
235
+ ],
220
236
  },
221
237
  settings: {
222
238
  searchImpl: 'params',
@@ -235,8 +251,10 @@ const zhipuChatModels: AIChatModelCard[] = [
235
251
  maxOutput: 32_768,
236
252
  pricing: {
237
253
  currency: 'CNY',
238
- input: 0.1,
239
- output: 0.1,
254
+ units: [
255
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
256
+ { name: 'textOutput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
257
+ ],
240
258
  },
241
259
  settings: {
242
260
  searchImpl: 'params',
@@ -249,15 +267,16 @@ const zhipuChatModels: AIChatModelCard[] = [
249
267
  search: true,
250
268
  },
251
269
  contextWindowTokens: 128_000,
252
- description:
253
- 'GLM-Z1 系列具备强大的复杂推理能力,在逻辑推理、数学、编程等领域表现优异。',
270
+ description: 'GLM-Z1 系列具备强大的复杂推理能力,在逻辑推理、数学、编程等领域表现优异。',
254
271
  displayName: 'GLM-Z1-Flash',
255
272
  id: 'glm-z1-flash',
256
273
  maxOutput: 32_768,
257
274
  pricing: {
258
275
  currency: 'CNY',
259
- input: 0,
260
- output: 0,
276
+ units: [
277
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
278
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
279
+ ],
261
280
  },
262
281
  settings: {
263
282
  searchImpl: 'params',
@@ -276,8 +295,10 @@ const zhipuChatModels: AIChatModelCard[] = [
276
295
  maxOutput: 16_000,
277
296
  pricing: {
278
297
  currency: 'CNY',
279
- input: 0,
280
- output: 0,
298
+ units: [
299
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
300
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
301
+ ],
281
302
  },
282
303
  settings: {
283
304
  searchImpl: 'params',
@@ -296,8 +317,10 @@ const zhipuChatModels: AIChatModelCard[] = [
296
317
  maxOutput: 16_000,
297
318
  pricing: {
298
319
  currency: 'CNY',
299
- input: 0.1,
300
- output: 0.1,
320
+ units: [
321
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
322
+ { name: 'textOutput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
323
+ ],
301
324
  },
302
325
  settings: {
303
326
  searchImpl: 'params',
@@ -316,8 +339,10 @@ const zhipuChatModels: AIChatModelCard[] = [
316
339
  maxOutput: 4000,
317
340
  pricing: {
318
341
  currency: 'CNY',
319
- input: 1,
320
- output: 1,
342
+ units: [
343
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
344
+ { name: 'textOutput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
345
+ ],
321
346
  },
322
347
  settings: {
323
348
  searchImpl: 'params',
@@ -336,8 +361,10 @@ const zhipuChatModels: AIChatModelCard[] = [
336
361
  maxOutput: 16_000,
337
362
  pricing: {
338
363
  currency: 'CNY',
339
- input: 0.5,
340
- output: 0.5,
364
+ units: [
365
+ { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
366
+ { name: 'textOutput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
367
+ ],
341
368
  },
342
369
  settings: {
343
370
  searchImpl: 'params',
@@ -356,8 +383,10 @@ const zhipuChatModels: AIChatModelCard[] = [
356
383
  maxOutput: 4000,
357
384
  pricing: {
358
385
  currency: 'CNY',
359
- input: 10,
360
- output: 10,
386
+ units: [
387
+ { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
388
+ { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
389
+ ],
361
390
  },
362
391
  settings: {
363
392
  searchImpl: 'params',
@@ -376,8 +405,10 @@ const zhipuChatModels: AIChatModelCard[] = [
376
405
  id: 'glm-4-alltools',
377
406
  pricing: {
378
407
  currency: 'CNY',
379
- input: 100,
380
- output: 100,
408
+ units: [
409
+ { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
410
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
411
+ ],
381
412
  },
382
413
  settings: {
383
414
  searchImpl: 'params',
@@ -396,8 +427,10 @@ const zhipuChatModels: AIChatModelCard[] = [
396
427
  maxOutput: 4000,
397
428
  pricing: {
398
429
  currency: 'CNY',
399
- input: 5,
400
- output: 5,
430
+ units: [
431
+ { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
432
+ { name: 'textOutput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
433
+ ],
401
434
  },
402
435
  settings: {
403
436
  searchImpl: 'params',
@@ -415,8 +448,10 @@ const zhipuChatModels: AIChatModelCard[] = [
415
448
  id: 'glm-4-0520', // 弃用时间 2025年12月30日
416
449
  pricing: {
417
450
  currency: 'CNY',
418
- input: 100,
419
- output: 100,
451
+ units: [
452
+ { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
453
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
454
+ ],
420
455
  },
421
456
  settings: {
422
457
  searchImpl: 'params',
@@ -434,8 +469,10 @@ const zhipuChatModels: AIChatModelCard[] = [
434
469
  id: 'glm-4', // 弃用时间 2025年6月30日
435
470
  pricing: {
436
471
  currency: 'CNY',
437
- input: 100,
438
- output: 100,
472
+ units: [
473
+ { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
474
+ { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
475
+ ],
439
476
  },
440
477
  settings: {
441
478
  searchImpl: 'params',
@@ -453,8 +490,10 @@ const zhipuChatModels: AIChatModelCard[] = [
453
490
  id: 'glm-4v-flash',
454
491
  pricing: {
455
492
  currency: 'CNY',
456
- input: 0,
457
- output: 0,
493
+ units: [
494
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
495
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
496
+ ],
458
497
  },
459
498
  releasedAt: '2024-12-09',
460
499
  type: 'chat',
@@ -469,8 +508,10 @@ const zhipuChatModels: AIChatModelCard[] = [
469
508
  id: 'glm-4v-plus-0111',
470
509
  pricing: {
471
510
  currency: 'CNY',
472
- input: 4,
473
- output: 4,
511
+ units: [
512
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
513
+ { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
514
+ ],
474
515
  },
475
516
  type: 'chat',
476
517
  },
@@ -484,8 +525,10 @@ const zhipuChatModels: AIChatModelCard[] = [
484
525
  id: 'glm-4v',
485
526
  pricing: {
486
527
  currency: 'CNY',
487
- input: 50,
488
- output: 50,
528
+ units: [
529
+ { name: 'textInput', rate: 50, strategy: 'fixed', unit: 'millionTokens' },
530
+ { name: 'textOutput', rate: 50, strategy: 'fixed', unit: 'millionTokens' },
531
+ ],
489
532
  },
490
533
  type: 'chat',
491
534
  },
@@ -498,8 +541,10 @@ const zhipuChatModels: AIChatModelCard[] = [
498
541
  maxOutput: 32_768,
499
542
  pricing: {
500
543
  currency: 'CNY',
501
- input: 0.1,
502
- output: 0.1,
544
+ units: [
545
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
546
+ { name: 'textOutput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
547
+ ],
503
548
  },
504
549
  type: 'chat',
505
550
  },
@@ -511,8 +556,10 @@ const zhipuChatModels: AIChatModelCard[] = [
511
556
  maxOutput: 4000,
512
557
  pricing: {
513
558
  currency: 'CNY',
514
- input: 1,
515
- output: 1,
559
+ units: [
560
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
561
+ { name: 'textOutput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
562
+ ],
516
563
  },
517
564
  type: 'chat',
518
565
  },
@@ -524,8 +571,10 @@ const zhipuChatModels: AIChatModelCard[] = [
524
571
  maxOutput: 4000,
525
572
  pricing: {
526
573
  currency: 'CNY',
527
- input: 15,
528
- output: 15,
574
+ units: [
575
+ { name: 'textInput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
576
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
577
+ ],
529
578
  },
530
579
  type: 'chat',
531
580
  },
@@ -9,10 +9,6 @@ const Ai21: ModelProviderCard = {
9
9
  enabled: true,
10
10
  functionCall: true,
11
11
  id: 'jamba-1.5-mini',
12
- pricing: {
13
- input: 0.2,
14
- output: 0.4,
15
- },
16
12
  },
17
13
  {
18
14
  contextWindowTokens: 256_000,
@@ -20,10 +16,6 @@ const Ai21: ModelProviderCard = {
20
16
  enabled: true,
21
17
  functionCall: true,
22
18
  id: 'jamba-1.5-large',
23
- pricing: {
24
- input: 2,
25
- output: 8,
26
- },
27
19
  },
28
20
  ],
29
21
  checkModel: 'jamba-mini',
@@ -10,11 +10,6 @@ const Ai360: ModelProviderCard = {
10
10
  displayName: '360GPT2 o1',
11
11
  enabled: true,
12
12
  id: '360gpt2-o1',
13
- pricing: {
14
- currency: 'CNY',
15
- input: 20,
16
- output: 50,
17
- },
18
13
  },
19
14
  {
20
15
  contextWindowTokens: 8000,
@@ -22,11 +17,6 @@ const Ai360: ModelProviderCard = {
22
17
  displayName: '360GPT2 Pro',
23
18
  enabled: true,
24
19
  id: '360gpt2-pro',
25
- pricing: {
26
- currency: 'CNY',
27
- input: 2,
28
- output: 5,
29
- },
30
20
  },
31
21
  {
32
22
  contextWindowTokens: 8000,
@@ -35,11 +25,6 @@ const Ai360: ModelProviderCard = {
35
25
  enabled: true,
36
26
  functionCall: true,
37
27
  id: '360gpt-pro',
38
- pricing: {
39
- currency: 'CNY',
40
- input: 2,
41
- output: 5,
42
- },
43
28
  },
44
29
  {
45
30
  contextWindowTokens: 7000,
@@ -47,11 +32,6 @@ const Ai360: ModelProviderCard = {
47
32
  displayName: '360GPT Turbo',
48
33
  enabled: true,
49
34
  id: '360gpt-turbo',
50
- pricing: {
51
- currency: 'CNY',
52
- input: 1,
53
- output: 2,
54
- },
55
35
  },
56
36
  ],
57
37
  checkModel: '360gpt-turbo',