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.

🐛 fix: OllamaCloud error (#9481)

sxjeru55c45a5197d9
diff --git a/packages/model-bank/src/aiModels/aihubmix.ts b/packages/model-bank/src/aiModels/aihubmix.ts
index 599ae67200f..2106817c378 100644
--- a/packages/model-bank/src/aiModels/aihubmix.ts
+++ b/packages/model-bank/src/aiModels/aihubmix.ts
@@ -526,6 +526,40 @@ const aihubmixModels: AIChatModelCard[] = [
},
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ search: true,
+ vision: true,
+ },
+ contextWindowTokens: 200_000,
+ description:
+ 'Sonnet 4.5 是世界上最好的代理、编码和计算机使用模型。它也是我们在长时间运行任务中最准确、最详细的模型,具有增强的编码、金融和网络安全领域知识。',
+ displayName: 'Claude Sonnet 4.5',
+ enabled: true,
+ id: 'claude-sonnet-4-5-20250929',
+ maxOutput: 64_000,
+ pricing: {
+ units: [
+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: { prices: { '1h': 6, '5m': 3.75 }, pricingParams: ['ttl'] },
+ name: 'textInput_cacheWrite',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ ],
+ },
+ releasedAt: '2025-09-29',
+ settings: {
+ extendParams: ['disableContextCaching', 'enableReasoning', 'reasoningBudgetToken'],
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -537,7 +571,6 @@ const aihubmixModels: AIChatModelCard[] = [
description:
'Claude Sonnet 4 可以产生近乎即时的响应或延长的逐步思考,用户可以清晰地看到这些过程。API 用户还可以对模型思考的时间进行细致的控制',
displayName: 'Claude Sonnet 4',
- enabled: true,
id: 'claude-sonnet-4-20250514',
maxOutput: 64_000,
pricing: {
diff --git a/packages/model-bank/src/aiModels/anthropic.ts b/packages/model-bank/src/aiModels/anthropic.ts
index d62c90bb322..208d340d4aa 100644
--- a/packages/model-bank/src/aiModels/anthropic.ts
+++ b/packages/model-bank/src/aiModels/anthropic.ts
@@ -22,7 +22,7 @@ const anthropicChatModels: AIChatModelCard[] = [
{ name: 'textInput_cacheWrite', rate: 3.75, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-09-30',
+ releasedAt: '2025-09-29',
settings: {
extendParams: ['disableContextCaching', 'enableReasoning', 'reasoningBudgetToken'],
searchImpl: 'params',
@@ -107,7 +107,6 @@ const anthropicChatModels: AIChatModelCard[] = [
description:
'Claude Sonnet 4 可以产生近乎即时的响应或延长的逐步思考,用户可以清晰地看到这些过程。API 用户还可以对模型思考的时间进行细致的控制',
displayName: 'Claude Sonnet 4',
- enabled: true,
id: 'claude-sonnet-4-20250514',
maxOutput: 64_000,
pricing: {
@@ -172,7 +171,7 @@ const anthropicChatModels: AIChatModelCard[] = [
contextWindowTokens: 200_000,
description:
'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
- displayName: 'Claude 3.5 Sonnet v2',
+ displayName: 'Claude 3.5 Sonnet (New)',
id: 'claude-3-5-sonnet-20241022',
maxOutput: 8192,
pricing: {
@@ -203,7 +202,7 @@ const anthropicChatModels: AIChatModelCard[] = [
contextWindowTokens: 200_000,
description:
'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
- displayName: 'Claude 3.5 Sonnet',
+ displayName: 'Claude 3.5 Sonnet (Old)',
id: 'claude-3-5-sonnet-20240620',
maxOutput: 8192,
pricing: {
@@ -235,7 +234,6 @@ const anthropicChatModels: AIChatModelCard[] = [
description:
'Claude 3.5 Haiku 是 Anthropic 最快的下一代模型。与 Claude 3 Haiku 相比,Claude 3.5 Haiku 在各项技能上都有所提升,并在许多智力基准测试中超越了上一代最大的模型 Claude 3 Opus。',
displayName: 'Claude 3.5 Haiku',
- enabled: true,
id: 'claude-3-5-haiku-20241022',
maxOutput: 8192,
pricing: {
@@ -287,33 +285,6 @@ const anthropicChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- vision: true,
- },
- contextWindowTokens: 200_000,
- description:
- 'Claude 3 Sonnet 在智能和速度方面为企业工作负载提供了理想的平衡。它以更低的价格提供最大效用,可靠且适合大规模部署。',
- displayName: 'Claude 3 Sonnet',
- id: 'claude-3-sonnet-20240229', // 弃用日期 2025年7月21日
- maxOutput: 4096,
- pricing: {
- units: [
- { name: 'textInput_cacheRead', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
- {
- lookup: { prices: { '1h': 6, '5m': 3.75 }, pricingParams: ['ttl'] },
- name: 'textInput_cacheWrite',
- strategy: 'lookup',
- unit: 'millionTokens',
- },
- ],
- },
- releasedAt: '2024-02-29',
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -344,38 +315,6 @@ const anthropicChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- contextWindowTokens: 200_000,
- description:
- 'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
- displayName: 'Claude 2.1',
- id: 'claude-2.1', // 弃用日期 2025年7月21日
- maxOutput: 4096,
- pricing: {
- units: [
- { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2023-11-21',
- type: 'chat',
- },
- {
- contextWindowTokens: 100_000,
- description:
- 'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
- displayName: 'Claude 2.0',
- id: 'claude-2.0', // 弃用日期 2025年7月21日
- maxOutput: 4096,
- pricing: {
- units: [
- { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2023-07-11',
- type: 'chat',
- },
];
export const allModels = [...anthropicChatModels];
diff --git a/packages/model-bank/src/aiModels/novita.ts b/packages/model-bank/src/aiModels/novita.ts
index 16857f7c441..a2dabf977df 100644
--- a/packages/model-bank/src/aiModels/novita.ts
+++ b/packages/model-bank/src/aiModels/novita.ts
@@ -30,8 +30,8 @@ const novitaChatModels: AIChatModelCard[] = [
maxOutput: 32_768,
pricing: {
units: [
- { name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 0.98, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 3.95, strategy: 'fixed', unit: 'millionTokens' },
],
},
type: 'chat',
diff --git a/packages/model-bank/src/aiModels/qwen.ts b/packages/model-bank/src/aiModels/qwen.ts
index 6e2180f48ef..aae977ca1d5 100644
--- a/packages/model-bank/src/aiModels/qwen.ts
+++ b/packages/model-bank/src/aiModels/qwen.ts
@@ -55,6 +55,27 @@ const qwenChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
+ {
+ abilities: {
+ reasoning: true,
+ },
+ contextWindowTokens: 131_072,
+ description: 'deepseek-v3.2-exp 引入稀疏注意力机制,旨在提升处理长文本时的训练与推理效率,价格低于 deepseek-v3.1。',
+ displayName: 'DeepSeek V3.2 Exp',
+ id: 'deepseek-v3.2-exp',
+ maxOutput: 65_536,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
+ type: 'chat',
+ },
{
abilities: {
reasoning: true,
diff --git a/packages/model-bank/src/aiModels/zhipu.ts b/packages/model-bank/src/aiModels/zhipu.ts
index 37e7cce48bc..521bf1bbbc0 100644
--- a/packages/model-bank/src/aiModels/zhipu.ts
+++ b/packages/model-bank/src/aiModels/zhipu.ts
@@ -1,6 +1,72 @@
import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
+// price: https://bigmodel.cn/pricing
+// ref: https://docs.bigmodel.cn/cn/guide/start/model-overview
+
const zhipuChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ search: true,
+ },
+ contextWindowTokens: 200_000,
+ description:
+ '智谱最新旗舰模型 GLM-4.6 (355B) 在高级编码、长文本处理、推理与智能体能力上全面超越前代,尤其在编程能力上对齐 Claude Sonnet 4,成为国内顶尖的 Coding 模型。',
+ displayName: 'GLM-4.6',
+ enabled: true,
+ id: 'glm-4.6',
+ maxOutput: 128_000,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 0.4,
+ '[0, 32_000]_[200, infinity]': 0.6,
+ '[32_000, 200_000]': 0.8,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 2,
+ '[0, 32_000]_[200, infinity]': 3,
+ '[32_000, 200_000]': 4,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 8,
+ '[0, 32_000]_[200, infinity]': 14,
+ '[32_000, 200_000]': 16,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ ],
+ },
+ settings: {
+ extendParams: ['enableReasoning'],
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -18,10 +84,42 @@ const zhipuChatModels: AIChatModelCard[] = [
pricing: {
currency: 'CNY',
units: [
- // 输入长度 [0, 32]
- { name: 'textInput_cacheRead', rate: 0.4, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]': 0.4,
+ '[32_000, 65_536]': 0.8,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]': 2,
+ '[32_000, 65_536]': 4,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]': 6,
+ '[32_000, 65_536]': 12,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
settings: {
@@ -38,17 +136,52 @@ const zhipuChatModels: AIChatModelCard[] = [
},
contextWindowTokens: 128_000,
description:
- '智谱最新旗舰模型,支持思考模式切换,综合能力达到开源模型的 SOTA 水平,上下文长度可达128K。',
+ '智谱旗舰模型,支持思考模式切换,综合能力达到开源模型的 SOTA 水平,上下文长度可达128K。',
displayName: 'GLM-4.5',
- enabled: true,
id: 'glm-4.5',
maxOutput: 32_768,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput_cacheRead', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 0.4,
+ '[0, 32_000]_[200, infinity]': 0.6,
+ '[32_000, 128_000]': 0.8,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 2,
+ '[0, 32_000]_[200, infinity]': 3,
+ '[32_000, 128_000]': 4,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 8,
+ '[0, 32_000]_[200, infinity]': 14,
+ '[32_000, 128_000]': 16,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
settings: {
@@ -71,9 +204,45 @@ const zhipuChatModels: AIChatModelCard[] = [
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput_cacheRead', rate: 3.2, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 64, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]': 1.6,
+ '[0, 32_000]_[200, infinity]': 2.4,
+ '[32_000, 128_000]': 3.2,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 8,
+ '[0, 32_000]_[200, infinity]': 12,
+ '[32_000, 128_000]': 16,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 16,
+ '[0, 32_000]_[200, infinity]': 32,
+ '[32_000, 128_000]': 64,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
settings: {
@@ -96,9 +265,43 @@ const zhipuChatModels: AIChatModelCard[] = [
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput_cacheRead', rate: 0.24, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]': 0.16,
+ '[32_000, 128_000]': 0.24,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]': 0.8,
+ '[32_000, 128_000]': 1.2,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 2,
+ '[0, 32_000]_[200, infinity]': 6,
+ '[32_000, 128_000]': 8,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
settings: {
@@ -121,9 +324,43 @@ const zhipuChatModels: AIChatModelCard[] = [
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput_cacheRead', rate: 1.6, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 32, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]': 0.8,
+ '[32_000, 128_000]': 1.6,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]': 4,
+ '[32_000, 128_000]': 8,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 32_000]_[0, 200]': 12,
+ '[0, 32_000]_[200, infinity]': 16,
+ '[32_000, 128_000]': 32,
+ },
+ pricingParams: ['textInput', 'textOutput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
settings: {
@@ -187,7 +424,6 @@ const zhipuChatModels: AIChatModelCard[] = [
description:
'GLM-4.1V-Thinking 系列模型是目前已知10B级别的VLM模型中性能最强的视觉模型,融合了同级别SOTA的各项视觉语言任务,包括视频理解、图片问答、学科解题、OCR文字识别、文档和图表解读、GUI Agent、前端网页Coding、Grounding等,多项任务能力甚至超过8倍参数量的Qwen2.5-VL-72B。通过领先的强化学习技术,模型掌握了通过思维链推理的方式提升回答的准确性和丰富度,从最终效果和可解释性等维度都显著超过传统的非thinking模型。',
displayName: 'GLM-4.1V-Thinking-Flash',
- enabled: true,
id: 'glm-4.1v-thinking-flash',
maxOutput: 16_384,
pricing: {
@@ -414,28 +650,6 @@ const zhipuChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- search: true,
- },
- contextWindowTokens: 128_000,
- description:
- 'GLM-4-AllTools 是一个多功能智能体模型,优化以支持复杂指令规划与工具调用,如网络浏览、代码解释和文本生成,适用于多任务执行。',
- displayName: 'GLM-4-AllTools',
- id: 'glm-4-alltools',
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- settings: {
- searchImpl: 'params',
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -479,27 +693,6 @@ const zhipuChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- search: true,
- },
- contextWindowTokens: 128_000,
- description: 'GLM-4 是发布于2024年1月的旧旗舰版本,目前已被更强的 GLM-4-0520 取代。',
- displayName: 'GLM-4',
- id: 'glm-4', // 弃用时间 2025年6月30日
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 100, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- settings: {
- searchImpl: 'params',
- },
- type: 'chat',
- },
{
abilities: {
vision: true,
diff --git a/packages/model-runtime/src/providers/anthropic/index.test.ts b/packages/model-runtime/src/providers/anthropic/index.test.ts
index bcbbfcf2206..e98819be9d9 100644
--- a/packages/model-runtime/src/providers/anthropic/index.test.ts
+++ b/packages/model-runtime/src/providers/anthropic/index.test.ts
@@ -793,18 +793,6 @@ describe('LobeAnthropicAI', () => {
expect(result.max_tokens).toBe(4096);
});
- it('should set correct max_tokens based on model for non claude-3 models', async () => {
- const payload: ChatStreamPayload = {
- messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-2.1',
- temperature: 0.7,
- };
-
- const result = await instance['buildAnthropicPayload'](payload);
-
- expect(result.max_tokens).toBe(4096);
- });
-
it('should respect max_tokens when explicitly provided', async () => {
const payload: ChatStreamPayload = {
max_tokens: 2000,
diff --git a/packages/model-runtime/src/providers/novita/index.ts b/packages/model-runtime/src/providers/novita/index.ts
index a795ac091db..31efac21187 100644
--- a/packages/model-runtime/src/providers/novita/index.ts
+++ b/packages/model-runtime/src/providers/novita/index.ts
@@ -29,6 +29,7 @@ export const LobeNovitaAI = createOpenAICompatibleRuntime({
const formattedModels = modelList.map((m) => {
const mm = m as any;
const features: string[] = Array.isArray(mm.features) ? mm.features : [];
+ const inputModalities: string[] = Array.isArray(mm.input_modalities) ? mm.input_modalities : [];
return {
contextWindowTokens: mm.context_size ?? mm.max_output_tokens ?? undefined,
@@ -44,7 +45,7 @@ export const LobeNovitaAI = createOpenAICompatibleRuntime({
},
reasoning: features.includes('reasoning') || false,
type: mm.model_type ?? undefined,
- vision: features.includes('vision') || false,
+ vision: inputModalities.includes('image') || features.includes('vision') || false,
} as any;
});
diff --git a/packages/model-runtime/src/providers/novita/type.ts b/packages/model-runtime/src/providers/novita/type.ts
index e923357ac47..f5304860d15 100644
--- a/packages/model-runtime/src/providers/novita/type.ts
+++ b/packages/model-runtime/src/providers/novita/type.ts
@@ -2,8 +2,12 @@ export interface NovitaModelCard {
context_size: number;
created: number;
description: string;
+ features?: string[];
id: string;
+ input_modalities?: string[];
input_token_price_per_m: number;
+ max_output_tokens?: number;
+ model_type?: string;
output_token_price_per_m: number;
status: number;
tags: string[];
diff --git a/packages/model-runtime/src/providers/ollamacloud/index.ts b/packages/model-runtime/src/providers/ollamacloud/index.ts
index 671292818f1..1f0a463c8f2 100644
--- a/packages/model-runtime/src/providers/ollamacloud/index.ts
+++ b/packages/model-runtime/src/providers/ollamacloud/index.ts
@@ -4,7 +4,7 @@ import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactor
import { processMultiProviderModelList } from '../../utils/modelParse';
export const LobeOllamaCloudAI = createOpenAICompatibleRuntime({
- baseURL: 'https://api.ollama.com/v1',
+ baseURL: 'https://ollama.com/v1',
chatCompletion: {
handlePayload: (payload) => {
const { model, ...rest } = payload;
diff --git a/packages/model-runtime/src/providers/openrouter/index.ts b/packages/model-runtime/src/providers/openrouter/index.ts
index 32ac6d3c113..e2553a53453 100644
--- a/packages/model-runtime/src/providers/openrouter/index.ts
+++ b/packages/model-runtime/src/providers/openrouter/index.ts
@@ -73,11 +73,18 @@ export const LobeOpenRouterAI = createOpenAICompatibleRuntime({
const { endpoint } = model;
const endpointModel = endpoint?.model;
- const displayName = model.slug?.toLowerCase().includes('deepseek')
+ const inputModalities = endpointModel?.input_modalities || model.input_modalities;
+
+ let displayName = model.slug?.toLowerCase().includes('deepseek') && !model.short_name?.toLowerCase().includes('deepseek')
? (model.name ?? model.slug)
: (model.short_name ?? model.name ?? model.slug);
- const inputModalities = endpointModel?.input_modalities || model.input_modalities;
+ const inputPrice = formatPrice(endpoint?.pricing?.prompt);
+ const outputPrice = formatPrice(endpoint?.pricing?.completion);
+ const isFree = (inputPrice === 0 || outputPrice === 0) && !displayName.endsWith('(free)');
+ if (isFree) {
+ displayName += ' (free)';
+ }
return {
contextWindowTokens: endpoint?.context_length || model.context_length,
@@ -90,8 +97,8 @@ export const LobeOpenRouterAI = createOpenAICompatibleRuntime({
? endpoint.max_completion_tokens
: undefined,
pricing: {
- input: formatPrice(endpoint?.pricing?.prompt),
- output: formatPrice(endpoint?.pricing?.completion),
+ input: inputPrice,
+ output: outputPrice,
},
reasoning: endpoint?.supports_reasoning || false,
releasedAt: new Date(model.created_at).toISOString().split('T')[0],
diff --git a/src/config/modelProviders/anthropic.ts b/src/config/modelProviders/anthropic.ts
index 66a522da480..f1153c420cc 100644
--- a/src/config/modelProviders/anthropic.ts
+++ b/src/config/modelProviders/anthropic.ts
@@ -1,6 +1,5 @@
import { ModelProviderCard } from '@/types/llm';
-// ref: https://docs.anthropic.com/en/docs/about-claude/models#model-names
const Anthropic: ModelProviderCard = {
chatModels: [
{
@@ -83,17 +82,6 @@ const Anthropic: ModelProviderCard = {
releasedAt: '2024-03-07',
vision: true,
},
- {
- contextWindowTokens: 200_000,
- description:
- 'Claude 3 Sonnet 在智能和速度方面为企业工作负载提供了理想的平衡。它以更低的价格提供最大效用,可靠且适合大规模部署。',
- displayName: 'Claude 3 Sonnet',
- functionCall: true,
- id: 'claude-3-sonnet-20240229',
- maxOutput: 4096,
- releasedAt: '2024-02-29',
- vision: true,
- },
{
contextWindowTokens: 200_000,
description:
@@ -106,24 +94,6 @@ const Anthropic: ModelProviderCard = {
releasedAt: '2024-02-29',
vision: true,
},
- {
- contextWindowTokens: 200_000,
- description:
- 'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
- displayName: 'Claude 2.1',
- id: 'claude-2.1',
- maxOutput: 4096,
- releasedAt: '2023-11-21',
- },
- {
- contextWindowTokens: 100_000,
- description:
- 'Claude 2 为企业提供了关键能力的进步,包括业界领先的 200K token 上下文、大幅降低模型幻觉的发生率、系统提示以及一个新的测试功能:工具调用。',
- displayName: 'Claude 2.0',
- id: 'claude-2.0',
- maxOutput: 4096,
- releasedAt: '2023-07-11',
- },
],
checkModel: 'claude-3-haiku-20240307',
description:
diff --git a/src/config/modelProviders/ollamacloud.ts b/src/config/modelProviders/ollamacloud.ts
index 97c1bb72e50..e3e2f819151 100644
--- a/src/config/modelProviders/ollamacloud.ts
+++ b/src/config/modelProviders/ollamacloud.ts
@@ -9,6 +9,7 @@ const OllamaCloud: ModelProviderCard = {
modelsUrl: 'https://ollama.com/library',
name: 'Ollama Cloud',
settings: {
+ disableBrowserRequest: true, // CORS error
sdkType: 'openai',
showModelFetcher: true,
},
diff --git a/src/config/modelProviders/zhipu.ts b/src/config/modelProviders/zhipu.ts
index 21e151b4488..365b54bd5e3 100644
--- a/src/config/modelProviders/zhipu.ts
+++ b/src/config/modelProviders/zhipu.ts
@@ -1,16 +1,7 @@
import { ModelProviderCard } from '@/types/llm';
-// ref :https://open.bigmodel.cn/dev/howuse/model
-// api https://open.bigmodel.cn/dev/api#language
-// ref :https://open.bigmodel.cn/modelcenter/square
const ZhiPu: ModelProviderCard = {
chatModels: [
- {
- contextWindowTokens: 16_384,
- description: 'GLM-Zero-Preview具备强大的复杂推理能力,在逻辑推理、数学、编程等领域表现优异。',
- displayName: 'GLM-Zero-Preview',
- id: 'glm-zero-preview',
- },
{
contextWindowTokens: 128_000,
description: 'GLM-4-Flash 是处理简单任务的理想选择,速度最快且免费。',
@@ -50,14 +41,6 @@ const ZhiPu: ModelProviderCard = {
functionCall: true,
id: 'glm-4-airx',
},
- {
- contextWindowTokens: 128_000,
- description:
- 'GLM-4-AllTools 是一个多功能智能体模型,优化以支持复杂指令规划与工具调用,如网络浏览、代码解释和文本生成,适用于多任务执行。',
- displayName: 'GLM-4-AllTools',
- functionCall: true,
- id: 'glm-4-alltools',
- },
{
contextWindowTokens: 128_000,
description:
@@ -115,9 +98,9 @@ const ZhiPu: ModelProviderCard = {
},
{
contextWindowTokens: 4096,
- description: 'CharGLM-3 专为角色扮演与情感陪伴设计,支持超长多轮记忆与个性化对话,应用广泛。',
- displayName: 'CharGLM-3',
- id: 'charglm-3',
+ description: 'CharGLM-4 专为角色扮演与情感陪伴设计,支持超长多轮记忆与个性化对话,应用广泛。',
+ displayName: 'CharGLM-4',
+ id: 'charglm-4',
},
{
contextWindowTokens: 8192,
@@ -126,7 +109,7 @@ const ZhiPu: ModelProviderCard = {
id: 'emohaa',
},
],
- checkModel: 'glm-4-flash-250414',
+ checkModel: 'glm-4.5-flash',
description:
'智谱 AI 提供多模态与语言模型的开放平台,支持广泛的AI应用场景,包括文本处理、图像理解与编程辅助等。',
id: 'zhipu',