@lobehub/chat 1.135.6 → 1.136.0

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 1.136.0](https://github.com/lobehub/lobe-chat/compare/v1.135.6...v1.136.0)
6
+
7
+ <sup>Released on **2025-10-09**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **misc**: Add new provider Cerebras.
12
+
13
+ #### 🐛 Bug Fixes
14
+
15
+ - **misc**: Fix standalone plugin rerender issue.
16
+
17
+ <br/>
18
+
19
+ <details>
20
+ <summary><kbd>Improvements and Fixes</kbd></summary>
21
+
22
+ #### What's improved
23
+
24
+ - **misc**: Add new provider Cerebras, closes [#9559](https://github.com/lobehub/lobe-chat/issues/9559) ([9cceaad](https://github.com/lobehub/lobe-chat/commit/9cceaad))
25
+
26
+ #### What's fixed
27
+
28
+ - **misc**: Fix standalone plugin rerender issue, closes [#9611](https://github.com/lobehub/lobe-chat/issues/9611) [#9396](https://github.com/lobehub/lobe-chat/issues/9396) ([7ab30fc](https://github.com/lobehub/lobe-chat/commit/7ab30fc))
29
+
30
+ </details>
31
+
32
+ <div align="right">
33
+
34
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
35
+
36
+ </div>
37
+
5
38
  ### [Version 1.135.6](https://github.com/lobehub/lobe-chat/compare/v1.135.5...v1.135.6)
6
39
 
7
40
  <sup>Released on **2025-10-08**</sup>
@@ -302,6 +302,8 @@ ENV \
302
302
  BFL_API_KEY="" BFL_MODEL_LIST="" \
303
303
  # Vercel AI Gateway
304
304
  VERCELAIGATEWAY_API_KEY="" VERCELAIGATEWAY_MODEL_LIST=""
305
+ # Cerebras
306
+ CEREBRAS_API_KEY="" CEREBRAS_MODEL_LIST=""
305
307
 
306
308
  USER nextjs
307
309
 
package/changelog/v1.json CHANGED
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "features": [
5
+ "Add new provider Cerebras."
6
+ ],
7
+ "fixes": [
8
+ "Fix standalone plugin rerender issue."
9
+ ]
10
+ },
11
+ "date": "2025-10-09",
12
+ "version": "1.136.0"
13
+ },
2
14
  {
3
15
  "children": {},
4
16
  "date": "2025-10-08",
@@ -5,7 +5,9 @@ LobeChat is built on the Next.js framework and uses TypeScript as the primary de
5
5
  1. Routing: Define routes (`src/app`).
6
6
  2. Data Structure: Define data structures (`src/types`).
7
7
  3. Business Logic Implementation: Zustand store (`src/store`).
8
- 4. Page Display: Write static components/pages (`src/app/<new-page>/features/<new-feature>.tsx`).
8
+ 4. Page Display: Write static components/pages. Create features in:
9
+ - `src/features/<feature-name>/` for **shared global features** (used across multiple pages)
10
+ - `src/app/<new-page>/features/<feature-name>/` for **page-specific features** (only used in this page)
9
11
  5. Function Binding: Bind the store with page triggers (`const [state, function] = useNewStore(s => [s.state, s.function])`).
10
12
 
11
13
  Taking the "Chat Messages" feature as an example, here are the brief steps to implement this feature:
@@ -60,7 +62,8 @@ export const useChatStore = create<ChatState>((set) => ({
60
62
  In `src/app/<new-page>/features/<new-feature>.tsx`, we need to create a new page or component to display "Chat Messages". In this file, we can use the Zustand Store created earlier and Ant Design components to build the UI:
61
63
 
62
64
  ```jsx
63
- // src/features/chat/index.tsx
65
+ // src/app/chat/features/ChatPage/index.tsx
66
+ // Note: Use src/app/<page>/features/ for page-specific components
64
67
  import { List, Typography } from 'antd';
65
68
  import { useChatStore } from 'src/store/chatStore';
66
69
 
@@ -82,6 +85,12 @@ const ChatPage = () => {
82
85
  export default ChatPage;
83
86
  ```
84
87
 
88
+ > **Note on Feature Organization**: LobeChat uses two patterns for organizing features:
89
+ > - **Global features** (`src/features/`): Shared components like `ChatInput`, `Conversation` used across the app
90
+ > - **Page-specific features** (`src/app/<page>/features/`): Components used only within a specific page route
91
+ >
92
+ > Choose based on reusability. If unsure, start with page-specific and refactor to global if needed elsewhere.
93
+
85
94
  ## 5. Function Binding
86
95
 
87
96
  In a page or component, we need to bind the Zustand Store's state and methods to the UI. In the example above, we have already bound the `messages` state to the `dataSource` property of the list. Now, we also need a method to add new messages. We can define this method in the Zustand Store and then use it in the page or component:
@@ -5,7 +5,9 @@ LobeChat 基于 Next.js 框架构建,使用 TypeScript 作为主要开发语
5
5
  1. 路由:定义路由 (`src/app`)
6
6
  2. 数据结构: 定义数据结构 ( `src/types` )
7
7
  3. 业务功能实现: zustand store (`src/store`)
8
- 4. 页面展示:书写静态组件 / 页面 (`src/app/<new-page>/features/<new-feature>.tsx`)
8
+ 4. 页面展示:书写静态组件 / 页面。根据以下方式创建功能组件:
9
+ - `src/features/<feature-name>/` 用于 **全局共享功能**(跨多个页面使用)
10
+ - `src/app/<new-page>/features/<feature-name>/` 用于 **页面专属功能**(仅在当前页面使用)
9
11
  5. 功能绑定:绑定 store 与页面的触发 (`const [state,function]= useNewStore(s=>[s.state,s.function])`)
10
12
 
11
13
  我们以 "会话消息" 功能为例,以下是实现这个功能的简要步骤:
@@ -60,7 +62,8 @@ export const useChatStore = create<ChatState>((set) => ({
60
62
  在 `src/app/<new-page>/features/<new-feature>.tsx` 中,我们需要创建一个新的页面或组件来显示 "会话消息"。在这个文件中,我们可以使用上面创建的 Zustand Store,以及 Ant Design 的组件来构建 UI:
61
63
 
62
64
  ```jsx
63
- // src/features/chat/index.tsx
65
+ // src/app/chat/features/ChatPage/index.tsx
66
+ // 注意:使用 src/app/<page>/features/ 放置页面专属组件
64
67
  import { List, Typography } from 'antd';
65
68
  import { useChatStore } from 'src/store/chatStore';
66
69
 
@@ -82,6 +85,12 @@ const ChatPage = () => {
82
85
  export default ChatPage;
83
86
  ```
84
87
 
88
+ > **关于功能组件组织方式的说明**:LobeChat 使用两种模式来组织功能组件:
89
+ > - **全局功能**(`src/features/`):跨应用共享的组件,如 `ChatInput`、`Conversation` 等
90
+ > - **页面专属功能**(`src/app/<page>/features/`):仅在特定页面路由中使用的组件
91
+ >
92
+ > 根据可复用性选择合适的方式。如果不确定,可以先放在页面专属位置,需要时再重构为全局共享。
93
+
85
94
  ## 5. 功能绑定
86
95
 
87
96
  在页面或组件中,我们需要将 Zustand Store 的状态和方法绑定到 UI 上。在上面的示例中,我们已经将 `messages` 状态绑定到了列表的 `dataSource` 属性上。现在,我们还需要一个方法来添加新的消息。我们可以在 Zustand Store 中定义这个方法,然后在页面或组件中使用它:
@@ -717,4 +717,20 @@ NewAPI is a multi-provider model aggregation service that supports automatic mod
717
717
  - Default: `-`
718
718
  - Example: `-all,+vercel-model-1,+vercel-model-2=vercel-special`
719
719
 
720
+ ## Cerebras
721
+
722
+ ### `CEREBRAS_API_KEY`
723
+
724
+ - Type: Required
725
+ - Description: This is the API key you applied for in the Cerebras service.
726
+ - Default: -
727
+ - Example: `csk-xxxxxx...xxxxxx`
728
+
729
+ ### `CEREBRAS_MODEL_LIST`
730
+
731
+ - Type: Optional
732
+ - Description: Used to control the Cerebras model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model. Separate multiple entries with commas. The definition syntax follows the same rules as other providers' model lists.
733
+ - Default: `-`
734
+ - Example: `-all,+cerebras-model-1,+cerebras-model-2=cerebras-special`
735
+
720
736
  [model-list]: /docs/self-hosting/advanced/model-list
@@ -720,4 +720,20 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
720
720
  - 默认值:`-`
721
721
  - 示例:`-all,+vercel-model-1,+vercel-model-2=vercel-special`
722
722
 
723
+ ## Cerebras
724
+
725
+ ### `CEREBRAS_API_KEY`
726
+
727
+ - 类型:必选
728
+ - 描述:这是你在 Cerebras 服务中申请的 API 密钥
729
+ - 默认值:-
730
+ - 示例:`csk-xxxxxx...xxxxxx`
731
+
732
+ ### `CEREBRAS_MODEL_LIST`
733
+
734
+ - 类型:可选
735
+ - 描述:用来控制 Cerebras 模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则与其他 provider 保持一致。
736
+ - 默认值:`-`
737
+ - 示例:`-all,+cerebras-model-1,+cerebras-model-2=cerebras-special`
738
+
723
739
  [model-list]: /zh/docs/self-hosting/advanced/model-list
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.135.6",
3
+ "version": "1.136.0",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -15,6 +15,7 @@
15
15
  "./baichuan": "./src/aiModels/baichuan.ts",
16
16
  "./bedrock": "./src/aiModels/bedrock.ts",
17
17
  "./bfl": "./src/aiModels/bfl.ts",
18
+ "./cerebras": "./src/aiModels/cerebras.ts",
18
19
  "./cloudflare": "./src/aiModels/cloudflare.ts",
19
20
  "./cohere": "./src/aiModels/cohere.ts",
20
21
  "./cometapi": "./src/aiModels/cometapi.ts",
@@ -0,0 +1,156 @@
1
+ import { AIChatModelCard } from '../types/aiModel';
2
+
3
+ const cerebrasModels: AIChatModelCard[] = [
4
+ {
5
+ abilities: {
6
+ functionCall: true,
7
+ },
8
+ contextWindowTokens: 32_768,
9
+ description: 'Llama 4 Scout:高性能的 Llama 系列模型,适合需高吞吐与低延迟的场景。',
10
+ displayName: 'Llama 4 Scout',
11
+ id: 'llama-4-scout-17b-16e-instruct',
12
+ pricing: {
13
+ units: [
14
+ { name: 'textInput', rate: 0.65, strategy: 'fixed', unit: 'millionTokens' },
15
+ { name: 'textOutput', rate: 0.85, strategy: 'fixed', unit: 'millionTokens' },
16
+ ],
17
+ },
18
+ type: 'chat',
19
+ },
20
+ {
21
+ abilities: {
22
+ functionCall: true,
23
+ },
24
+ contextWindowTokens: 32_768,
25
+ description:
26
+ 'Llama 4 Maverick:高性能的 Llama 系列模型,适合高级推理、复杂问题解决和指令跟随任务。',
27
+ displayName: 'Llama 4 Maverick',
28
+ id: 'llama-4-maverick-17b-128e-instruct',
29
+ pricing: {
30
+ units: [
31
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
32
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
33
+ ],
34
+ },
35
+ type: 'chat',
36
+ },
37
+ {
38
+ abilities: {
39
+ functionCall: true,
40
+ },
41
+ contextWindowTokens: 32_768,
42
+ description: 'Llama 3.1 8B:小体量、低延迟的 Llama 变体,适合轻量在线推理与交互场景。',
43
+ displayName: 'Llama 3.1 8B',
44
+ id: 'llama3.1-8b',
45
+ pricing: {
46
+ units: [
47
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
48
+ { name: 'textOutput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
49
+ ],
50
+ },
51
+ type: 'chat',
52
+ },
53
+ {
54
+ abilities: {
55
+ functionCall: true,
56
+ },
57
+ contextWindowTokens: 131_072,
58
+ description: 'Llama 3.3 70B:中大型 Llama 模型,兼顾推理能力与吞吐。',
59
+ displayName: 'Llama 3.3 70B',
60
+ id: 'llama-3.3-70b',
61
+ pricing: {
62
+ units: [
63
+ { name: 'textInput', rate: 0.85, strategy: 'fixed', unit: 'millionTokens' },
64
+ { name: 'textOutput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
65
+ ],
66
+ },
67
+ type: 'chat',
68
+ },
69
+ {
70
+ abilities: {
71
+ functionCall: true,
72
+ reasoning: true,
73
+ },
74
+ contextWindowTokens: 131_072,
75
+ displayName: 'GPT OSS 120B',
76
+ enabled: true,
77
+ id: 'gpt-oss-120b',
78
+ pricing: {
79
+ units: [
80
+ { name: 'textInput', rate: 0.35, strategy: 'fixed', unit: 'millionTokens' },
81
+ { name: 'textOutput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
82
+ ],
83
+ },
84
+ settings: {
85
+ extendParams: ['reasoningEffort'],
86
+ },
87
+ type: 'chat',
88
+ },
89
+ {
90
+ abilities: {
91
+ functionCall: true,
92
+ reasoning: true,
93
+ },
94
+ contextWindowTokens: 131_072,
95
+ description: 'Qwen 3 32B:Qwen 系列在多语言与编码任务上表现优良,适合中等规模生产化使用。',
96
+ displayName: 'Qwen 3 32B',
97
+ id: 'qwen-3-32b',
98
+ pricing: {
99
+ units: [
100
+ { name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
101
+ { name: 'textOutput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
102
+ ],
103
+ },
104
+ type: 'chat',
105
+ },
106
+ {
107
+ abilities: {
108
+ functionCall: true,
109
+ },
110
+ contextWindowTokens: 131_072,
111
+ displayName: 'Qwen 3 235B Instruct',
112
+ id: 'qwen-3-235b-a22b-instruct-2507',
113
+ pricing: {
114
+ units: [
115
+ { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
116
+ { name: 'textOutput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
117
+ ],
118
+ },
119
+ type: 'chat',
120
+ },
121
+ {
122
+ abilities: {
123
+ reasoning: true,
124
+ },
125
+ contextWindowTokens: 131_072,
126
+ displayName: 'Qwen 3 235B Thinking',
127
+ id: 'qwen-3-235b-a22b-thinking-2507',
128
+ pricing: {
129
+ units: [
130
+ { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
131
+ { name: 'textOutput', rate: 2.9, strategy: 'fixed', unit: 'millionTokens' },
132
+ ],
133
+ },
134
+ type: 'chat',
135
+ },
136
+ {
137
+ abilities: {
138
+ functionCall: true,
139
+ },
140
+ contextWindowTokens: 131_072,
141
+ description: 'Qwen 3 Coder 480B:面向代码生成与复杂编程任务的长上下文模型。',
142
+ displayName: 'Qwen 3 Coder 480B',
143
+ id: 'qwen-3-coder-480b',
144
+ pricing: {
145
+ units: [
146
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
147
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
148
+ ],
149
+ },
150
+ type: 'chat',
151
+ },
152
+ ];
153
+
154
+ export const allModels = [...cerebrasModels];
155
+
156
+ export default allModels;
@@ -509,7 +509,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
509
509
  },
510
510
  contextWindowTokens: 40_000,
511
511
  description:
512
- '混元多模态理解深度思考模型,支持多模态原生长思维链,擅长处理各种图片推理场景,在理科难题上相比快思考模型全面提升。',
512
+ '混元最新版 t1-vision 视觉深度思考模型,相比上一版模型在通用图文问答、视觉定位、OCR、图表、拍题解题、看图创作等任务上全面提升,显著优化了英文和小语种能力。',
513
513
  displayName: 'Hunyuan T1 Vision 20250916',
514
514
  id: 'hunyuan-t1-vision-20250916',
515
515
  maxOutput: 16_000,
@@ -10,6 +10,7 @@ import { default as azureai } from './azureai';
10
10
  import { default as baichuan } from './baichuan';
11
11
  import { default as bedrock } from './bedrock';
12
12
  import { default as bfl } from './bfl';
13
+ import { default as cerebras } from './cerebras';
13
14
  import { default as cloudflare } from './cloudflare';
14
15
  import { default as cohere } from './cohere';
15
16
  import { default as cometapi } from './cometapi';
@@ -95,6 +96,7 @@ export const LOBE_DEFAULT_MODEL_LIST = buildDefaultModelList({
95
96
  baichuan,
96
97
  bedrock,
97
98
  bfl,
99
+ cerebras,
98
100
  cloudflare,
99
101
  cohere,
100
102
  cometapi,
@@ -161,6 +163,7 @@ export { default as azureai } from './azureai';
161
163
  export { default as baichuan } from './baichuan';
162
164
  export { default as bedrock } from './bedrock';
163
165
  export { default as bfl } from './bfl';
166
+ export { default as cerebras } from './cerebras';
164
167
  export { default as cloudflare } from './cloudflare';
165
168
  export { default as cohere } from './cohere';
166
169
  export { default as cometapi } from './cometapi';
@@ -154,23 +154,6 @@ const nebiusChatModels: AIChatModelCard[] = [
154
154
  },
155
155
  type: 'chat',
156
156
  },
157
- {
158
- abilities: {
159
- functionCall: true,
160
- reasoning: true,
161
- },
162
- contextWindowTokens: 40_960,
163
- displayName: 'Qwen3-235B-A22B',
164
- id: 'Qwen/Qwen3-235B-A22B',
165
- organization: 'Qwen',
166
- pricing: {
167
- units: [
168
- { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
169
- { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
170
- ],
171
- },
172
- type: 'chat',
173
- },
174
157
  {
175
158
  abilities: {
176
159
  functionCall: true,
@@ -188,23 +171,6 @@ const nebiusChatModels: AIChatModelCard[] = [
188
171
  },
189
172
  type: 'chat',
190
173
  },
191
- {
192
- abilities: {
193
- functionCall: true,
194
- reasoning: true,
195
- },
196
- contextWindowTokens: 40_960,
197
- displayName: 'Qwen3-30B-A3B (fast)',
198
- id: 'Qwen/Qwen3-30B-A3B-fast',
199
- organization: 'Qwen',
200
- pricing: {
201
- units: [
202
- { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
203
- { name: 'textOutput', rate: 0.9, strategy: 'fixed', unit: 'millionTokens' },
204
- ],
205
- },
206
- type: 'chat',
207
- },
208
174
  {
209
175
  abilities: {
210
176
  functionCall: true,
@@ -256,23 +222,6 @@ const nebiusChatModels: AIChatModelCard[] = [
256
222
  },
257
223
  type: 'chat',
258
224
  },
259
- {
260
- abilities: {
261
- functionCall: true,
262
- reasoning: true,
263
- },
264
- contextWindowTokens: 40_960,
265
- displayName: 'Qwen3-4B (fast)',
266
- id: 'Qwen/Qwen3-4B-fast',
267
- organization: 'Qwen',
268
- pricing: {
269
- units: [
270
- { name: 'textInput', rate: 0.08, strategy: 'fixed', unit: 'millionTokens' },
271
- { name: 'textOutput', rate: 0.24, strategy: 'fixed', unit: 'millionTokens' },
272
- ],
273
- },
274
- type: 'chat',
275
- },
276
225
  {
277
226
  abilities: {
278
227
  functionCall: true,
@@ -338,39 +287,6 @@ const nebiusChatModels: AIChatModelCard[] = [
338
287
  },
339
288
  type: 'chat',
340
289
  },
341
- {
342
- abilities: {
343
- functionCall: true,
344
- reasoning: true,
345
- },
346
- contextWindowTokens: 163_840,
347
- displayName: 'DeepSeek-R1',
348
- id: 'deepseek-ai/DeepSeek-R1',
349
- organization: 'deepseek',
350
- pricing: {
351
- units: [
352
- { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
353
- { name: 'textOutput', rate: 2.4, strategy: 'fixed', unit: 'millionTokens' },
354
- ],
355
- },
356
- type: 'chat',
357
- },
358
- {
359
- abilities: {
360
- functionCall: true,
361
- },
362
- contextWindowTokens: 163_840,
363
- displayName: 'DeepSeek-R1 (fast)',
364
- id: 'deepseek-ai/DeepSeek-R1-fast',
365
- organization: 'deepseek',
366
- pricing: {
367
- units: [
368
- { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
369
- { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
370
- ],
371
- },
372
- type: 'chat',
373
- },
374
290
  {
375
291
  abilities: {
376
292
  functionCall: true,
@@ -403,22 +319,6 @@ const nebiusChatModels: AIChatModelCard[] = [
403
319
  },
404
320
  type: 'chat',
405
321
  },
406
- {
407
- abilities: {
408
- functionCall: true,
409
- },
410
- contextWindowTokens: 131_072,
411
- displayName: 'Meta-Llama-3.1-70B-Instruct',
412
- id: 'meta-llama/Meta-Llama-3.1-70B-Instruct',
413
- organization: 'meta',
414
- pricing: {
415
- units: [
416
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
417
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
418
- ],
419
- },
420
- type: 'chat',
421
- },
422
322
  {
423
323
  abilities: {
424
324
  functionCall: true,
@@ -467,35 +367,6 @@ const nebiusChatModels: AIChatModelCard[] = [
467
367
  },
468
368
  type: 'chat',
469
369
  },
470
- {
471
- contextWindowTokens: 128_000,
472
- displayName: 'Mistral-Nemo-Instruct-2407',
473
- id: 'mistralai/Mistral-Nemo-Instruct-2407',
474
- organization: 'mistralai',
475
- pricing: {
476
- units: [
477
- { name: 'textInput', rate: 0.04, strategy: 'fixed', unit: 'millionTokens' },
478
- { name: 'textOutput', rate: 0.12, strategy: 'fixed', unit: 'millionTokens' },
479
- ],
480
- },
481
- type: 'chat',
482
- },
483
- {
484
- abilities: {
485
- functionCall: true,
486
- },
487
- contextWindowTokens: 32_768,
488
- displayName: 'Qwen2.5-Coder-7B',
489
- id: 'Qwen/Qwen2.5-Coder-7B',
490
- organization: 'Qwen',
491
- pricing: {
492
- units: [
493
- { name: 'textInput', rate: 0.01, strategy: 'fixed', unit: 'millionTokens' },
494
- { name: 'textOutput', rate: 0.03, strategy: 'fixed', unit: 'millionTokens' },
495
- ],
496
- },
497
- type: 'chat',
498
- },
499
370
  {
500
371
  abilities: {
501
372
  functionCall: true,
@@ -512,38 +383,6 @@ const nebiusChatModels: AIChatModelCard[] = [
512
383
  },
513
384
  type: 'chat',
514
385
  },
515
- {
516
- abilities: {
517
- functionCall: true,
518
- },
519
- contextWindowTokens: 131_072,
520
- displayName: 'Qwen2.5-Coder-32B-Instruct',
521
- id: 'Qwen/Qwen2.5-Coder-32B-Instruct',
522
- organization: 'Qwen',
523
- pricing: {
524
- units: [
525
- { name: 'textInput', rate: 0.06, strategy: 'fixed', unit: 'millionTokens' },
526
- { name: 'textOutput', rate: 0.18, strategy: 'fixed', unit: 'millionTokens' },
527
- ],
528
- },
529
- type: 'chat',
530
- },
531
- {
532
- abilities: {
533
- functionCall: true,
534
- },
535
- contextWindowTokens: 131_072,
536
- displayName: 'Qwen2.5-Coder-32B-Instruct (fast)',
537
- id: 'Qwen/Qwen2.5-Coder-32B-Instruct-fast',
538
- organization: 'Qwen',
539
- pricing: {
540
- units: [
541
- { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
542
- { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
543
- ],
544
- },
545
- type: 'chat',
546
- },
547
386
  {
548
387
  contextWindowTokens: 8192,
549
388
  displayName: 'Gemma-2-2b-it',
@@ -573,38 +412,6 @@ const nebiusChatModels: AIChatModelCard[] = [
573
412
  },
574
413
  type: 'chat',
575
414
  },
576
- {
577
- abilities: {
578
- functionCall: true,
579
- },
580
- contextWindowTokens: 131_072,
581
- displayName: 'Qwen2.5-32B-Instruct',
582
- id: 'Qwen/Qwen2.5-32B-Instruct',
583
- organization: 'Qwen',
584
- pricing: {
585
- units: [
586
- { name: 'textInput', rate: 0.06, strategy: 'fixed', unit: 'millionTokens' },
587
- { name: 'textOutput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
588
- ],
589
- },
590
- type: 'chat',
591
- },
592
- {
593
- abilities: {
594
- functionCall: true,
595
- },
596
- contextWindowTokens: 131_072,
597
- displayName: 'Qwen2.5-32B-Instruct (fast)',
598
- id: 'Qwen/Qwen2.5-32B-Instruct-fast',
599
- organization: 'Qwen',
600
- pricing: {
601
- units: [
602
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
603
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
604
- ],
605
- },
606
- type: 'chat',
607
- },
608
415
  {
609
416
  abilities: {
610
417
  functionCall: true,
@@ -621,38 +428,6 @@ const nebiusChatModels: AIChatModelCard[] = [
621
428
  },
622
429
  type: 'chat',
623
430
  },
624
- {
625
- abilities: {
626
- functionCall: true,
627
- },
628
- contextWindowTokens: 131_072,
629
- displayName: 'Qwen2.5-72B-Instruct (fast)',
630
- id: 'Qwen/Qwen2.5-72B-Instruct-fast',
631
- organization: 'Qwen',
632
- pricing: {
633
- units: [
634
- { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
635
- { name: 'textOutput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
636
- ],
637
- },
638
- type: 'chat',
639
- },
640
- {
641
- abilities: {
642
- functionCall: true,
643
- },
644
- contextWindowTokens: 8192,
645
- displayName: 'Llama3-OpenBioLLM-70B',
646
- id: 'aaditya/Llama3-OpenBioLLM-70B',
647
- organization: 'aaditya',
648
- pricing: {
649
- units: [
650
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
651
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
652
- ],
653
- },
654
- type: 'chat',
655
- },
656
431
  {
657
432
  abilities: {
658
433
  functionCall: true,
@@ -687,22 +462,6 @@ const nebiusChatModels: AIChatModelCard[] = [
687
462
  },
688
463
  type: 'chat',
689
464
  },
690
- {
691
- abilities: {
692
- functionCall: true,
693
- },
694
- contextWindowTokens: 16_384,
695
- displayName: 'phi-4',
696
- id: 'microsoft/phi-4',
697
- organization: 'microsoft',
698
- pricing: {
699
- units: [
700
- { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
701
- { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
702
- ],
703
- },
704
- type: 'chat',
705
- },
706
465
  {
707
466
  abilities: {
708
467
  functionCall: true,
@@ -751,23 +510,6 @@ const nebiusChatModels: AIChatModelCard[] = [
751
510
  },
752
511
  type: 'chat',
753
512
  },
754
- {
755
- abilities: {
756
- functionCall: true,
757
- reasoning: true,
758
- },
759
- contextWindowTokens: 131_072,
760
- displayName: 'DeepSeek-R1-Distill-Llama-70B',
761
- id: 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B',
762
- organization: 'deepseek',
763
- pricing: {
764
- units: [
765
- { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
766
- { name: 'textOutput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
767
- ],
768
- },
769
- type: 'chat',
770
- },
771
513
  {
772
514
  abilities: {
773
515
  functionCall: true,
@@ -784,22 +526,6 @@ const nebiusChatModels: AIChatModelCard[] = [
784
526
  },
785
527
  type: 'chat',
786
528
  },
787
- {
788
- abilities: {
789
- functionCall: true,
790
- },
791
- contextWindowTokens: 131_072,
792
- displayName: 'Llama-3_3-Nemotron-Super-49B-v1',
793
- id: 'nvidia/Llama-3_3-Nemotron-Super-49B-v1',
794
- organization: 'nvidia',
795
- pricing: {
796
- units: [
797
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
798
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
799
- ],
800
- },
801
- type: 'chat',
802
- },
803
529
  {
804
530
  abilities: {
805
531
  functionCall: true,
@@ -865,40 +591,6 @@ const nebiusChatModels: AIChatModelCard[] = [
865
591
  },
866
592
  type: 'chat',
867
593
  },
868
- {
869
- abilities: {
870
- functionCall: true,
871
- vision: true,
872
- },
873
- contextWindowTokens: 32_768,
874
- displayName: 'Qwen2-VL-72B-Instruct',
875
- id: 'Qwen/Qwen2-VL-72B-Instruct',
876
- organization: 'Qwen',
877
- pricing: {
878
- units: [
879
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
880
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
881
- ],
882
- },
883
- type: 'chat',
884
- },
885
- {
886
- abilities: {
887
- functionCall: true,
888
- vision: true,
889
- },
890
- contextWindowTokens: 131_072,
891
- displayName: 'Mistral-Small-3.1-24B-Instruct-2503',
892
- id: 'mistralai/Mistral-Small-3.1-24B-Instruct-2503',
893
- organization: 'mistralai',
894
- pricing: {
895
- units: [
896
- { name: 'textInput', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
897
- { name: 'textOutput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
898
- ],
899
- },
900
- type: 'chat',
901
- },
902
594
  {
903
595
  abilities: {
904
596
  functionCall: true,
@@ -977,17 +669,6 @@ const nebiusChatModels: AIChatModelCard[] = [
977
669
  // },
978
670
  // type: 'image',
979
671
  // },
980
- // {
981
- // contextWindowTokens: 0,
982
- // displayName: 'Stable Diffusion XL 1.0',
983
- // id: 'stability-ai/sdxl',
984
- // pricing: {
985
- // units: [
986
- // { name: 'imageGeneration', rate: 0.003, strategy: 'fixed', unit: 'image' },
987
- // ],
988
- // },
989
- // type: 'image',
990
- // },
991
672
  // ];
992
673
 
993
674
  // export const nebiusEmbeddingModels: AIEmbeddingModelCard[] = [
@@ -1,6 +1,19 @@
1
1
  import { AIChatModelCard } from '../types/aiModel';
2
2
 
3
3
  const ollamaCloudModels: AIChatModelCard[] = [
4
+ {
5
+ abilities: {
6
+ functionCall: true,
7
+ reasoning: true,
8
+ },
9
+ contextWindowTokens: 200_000,
10
+ description:
11
+ '智谱最新旗舰模型 GLM-4.6 (355B) 在高级编码、长文本处理、推理与智能体能力上全面超越前代,尤其在编程能力上对齐 Claude Sonnet 4,成为国内顶尖的 Coding 模型。',
12
+ displayName: 'GLM-4.6',
13
+ enabled: true,
14
+ id: 'glm4.6:355b',
15
+ type: 'chat',
16
+ },
4
17
  {
5
18
  abilities: {
6
19
  functionCall: true,
@@ -73,7 +73,6 @@ const vercelAIGatewayChatModels: AIChatModelCard[] = [
73
73
  description:
74
74
  'Claude Sonnet 4 在 Sonnet 3.7 的行业领先能力基础上进行了显著改进,在编码方面表现出色,在 SWE-bench 上达到了最先进的 72.7%。该模型在性能和效率之间取得了平衡,适用于内部和外部用例,并通过增强的可控性实现对实现的更大控制。',
75
75
  displayName: 'Claude Sonnet 4',
76
- enabled: true,
77
76
  id: 'anthropic/claude-sonnet-4',
78
77
  pricing: {
79
78
  units: [
@@ -118,7 +117,6 @@ const vercelAIGatewayChatModels: AIChatModelCard[] = [
118
117
  description:
119
118
  'OpenAI 的 o3 是最强大的推理模型,在编码、数学、科学和视觉感知方面设立了新的最先进水平。它擅长需要多方面分析的复杂查询,在分析图像、图表和图形方面具有特殊优势。',
120
119
  displayName: 'o3',
121
- enabled: true,
122
120
  id: 'openai/o3',
123
121
  pricing: {
124
122
  units: [
@@ -448,7 +446,6 @@ const vercelAIGatewayChatModels: AIChatModelCard[] = [
448
446
  description:
449
447
  'GLM-4.5 系列模型是专门为智能体设计的基础模型。旗舰 GLM-4.5 集成了 3550 亿总参数(320 亿活跃),统一了推理、编码和代理能力以解决复杂的应用需求。作为混合推理系统,它提供双重操作模式。',
450
448
  displayName: 'GLM-4.5',
451
- enabled: true,
452
449
  id: 'zai/glm-4.5',
453
450
  pricing: {
454
451
  units: [
@@ -160,29 +160,6 @@ const xaiChatModels: AIChatModelCard[] = [
160
160
  },
161
161
  type: 'chat',
162
162
  },
163
- {
164
- abilities: {
165
- functionCall: true,
166
- search: true,
167
- },
168
- contextWindowTokens: 131_072,
169
- description:
170
- '旗舰级模型,擅长数据提取、编程和文本摘要等企业级应用,拥有金融、医疗、法律和科学等领域的深厚知识。',
171
- displayName: 'Grok 3 (Fast mode)',
172
- id: 'grok-3-fast', // legacy
173
- pricing: {
174
- units: [
175
- { name: 'textInput_cacheRead', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
176
- { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
177
- { name: 'textOutput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
178
- ],
179
- },
180
- releasedAt: '2025-04-03',
181
- settings: {
182
- searchImpl: 'params',
183
- },
184
- type: 'chat',
185
- },
186
163
  {
187
164
  abilities: {
188
165
  functionCall: true,
@@ -208,52 +185,6 @@ const xaiChatModels: AIChatModelCard[] = [
208
185
  },
209
186
  type: 'chat',
210
187
  },
211
- {
212
- abilities: {
213
- functionCall: true,
214
- reasoning: true,
215
- search: true,
216
- },
217
- contextWindowTokens: 131_072,
218
- description:
219
- '轻量级模型,回话前会先思考。运行快速、智能,适用于不需要深层领域知识的逻辑任务,并能获取原始的思维轨迹。',
220
- displayName: 'Grok 3 Mini (Fast mode)',
221
- id: 'grok-3-mini-fast', // legacy
222
- pricing: {
223
- units: [
224
- { name: 'textInput_cacheRead', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
225
- { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
226
- { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
227
- ],
228
- },
229
- releasedAt: '2025-04-03',
230
- settings: {
231
- extendParams: ['reasoningEffort'],
232
- searchImpl: 'params',
233
- },
234
- type: 'chat',
235
- },
236
- {
237
- abilities: {
238
- functionCall: true,
239
- search: true,
240
- },
241
- contextWindowTokens: 131_072,
242
- description: '该模型在准确性、指令遵循和多语言能力方面有所改进。',
243
- displayName: 'Grok 2 1212',
244
- id: 'grok-2-1212', // legacy
245
- pricing: {
246
- units: [
247
- { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
248
- { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
249
- ],
250
- },
251
- releasedAt: '2024-12-12',
252
- settings: {
253
- searchImpl: 'params',
254
- },
255
- type: 'chat',
256
- },
257
188
  {
258
189
  abilities: {
259
190
  functionCall: true,
@@ -10,6 +10,7 @@ export enum ModelProvider {
10
10
  Baichuan = 'baichuan',
11
11
  Bedrock = 'bedrock',
12
12
  Bfl = 'bfl',
13
+ Cerebras = 'cerebras',
13
14
  Cloudflare = 'cloudflare',
14
15
  Cohere = 'cohere',
15
16
  CometAPI = 'cometapi',
@@ -10,6 +10,7 @@ export { LobeAzureAI } from './providers/azureai';
10
10
  export { LobeAzureOpenAI } from './providers/azureOpenai';
11
11
  export { LobeBedrockAI } from './providers/bedrock';
12
12
  export { LobeBflAI } from './providers/bfl';
13
+ export { LobeCerebrasAI } from './providers/cerebras';
13
14
  export { LobeCometAPIAI } from './providers/cometapi';
14
15
  export { LobeDeepSeekAI } from './providers/deepseek';
15
16
  export { LobeGoogleAI } from './providers/google';
@@ -0,0 +1,41 @@
1
+ import { ModelProvider } from 'model-bank';
2
+
3
+ import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
4
+ import { processMultiProviderModelList } from '../../utils/modelParse';
5
+
6
+ export const LobeCerebrasAI = createOpenAICompatibleRuntime({
7
+ baseURL: 'https://api.cerebras.ai/v1',
8
+ chatCompletion: {
9
+ handlePayload: (payload) => {
10
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars
11
+ const { frequency_penalty, presence_penalty, model, ...rest } = payload;
12
+
13
+ return {
14
+ ...rest,
15
+ model,
16
+ } as any;
17
+ },
18
+ },
19
+ debug: {
20
+ chatCompletion: () => process.env.DEBUG_CEREBRAS_CHAT_COMPLETION === '1',
21
+ },
22
+ models: async ({ client }) => {
23
+ try {
24
+ const modelsPage = (await client.models.list()) as any;
25
+ const modelList = Array.isArray(modelsPage?.data)
26
+ ? modelsPage.data
27
+ : Array.isArray(modelsPage)
28
+ ? modelsPage
29
+ : [];
30
+
31
+ return await processMultiProviderModelList(modelList, 'cerebras');
32
+ } catch (error) {
33
+ console.warn(
34
+ 'Failed to fetch Cerebras models. Please ensure your Cerebras API key is valid:',
35
+ error,
36
+ );
37
+ return [];
38
+ }
39
+ },
40
+ provider: ModelProvider.Cerebras,
41
+ });
@@ -9,6 +9,7 @@ import { LobeAzureAI } from './providers/azureai';
9
9
  import { LobeBaichuanAI } from './providers/baichuan';
10
10
  import { LobeBedrockAI } from './providers/bedrock';
11
11
  import { LobeBflAI } from './providers/bfl';
12
+ import { LobeCerebrasAI } from './providers/cerebras';
12
13
  import { LobeCloudflareAI } from './providers/cloudflare';
13
14
  import { LobeCohereAI } from './providers/cohere';
14
15
  import { LobeCometAPIAI } from './providers/cometapi';
@@ -74,6 +75,7 @@ export const providerRuntimeMap = {
74
75
  baichuan: LobeBaichuanAI,
75
76
  bedrock: LobeBedrockAI,
76
77
  bfl: LobeBflAI,
78
+ cerebras: LobeCerebrasAI,
77
79
  cloudflare: LobeCloudflareAI,
78
80
  cohere: LobeCohereAI,
79
81
  cometapi: LobeCometAPIAI,
@@ -48,6 +48,7 @@ export interface UserKeyVaults extends SearchEngineKeyVaults {
48
48
  baichuan?: OpenAICompatibleKeyVault;
49
49
  bedrock?: AWSBedrockKeyVault;
50
50
  bfl?: any;
51
+ cerebras?: OpenAICompatibleKeyVault;
51
52
  cloudflare?: CloudflareKeyVault;
52
53
  cohere?: OpenAICompatibleKeyVault;
53
54
  cometapi?: OpenAICompatibleKeyVault;
@@ -0,0 +1,18 @@
1
+ import { ModelProviderCard } from '@/types/llm';
2
+
3
+ const Cerebras: ModelProviderCard = {
4
+ chatModels: [],
5
+ checkModel: 'llama3.1-8b',
6
+ description:
7
+ 'Cerebras 是一个基于其专用 CS-3 系统的 AI 推理平台,旨在提供全球最快、实时响应、高吞吐量的 LLM 服务,专为消除延迟和加速复杂的 AI 工作流(如实时代码生成和代理任务)而设计。',
8
+ id: 'cerebras',
9
+ modelsUrl: 'https://inference-docs.cerebras.ai/models/overview',
10
+ name: 'Cerebras',
11
+ settings: {
12
+ sdkType: 'openai',
13
+ showModelFetcher: true,
14
+ },
15
+ url: 'https://cerebras.ai',
16
+ };
17
+
18
+ export default Cerebras;
@@ -11,6 +11,7 @@ import AzureAIProvider from './azureai';
11
11
  import BaichuanProvider from './baichuan';
12
12
  import BedrockProvider from './bedrock';
13
13
  import BflProvider from './bfl';
14
+ import CerebrasProvider from './cerebras';
14
15
  import CloudflareProvider from './cloudflare';
15
16
  import CohereProvider from './cohere';
16
17
  import CometAPIProvider from './cometapi';
@@ -186,6 +187,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
186
187
  NebiusProvider,
187
188
  CometAPIProvider,
188
189
  VercelAIGatewayProvider,
190
+ CerebrasProvider,
189
191
  ];
190
192
 
191
193
  export const filterEnabledModels = (provider: ModelProviderCard) => {
@@ -208,6 +210,7 @@ export { default as AzureAIProviderCard } from './azureai';
208
210
  export { default as BaichuanProviderCard } from './baichuan';
209
211
  export { default as BedrockProviderCard } from './bedrock';
210
212
  export { default as BflProviderCard } from './bfl';
213
+ export { default as CerebrasProviderCard } from './cerebras';
211
214
  export { default as CloudflareProviderCard } from './cloudflare';
212
215
  export { default as CohereProviderCard } from './cohere';
213
216
  export { default as CometAPIProviderCard } from './cometapi';
package/src/envs/llm.ts CHANGED
@@ -198,6 +198,9 @@ export const getLLMConfig = () => {
198
198
  ENABLED_NEWAPI: z.boolean(),
199
199
  NEWAPI_API_KEY: z.string().optional(),
200
200
  NEWAPI_PROXY_URL: z.string().optional(),
201
+
202
+ ENABLED_CEREBRAS: z.boolean(),
203
+ CEREBRAS_API_KEY: z.string().optional(),
201
204
  },
202
205
  runtimeEnv: {
203
206
  API_KEY_SELECT_MODE: process.env.API_KEY_SELECT_MODE,
@@ -394,6 +397,9 @@ export const getLLMConfig = () => {
394
397
 
395
398
  ENABLED_NEBIUS: !!process.env.NEBIUS_API_KEY,
396
399
  NEBIUS_API_KEY: process.env.NEBIUS_API_KEY,
400
+
401
+ ENABLED_CEREBRAS: !!process.env.CEREBRAS_API_KEY,
402
+ CEREBRAS_API_KEY: process.env.CEREBRAS_API_KEY,
397
403
  },
398
404
  });
399
405
  };
@@ -20,7 +20,8 @@ const PluginDefaultType = memo<PluginStandaloneTypeProps>(({ payload, id, name =
20
20
  const ui = manifest.ui;
21
21
 
22
22
  if (!ui.url) return;
23
-
23
+ // if the id start with "tmp", return directly to avoid duplicate rendering
24
+ if (id.startsWith('tmp')) return;
24
25
  return (
25
26
  <IFrameRender
26
27
  height={ui.height}