Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat: Add new provider Cerebras (#9559)

sxjeru9cceaad24115
diff --git a/Dockerfile.database b/Dockerfile.database
index 15a8954149c..e935927f50d 100644
--- a/Dockerfile.database
+++ b/Dockerfile.database
@@ -302,6 +302,8 @@ ENV \
BFL_API_KEY="" BFL_MODEL_LIST="" \
# Vercel AI Gateway
VERCELAIGATEWAY_API_KEY="" VERCELAIGATEWAY_MODEL_LIST=""
+ # Cerebras
+ CEREBRAS_API_KEY="" CEREBRAS_MODEL_LIST=""
USER nextjs
diff --git a/docs/self-hosting/environment-variables/model-provider.mdx b/docs/self-hosting/environment-variables/model-provider.mdx
index f823edcd421..29136e8d372 100644
--- a/docs/self-hosting/environment-variables/model-provider.mdx
+++ b/docs/self-hosting/environment-variables/model-provider.mdx
@@ -717,4 +717,20 @@ NewAPI is a multi-provider model aggregation service that supports automatic mod
- Default: `-`
- Example: `-all,+vercel-model-1,+vercel-model-2=vercel-special`
+## Cerebras
+
+### `CEREBRAS_API_KEY`
+
+- Type: Required
+- Description: This is the API key you applied for in the Cerebras service.
+- Default: -
+- Example: `csk-xxxxxx...xxxxxx`
+
+### `CEREBRAS_MODEL_LIST`
+
+- Type: Optional
+- 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.
+- Default: `-`
+- Example: `-all,+cerebras-model-1,+cerebras-model-2=cerebras-special`
+
[model-list]: /docs/self-hosting/advanced/model-list
diff --git a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx
index b575fd19e43..0d539efa29f 100644
--- a/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx
+++ b/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx
@@ -720,4 +720,20 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
- 默认值:`-`
- 示例:`-all,+vercel-model-1,+vercel-model-2=vercel-special`
+## Cerebras
+
+### `CEREBRAS_API_KEY`
+
+- 类型:必选
+- 描述:这是你在 Cerebras 服务中申请的 API 密钥
+- 默认值:-
+- 示例:`csk-xxxxxx...xxxxxx`
+
+### `CEREBRAS_MODEL_LIST`
+
+- 类型:可选
+- 描述:用来控制 Cerebras 模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则与其他 provider 保持一致。
+- 默认值:`-`
+- 示例:`-all,+cerebras-model-1,+cerebras-model-2=cerebras-special`
+
[model-list]: /zh/docs/self-hosting/advanced/model-list
diff --git a/packages/model-bank/package.json b/packages/model-bank/package.json
index a2e4cd8d351..fd362407b11 100644
--- a/packages/model-bank/package.json
+++ b/packages/model-bank/package.json
@@ -15,6 +15,7 @@
"./baichuan": "./src/aiModels/baichuan.ts",
"./bedrock": "./src/aiModels/bedrock.ts",
"./bfl": "./src/aiModels/bfl.ts",
+ "./cerebras": "./src/aiModels/cerebras.ts",
"./cloudflare": "./src/aiModels/cloudflare.ts",
"./cohere": "./src/aiModels/cohere.ts",
"./cometapi": "./src/aiModels/cometapi.ts",
diff --git a/packages/model-bank/src/aiModels/cerebras.ts b/packages/model-bank/src/aiModels/cerebras.ts
new file mode 100644
index 00000000000..f43841b81af
--- /dev/null
+++ b/packages/model-bank/src/aiModels/cerebras.ts
@@ -0,0 +1,156 @@
+import { AIChatModelCard } from '../types/aiModel';
+
+const cerebrasModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ },
+ contextWindowTokens: 32_768,
+ description: 'Llama 4 Scout:高性能的 Llama 系列模型,适合需高吞吐与低延迟的场景。',
+ displayName: 'Llama 4 Scout',
+ id: 'llama-4-scout-17b-16e-instruct',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.65, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 0.85, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ },
+ contextWindowTokens: 32_768,
+ description:
+ 'Llama 4 Maverick:高性能的 Llama 系列模型,适合高级推理、复杂问题解决和指令跟随任务。',
+ displayName: 'Llama 4 Maverick',
+ id: 'llama-4-maverick-17b-128e-instruct',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ },
+ contextWindowTokens: 32_768,
+ description: 'Llama 3.1 8B:小体量、低延迟的 Llama 变体,适合轻量在线推理与交互场景。',
+ displayName: 'Llama 3.1 8B',
+ id: 'llama3.1-8b',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ },
+ contextWindowTokens: 131_072,
+ description: 'Llama 3.3 70B:中大型 Llama 模型,兼顾推理能力与吞吐。',
+ displayName: 'Llama 3.3 70B',
+ id: 'llama-3.3-70b',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.85, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 131_072,
+ displayName: 'GPT OSS 120B',
+ enabled: true,
+ id: 'gpt-oss-120b',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.35, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ settings: {
+ extendParams: ['reasoningEffort'],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 131_072,
+ description: 'Qwen 3 32B:Qwen 系列在多语言与编码任务上表现优良,适合中等规模生产化使用。',
+ displayName: 'Qwen 3 32B',
+ id: 'qwen-3-32b',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ },
+ contextWindowTokens: 131_072,
+ displayName: 'Qwen 3 235B Instruct',
+ id: 'qwen-3-235b-a22b-instruct-2507',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ reasoning: true,
+ },
+ contextWindowTokens: 131_072,
+ displayName: 'Qwen 3 235B Thinking',
+ id: 'qwen-3-235b-a22b-thinking-2507',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 2.9, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ },
+ contextWindowTokens: 131_072,
+ description: 'Qwen 3 Coder 480B:面向代码生成与复杂编程任务的长上下文模型。',
+ displayName: 'Qwen 3 Coder 480B',
+ id: 'qwen-3-coder-480b',
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ type: 'chat',
+ },
+];
+
+export const allModels = [...cerebrasModels];
+
+export default allModels;
diff --git a/packages/model-bank/src/aiModels/hunyuan.ts b/packages/model-bank/src/aiModels/hunyuan.ts
index 9ab708c920b..84f9a991599 100644
--- a/packages/model-bank/src/aiModels/hunyuan.ts
+++ b/packages/model-bank/src/aiModels/hunyuan.ts
@@ -509,7 +509,7 @@ const hunyuanChatModels: AIChatModelCard[] = [
},
contextWindowTokens: 40_000,
description:
- '混元多模态理解深度思考模型,支持多模态原生长思维链,擅长处理各种图片推理场景,在理科难题上相比快思考模型全面提升。',
+ '混元最新版 t1-vision 视觉深度思考模型,相比上一版模型在通用图文问答、视觉定位、OCR、图表、拍题解题、看图创作等任务上全面提升,显著优化了英文和小语种能力。',
displayName: 'Hunyuan T1 Vision 20250916',
id: 'hunyuan-t1-vision-20250916',
maxOutput: 16_000,
diff --git a/packages/model-bank/src/aiModels/index.ts b/packages/model-bank/src/aiModels/index.ts
index c2da25f4584..22eb5ec20fe 100644
--- a/packages/model-bank/src/aiModels/index.ts
+++ b/packages/model-bank/src/aiModels/index.ts
@@ -10,6 +10,7 @@ import { default as azureai } from './azureai';
import { default as baichuan } from './baichuan';
import { default as bedrock } from './bedrock';
import { default as bfl } from './bfl';
+import { default as cerebras } from './cerebras';
import { default as cloudflare } from './cloudflare';
import { default as cohere } from './cohere';
import { default as cometapi } from './cometapi';
@@ -95,6 +96,7 @@ export const LOBE_DEFAULT_MODEL_LIST = buildDefaultModelList({
baichuan,
bedrock,
bfl,
+ cerebras,
cloudflare,
cohere,
cometapi,
@@ -161,6 +163,7 @@ export { default as azureai } from './azureai';
export { default as baichuan } from './baichuan';
export { default as bedrock } from './bedrock';
export { default as bfl } from './bfl';
+export { default as cerebras } from './cerebras';
export { default as cloudflare } from './cloudflare';
export { default as cohere } from './cohere';
export { default as cometapi } from './cometapi';
diff --git a/packages/model-bank/src/aiModels/nebius.ts b/packages/model-bank/src/aiModels/nebius.ts
index 2e73f4ead7c..68483be890d 100644
--- a/packages/model-bank/src/aiModels/nebius.ts
+++ b/packages/model-bank/src/aiModels/nebius.ts
@@ -154,23 +154,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- },
- contextWindowTokens: 40_960,
- displayName: 'Qwen3-235B-A22B',
- id: 'Qwen/Qwen3-235B-A22B',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -188,23 +171,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- },
- contextWindowTokens: 40_960,
- displayName: 'Qwen3-30B-A3B (fast)',
- id: 'Qwen/Qwen3-30B-A3B-fast',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.9, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -256,23 +222,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- },
- contextWindowTokens: 40_960,
- displayName: 'Qwen3-4B (fast)',
- id: 'Qwen/Qwen3-4B-fast',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.08, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.24, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -338,39 +287,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- },
- contextWindowTokens: 163_840,
- displayName: 'DeepSeek-R1',
- id: 'deepseek-ai/DeepSeek-R1',
- organization: 'deepseek',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 2.4, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 163_840,
- displayName: 'DeepSeek-R1 (fast)',
- id: 'deepseek-ai/DeepSeek-R1-fast',
- organization: 'deepseek',
- pricing: {
- units: [
- { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -403,22 +319,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'Meta-Llama-3.1-70B-Instruct',
- id: 'meta-llama/Meta-Llama-3.1-70B-Instruct',
- organization: 'meta',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -467,35 +367,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- contextWindowTokens: 128_000,
- displayName: 'Mistral-Nemo-Instruct-2407',
- id: 'mistralai/Mistral-Nemo-Instruct-2407',
- organization: 'mistralai',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.04, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.12, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 32_768,
- displayName: 'Qwen2.5-Coder-7B',
- id: 'Qwen/Qwen2.5-Coder-7B',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.01, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.03, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -512,38 +383,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'Qwen2.5-Coder-32B-Instruct',
- id: 'Qwen/Qwen2.5-Coder-32B-Instruct',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.06, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.18, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'Qwen2.5-Coder-32B-Instruct (fast)',
- id: 'Qwen/Qwen2.5-Coder-32B-Instruct-fast',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
contextWindowTokens: 8192,
displayName: 'Gemma-2-2b-it',
@@ -573,38 +412,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'Qwen2.5-32B-Instruct',
- id: 'Qwen/Qwen2.5-32B-Instruct',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.06, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'Qwen2.5-32B-Instruct (fast)',
- id: 'Qwen/Qwen2.5-32B-Instruct-fast',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -621,38 +428,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'Qwen2.5-72B-Instruct (fast)',
- id: 'Qwen/Qwen2.5-72B-Instruct-fast',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 8192,
- displayName: 'Llama3-OpenBioLLM-70B',
- id: 'aaditya/Llama3-OpenBioLLM-70B',
- organization: 'aaditya',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -687,22 +462,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 16_384,
- displayName: 'phi-4',
- id: 'microsoft/phi-4',
- organization: 'microsoft',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.1, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -751,23 +510,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'DeepSeek-R1-Distill-Llama-70B',
- id: 'deepseek-ai/DeepSeek-R1-Distill-Llama-70B',
- organization: 'deepseek',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -784,22 +526,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'Llama-3_3-Nemotron-Super-49B-v1',
- id: 'nvidia/Llama-3_3-Nemotron-Super-49B-v1',
- organization: 'nvidia',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -865,40 +591,6 @@ const nebiusChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- vision: true,
- },
- contextWindowTokens: 32_768,
- displayName: 'Qwen2-VL-72B-Instruct',
- id: 'Qwen/Qwen2-VL-72B-Instruct',
- organization: 'Qwen',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.13, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- vision: true,
- },
- contextWindowTokens: 131_072,
- displayName: 'Mistral-Small-3.1-24B-Instruct-2503',
- id: 'mistralai/Mistral-Small-3.1-24B-Instruct-2503',
- organization: 'mistralai',
- pricing: {
- units: [
- { name: 'textInput', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -977,17 +669,6 @@ const nebiusChatModels: AIChatModelCard[] = [
// },
// type: 'image',
// },
-// {
-// contextWindowTokens: 0,
-// displayName: 'Stable Diffusion XL 1.0',
-// id: 'stability-ai/sdxl',
-// pricing: {
-// units: [
-// { name: 'imageGeneration', rate: 0.003, strategy: 'fixed', unit: 'image' },
-// ],
-// },
-// type: 'image',
-// },
// ];
// export const nebiusEmbeddingModels: AIEmbeddingModelCard[] = [
diff --git a/packages/model-bank/src/aiModels/ollamacloud.ts b/packages/model-bank/src/aiModels/ollamacloud.ts
index ac2ad70e70f..95ea69741ad 100644
--- a/packages/model-bank/src/aiModels/ollamacloud.ts
+++ b/packages/model-bank/src/aiModels/ollamacloud.ts
@@ -1,6 +1,19 @@
import { AIChatModelCard } from '../types/aiModel';
const ollamaCloudModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 200_000,
+ description:
+ '智谱最新旗舰模型 GLM-4.6 (355B) 在高级编码、长文本处理、推理与智能体能力上全面超越前代,尤其在编程能力上对齐 Claude Sonnet 4,成为国内顶尖的 Coding 模型。',
+ displayName: 'GLM-4.6',
+ enabled: true,
+ id: 'glm4.6:355b',
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/aiModels/vercelaigateway.ts b/packages/model-bank/src/aiModels/vercelaigateway.ts
index 60669e14484..f4151637314 100644
--- a/packages/model-bank/src/aiModels/vercelaigateway.ts
+++ b/packages/model-bank/src/aiModels/vercelaigateway.ts
@@ -73,7 +73,6 @@ const vercelAIGatewayChatModels: AIChatModelCard[] = [
description:
'Claude Sonnet 4 在 Sonnet 3.7 的行业领先能力基础上进行了显著改进,在编码方面表现出色,在 SWE-bench 上达到了最先进的 72.7%。该模型在性能和效率之间取得了平衡,适用于内部和外部用例,并通过增强的可控性实现对实现的更大控制。',
displayName: 'Claude Sonnet 4',
- enabled: true,
id: 'anthropic/claude-sonnet-4',
pricing: {
units: [
@@ -118,7 +117,6 @@ const vercelAIGatewayChatModels: AIChatModelCard[] = [
description:
'OpenAI 的 o3 是最强大的推理模型,在编码、数学、科学和视觉感知方面设立了新的最先进水平。它擅长需要多方面分析的复杂查询,在分析图像、图表和图形方面具有特殊优势。',
displayName: 'o3',
- enabled: true,
id: 'openai/o3',
pricing: {
units: [
@@ -448,7 +446,6 @@ const vercelAIGatewayChatModels: AIChatModelCard[] = [
description:
'GLM-4.5 系列模型是专门为智能体设计的基础模型。旗舰 GLM-4.5 集成了 3550 亿总参数(320 亿活跃),统一了推理、编码和代理能力以解决复杂的应用需求。作为混合推理系统,它提供双重操作模式。',
displayName: 'GLM-4.5',
- enabled: true,
id: 'zai/glm-4.5',
pricing: {
units: [
diff --git a/packages/model-bank/src/aiModels/xai.ts b/packages/model-bank/src/aiModels/xai.ts
index 1489770849a..4cf8342ec75 100644
--- a/packages/model-bank/src/aiModels/xai.ts
+++ b/packages/model-bank/src/aiModels/xai.ts
@@ -160,29 +160,6 @@ const xaiChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- search: true,
- },
- contextWindowTokens: 131_072,
- description:
- '旗舰级模型,擅长数据提取、编程和文本摘要等企业级应用,拥有金融、医疗、法律和科学等领域的深厚知识。',
- displayName: 'Grok 3 (Fast mode)',
- id: 'grok-3-fast', // legacy
- pricing: {
- units: [
- { name: 'textInput_cacheRead', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2025-04-03',
- settings: {
- searchImpl: 'params',
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -208,52 +185,6 @@ const xaiChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- reasoning: true,
- search: true,
- },
- contextWindowTokens: 131_072,
- description:
- '轻量级模型,回话前会先思考。运行快速、智能,适用于不需要深层领域知识的逻辑任务,并能获取原始的思维轨迹。',
- displayName: 'Grok 3 Mini (Fast mode)',
- id: 'grok-3-mini-fast', // legacy
- pricing: {
- units: [
- { name: 'textInput_cacheRead', rate: 0.15, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2025-04-03',
- settings: {
- extendParams: ['reasoningEffort'],
- searchImpl: 'params',
- },
- type: 'chat',
- },
- {
- abilities: {
- functionCall: true,
- search: true,
- },
- contextWindowTokens: 131_072,
- description: '该模型在准确性、指令遵循和多语言能力方面有所改进。',
- displayName: 'Grok 2 1212',
- id: 'grok-2-1212', // legacy
- pricing: {
- units: [
- { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2024-12-12',
- settings: {
- searchImpl: 'params',
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/const/modelProvider.ts b/packages/model-bank/src/const/modelProvider.ts
index b22d11f17a9..a4c3f03821f 100644
--- a/packages/model-bank/src/const/modelProvider.ts
+++ b/packages/model-bank/src/const/modelProvider.ts
@@ -10,6 +10,7 @@ export enum ModelProvider {
Baichuan = 'baichuan',
Bedrock = 'bedrock',
Bfl = 'bfl',
+ Cerebras = 'cerebras',
Cloudflare = 'cloudflare',
Cohere = 'cohere',
CometAPI = 'cometapi',
diff --git a/packages/model-runtime/src/index.ts b/packages/model-runtime/src/index.ts
index 1a98dce9dab..37c6f608545 100644
--- a/packages/model-runtime/src/index.ts
+++ b/packages/model-runtime/src/index.ts
@@ -10,6 +10,7 @@ export { LobeAzureAI } from './providers/azureai';
export { LobeAzureOpenAI } from './providers/azureOpenai';
export { LobeBedrockAI } from './providers/bedrock';
export { LobeBflAI } from './providers/bfl';
+export { LobeCerebrasAI } from './providers/cerebras';
export { LobeCometAPIAI } from './providers/cometapi';
export { LobeDeepSeekAI } from './providers/deepseek';
export { LobeGoogleAI } from './providers/google';
diff --git a/packages/model-runtime/src/providers/cerebras/index.ts b/packages/model-runtime/src/providers/cerebras/index.ts
new file mode 100644
index 00000000000..56c737af1ae
--- /dev/null
+++ b/packages/model-runtime/src/providers/cerebras/index.ts
@@ -0,0 +1,41 @@
+import { ModelProvider } from 'model-bank';
+
+import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
+import { processMultiProviderModelList } from '../../utils/modelParse';
+
+export const LobeCerebrasAI = createOpenAICompatibleRuntime({
+ baseURL: 'https://api.cerebras.ai/v1',
+ chatCompletion: {
+ handlePayload: (payload) => {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars
+ const { frequency_penalty, presence_penalty, model, ...rest } = payload;
+
+ return {
+ ...rest,
+ model,
+ } as any;
+ },
+ },
+ debug: {
+ chatCompletion: () => process.env.DEBUG_CEREBRAS_CHAT_COMPLETION === '1',
+ },
+ models: async ({ client }) => {
+ try {
+ const modelsPage = (await client.models.list()) as any;
+ const modelList = Array.isArray(modelsPage?.data)
+ ? modelsPage.data
+ : Array.isArray(modelsPage)
+ ? modelsPage
+ : [];
+
+ return await processMultiProviderModelList(modelList, 'cerebras');
+ } catch (error) {
+ console.warn(
+ 'Failed to fetch Cerebras models. Please ensure your Cerebras API key is valid:',
+ error,
+ );
+ return [];
+ }
+ },
+ provider: ModelProvider.Cerebras,
+});
diff --git a/packages/model-runtime/src/runtimeMap.ts b/packages/model-runtime/src/runtimeMap.ts
index 15d0b567a28..eebbfe7c21d 100644
--- a/packages/model-runtime/src/runtimeMap.ts
+++ b/packages/model-runtime/src/runtimeMap.ts
@@ -9,6 +9,7 @@ import { LobeAzureAI } from './providers/azureai';
import { LobeBaichuanAI } from './providers/baichuan';
import { LobeBedrockAI } from './providers/bedrock';
import { LobeBflAI } from './providers/bfl';
+import { LobeCerebrasAI } from './providers/cerebras';
import { LobeCloudflareAI } from './providers/cloudflare';
import { LobeCohereAI } from './providers/cohere';
import { LobeCometAPIAI } from './providers/cometapi';
@@ -74,6 +75,7 @@ export const providerRuntimeMap = {
baichuan: LobeBaichuanAI,
bedrock: LobeBedrockAI,
bfl: LobeBflAI,
+ cerebras: LobeCerebrasAI,
cloudflare: LobeCloudflareAI,
cohere: LobeCohereAI,
cometapi: LobeCometAPIAI,
diff --git a/packages/types/src/user/settings/keyVaults.ts b/packages/types/src/user/settings/keyVaults.ts
index 12405718c0e..673350f160a 100644
--- a/packages/types/src/user/settings/keyVaults.ts
+++ b/packages/types/src/user/settings/keyVaults.ts
@@ -48,6 +48,7 @@ export interface UserKeyVaults extends SearchEngineKeyVaults {
baichuan?: OpenAICompatibleKeyVault;
bedrock?: AWSBedrockKeyVault;
bfl?: any;
+ cerebras?: OpenAICompatibleKeyVault;
cloudflare?: CloudflareKeyVault;
cohere?: OpenAICompatibleKeyVault;
cometapi?: OpenAICompatibleKeyVault;
diff --git a/src/config/modelProviders/cerebras.ts b/src/config/modelProviders/cerebras.ts
new file mode 100644
index 00000000000..acb1051b06e
--- /dev/null
+++ b/src/config/modelProviders/cerebras.ts
@@ -0,0 +1,18 @@
+import { ModelProviderCard } from '@/types/llm';
+
+const Cerebras: ModelProviderCard = {
+ chatModels: [],
+ checkModel: 'llama3.1-8b',
+ description:
+ 'Cerebras 是一个基于其专用 CS-3 系统的 AI 推理平台,旨在提供全球最快、实时响应、高吞吐量的 LLM 服务,专为消除延迟和加速复杂的 AI 工作流(如实时代码生成和代理任务)而设计。',
+ id: 'cerebras',
+ modelsUrl: 'https://inference-docs.cerebras.ai/models/overview',
+ name: 'Cerebras',
+ settings: {
+ sdkType: 'openai',
+ showModelFetcher: true,
+ },
+ url: 'https://cerebras.ai',
+};
+
+export default Cerebras;
diff --git a/src/config/modelProviders/index.ts b/src/config/modelProviders/index.ts
index f1dd2729ec9..b23b1154363 100644
--- a/src/config/modelProviders/index.ts
+++ b/src/config/modelProviders/index.ts
@@ -11,6 +11,7 @@ import AzureAIProvider from './azureai';
import BaichuanProvider from './baichuan';
import BedrockProvider from './bedrock';
import BflProvider from './bfl';
+import CerebrasProvider from './cerebras';
import CloudflareProvider from './cloudflare';
import CohereProvider from './cohere';
import CometAPIProvider from './cometapi';
@@ -186,6 +187,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
NebiusProvider,
CometAPIProvider,
VercelAIGatewayProvider,
+ CerebrasProvider,
];
export const filterEnabledModels = (provider: ModelProviderCard) => {
@@ -208,6 +210,7 @@ export { default as AzureAIProviderCard } from './azureai';
export { default as BaichuanProviderCard } from './baichuan';
export { default as BedrockProviderCard } from './bedrock';
export { default as BflProviderCard } from './bfl';
+export { default as CerebrasProviderCard } from './cerebras';
export { default as CloudflareProviderCard } from './cloudflare';
export { default as CohereProviderCard } from './cohere';
export { default as CometAPIProviderCard } from './cometapi';
diff --git a/src/envs/llm.ts b/src/envs/llm.ts
index 83196cb5809..5b932bad751 100644
--- a/src/envs/llm.ts
+++ b/src/envs/llm.ts
@@ -198,6 +198,9 @@ export const getLLMConfig = () => {
ENABLED_NEWAPI: z.boolean(),
NEWAPI_API_KEY: z.string().optional(),
NEWAPI_PROXY_URL: z.string().optional(),
+
+ ENABLED_CEREBRAS: z.boolean(),
+ CEREBRAS_API_KEY: z.string().optional(),
},
runtimeEnv: {
API_KEY_SELECT_MODE: process.env.API_KEY_SELECT_MODE,
@@ -394,6 +397,9 @@ export const getLLMConfig = () => {
ENABLED_NEBIUS: !!process.env.NEBIUS_API_KEY,
NEBIUS_API_KEY: process.env.NEBIUS_API_KEY,
+
+ ENABLED_CEREBRAS: !!process.env.CEREBRAS_API_KEY,
+ CEREBRAS_API_KEY: process.env.CEREBRAS_API_KEY,
},
});
};