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.

💄 style: Enhanced Nvidia NIM chat experience (#9408)

sxjeru13e936fbe0b7
diff --git a/packages/model-bank/src/aiModels/nvidia.ts b/packages/model-bank/src/aiModels/nvidia.ts
index d93fc76602f..6f880874738 100644
--- a/packages/model-bank/src/aiModels/nvidia.ts
+++ b/packages/model-bank/src/aiModels/nvidia.ts
@@ -1,6 +1,23 @@
import { AIChatModelCard } from '../types/aiModel';
const nvidiaChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 131_072,
+ description:
+ 'DeepSeek V3.1:下一代推理模型,提升了复杂推理与链路思考能力,适合需要深入分析的任务。',
+ displayName: 'DeepSeek V3.1',
+ enabled: true,
+ id: 'deepseek-ai/deepseek-v3.1',
+ maxOutput: 16_384,
+ settings: {
+ extendParams: ['enableReasoning'],
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -8,7 +25,6 @@ const nvidiaChatModels: AIChatModelCard[] = [
contextWindowTokens: 128_000,
description: '先进的 LLM,擅长推理、数学、常识和函数调用。',
displayName: 'Llama 3.3 70B Instruct',
- enabled: true,
id: 'meta/llama-3.3-70b-instruct',
type: 'chat',
},
@@ -33,7 +49,6 @@ const nvidiaChatModels: AIChatModelCard[] = [
contextWindowTokens: 128_000,
description: '尖端的视觉-语言模型,擅长从图像中进行高质量推理。',
displayName: 'Llama 3.2 11B Vision Instruct',
- enabled: true,
id: 'meta/llama-3.2-11b-vision-instruct',
type: 'chat',
},
@@ -121,7 +136,6 @@ const nvidiaChatModels: AIChatModelCard[] = [
contextWindowTokens: 128_000,
description: '最先进的高效 LLM,擅长推理、数学和编程。',
displayName: 'DeepSeek R1',
- enabled: true,
id: 'deepseek-ai/deepseek-r1',
type: 'chat',
},
@@ -132,7 +146,6 @@ const nvidiaChatModels: AIChatModelCard[] = [
contextWindowTokens: 32_768,
description: '面向中文和英文的 LLM,针对语言、编程、数学、推理等领域。',
displayName: 'Qwen2.5 7B Instruct',
- enabled: true,
id: 'qwen/qwen2.5-7b-instruct',
type: 'chat',
},
diff --git a/packages/model-bank/src/aiModels/ollama.ts b/packages/model-bank/src/aiModels/ollama.ts
index 5449139cee0..de9d4f62230 100644
--- a/packages/model-bank/src/aiModels/ollama.ts
+++ b/packages/model-bank/src/aiModels/ollama.ts
@@ -6,12 +6,25 @@ const ollamaChatModels: AIChatModelCard[] = [
functionCall: true,
reasoning: true,
},
- contextWindowTokens: 32_768,
+ contextWindowTokens: 163_840,
+ description:
+ 'DeepSeek V3.1:下一代推理模型,提升了复杂推理与链路思考能力,适合需要深入分析的任务。',
+ displayName: 'DeepSeek V3.1',
+ enabled: true,
+ id: 'deepseek-v3.1:671b',
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 131_072,
description:
'GPT-OSS 20B 是 OpenAI 发布的开源大语言模型,采用 MXFP4 量化技术,适合在高端消费级GPU或Apple Silicon Mac上运行。该模型在对话生成、代码编写和推理任务方面表现出色,支持函数调用和工具使用。',
displayName: 'GPT-OSS 20B',
enabled: true,
- id: 'gpt-oss',
+ id: 'gpt-oss:20b',
releasedAt: '2025-08-05',
type: 'chat',
},
@@ -20,7 +33,7 @@ const ollamaChatModels: AIChatModelCard[] = [
functionCall: true,
reasoning: true,
},
- contextWindowTokens: 32_768,
+ contextWindowTokens: 131_072,
description:
'GPT-OSS 120B 是 OpenAI 发布的大型开源语言模型,采用 MXFP4 量化技术,为旗舰级模型。需要多GPU或高性能工作站环境运行,在复杂推理、代码生成和多语言处理方面具备卓越性能,支持高级函数调用和工具集成。',
displayName: 'GPT-OSS 120B',
@@ -28,6 +41,17 @@ const ollamaChatModels: AIChatModelCard[] = [
releasedAt: '2025-08-05',
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ '阿里巴巴针对代理和编码任务的高性能长上下文模型。',
+ displayName: 'Qwen3 Coder 480B',
+ id: 'qwen3-coder:480b',
+ type: 'chat',
+ },
{
abilities: {
reasoning: true,
@@ -36,7 +60,6 @@ const ollamaChatModels: AIChatModelCard[] = [
description:
'DeepSeek-R1 是一款强化学习(RL)驱动的推理模型,解决了模型中的重复性和可读性问题。在 RL 之前,DeepSeek-R1 引入了冷启动数据,进一步优化了推理性能。它在数学、代码和推理任务中与 OpenAI-o1 表现相当,并且通过精心设计的训练方法,提升了整体效果。',
displayName: 'DeepSeek R1',
- enabled: true,
id: 'deepseek-r1',
type: 'chat',
},
@@ -127,7 +150,6 @@ const ollamaChatModels: AIChatModelCard[] = [
contextWindowTokens: 65_536,
description: 'Qwen3 是阿里巴巴的新一代大规模语言模型,以优异的性能支持多元化的应用需求。',
displayName: 'Qwen3 7B',
- enabled: true,
id: 'qwen3',
type: 'chat',
},
diff --git a/packages/model-runtime/src/providers/akashchat/index.ts b/packages/model-runtime/src/providers/akashchat/index.ts
index cadcb44b26e..32cfb0bfcbc 100644
--- a/packages/model-runtime/src/providers/akashchat/index.ts
+++ b/packages/model-runtime/src/providers/akashchat/index.ts
@@ -23,11 +23,10 @@ export const LobeAkashChatAI = createOpenAICompatibleRuntime({
allowed_openai_params: ['reasoning_effort'],
cache: { 'no-cache': true },
model,
- stream: true,
- ...(THINKING_MODELS.some((keyword) => model.includes(keyword))
+ ...(THINKING_MODELS.some((keyword) => model === keyword)
? {
- chat_template_kwargs: { thinking: thinkingFlag },
- }
+ chat_template_kwargs: { thinking: thinkingFlag },
+ }
: {}),
} as any;
},
diff --git a/packages/model-runtime/src/providers/nvidia/index.ts b/packages/model-runtime/src/providers/nvidia/index.ts
index 6c66a90b769..e2967554c36 100644
--- a/packages/model-runtime/src/providers/nvidia/index.ts
+++ b/packages/model-runtime/src/providers/nvidia/index.ts
@@ -3,12 +3,32 @@ import { ModelProvider } from 'model-bank';
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { processMultiProviderModelList } from '../../utils/modelParse';
+const THINKING_MODELS = ['deepseek-ai/deepseek-v3.1'];
+
export interface NvidiaModelCard {
id: string;
}
export const LobeNvidiaAI = createOpenAICompatibleRuntime({
baseURL: 'https://integrate.api.nvidia.com/v1',
+ chatCompletion: {
+ handlePayload: (payload) => {
+ const { model, thinking, ...rest } = payload;
+
+ const thinkingFlag =
+ thinking?.type === 'enabled' ? true : thinking?.type === 'disabled' ? false : undefined;
+
+ return {
+ ...rest,
+ model,
+ ...(THINKING_MODELS.some((keyword) => model === keyword)
+ ? {
+ chat_template_kwargs: { thinking: thinkingFlag },
+ }
+ : {}),
+ } as any;
+ },
+ },
debug: {
chatCompletion: () => process.env.DEBUG_NVIDIA_CHAT_COMPLETION === '1',
},