@lobehub/chat 1.59.0 → 1.60.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,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 1.60.0](https://github.com/lobehub/lobe-chat/compare/v1.59.0...v1.60.0)
6
+
7
+ <sup>Released on **2025-02-17**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **misc**: Add SambaNova provider support.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's improved
19
+
20
+ - **misc**: Add SambaNova provider support, closes [#6218](https://github.com/lobehub/lobe-chat/issues/6218) ([a46eadf](https://github.com/lobehub/lobe-chat/commit/a46eadf))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ## [Version 1.59.0](https://github.com/lobehub/lobe-chat/compare/v1.58.0...v1.59.0)
6
31
 
7
32
  <sup>Released on **2025-02-16**</sup>
package/Dockerfile CHANGED
@@ -205,6 +205,8 @@ ENV \
205
205
  PERPLEXITY_API_KEY="" PERPLEXITY_MODEL_LIST="" PERPLEXITY_PROXY_URL="" \
206
206
  # Qwen
207
207
  QWEN_API_KEY="" QWEN_MODEL_LIST="" QWEN_PROXY_URL="" \
208
+ # SambaNova
209
+ SAMBANOVA_API_KEY="" SAMBANOVA_MODEL_LIST="" \
208
210
  # SenseNova
209
211
  SENSENOVA_API_KEY="" SENSENOVA_MODEL_LIST="" \
210
212
  # SiliconCloud
@@ -242,6 +242,8 @@ ENV \
242
242
  PERPLEXITY_API_KEY="" PERPLEXITY_MODEL_LIST="" PERPLEXITY_PROXY_URL="" \
243
243
  # Qwen
244
244
  QWEN_API_KEY="" QWEN_MODEL_LIST="" QWEN_PROXY_URL="" \
245
+ # SambaNova
246
+ SAMBANOVA_API_KEY="" SAMBANOVA_MODEL_LIST="" \
245
247
  # SenseNova
246
248
  SENSENOVA_API_KEY="" SENSENOVA_MODEL_LIST="" \
247
249
  # SiliconCloud
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "features": [
5
+ "Add SambaNova provider support."
6
+ ]
7
+ },
8
+ "date": "2025-02-17",
9
+ "version": "1.60.0"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "features": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.59.0",
3
+ "version": "1.60.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",
@@ -22,6 +22,7 @@ import {
22
22
  OpenRouterProviderCard,
23
23
  PerplexityProviderCard,
24
24
  QwenProviderCard,
25
+ SambaNovaProviderCard,
25
26
  SenseNovaProviderCard,
26
27
  SiliconCloudProviderCard,
27
28
  SparkProviderCard,
@@ -79,6 +80,7 @@ export const useProviderList = (): ProviderItem[] => {
79
80
  UpstageProviderCard,
80
81
  XAIProviderCard,
81
82
  JinaProviderCard,
83
+ SambaNovaProviderCard,
82
84
  QwenProviderCard,
83
85
  WenxinProviderCard,
84
86
  HunyuanProviderCard,
@@ -31,6 +31,7 @@ import { default as openai } from './openai';
31
31
  import { default as openrouter } from './openrouter';
32
32
  import { default as perplexity } from './perplexity';
33
33
  import { default as qwen } from './qwen';
34
+ import { default as sambanova } from './sambanova';
34
35
  import { default as sensenova } from './sensenova';
35
36
  import { default as siliconcloud } from './siliconcloud';
36
37
  import { default as spark } from './spark';
@@ -97,6 +98,7 @@ export const LOBE_DEFAULT_MODEL_LIST = buildDefaultModelList({
97
98
  openrouter,
98
99
  perplexity,
99
100
  qwen,
101
+ sambanova,
100
102
  sensenova,
101
103
  siliconcloud,
102
104
  spark,
@@ -144,6 +146,7 @@ export { default as openai } from './openai';
144
146
  export { default as openrouter } from './openrouter';
145
147
  export { default as perplexity } from './perplexity';
146
148
  export { default as qwen } from './qwen';
149
+ export { default as sambanova } from './sambanova';
147
150
  export { default as sensenova } from './sensenova';
148
151
  export { default as siliconcloud } from './siliconcloud';
149
152
  export { default as spark } from './spark';
@@ -0,0 +1,195 @@
1
+ import { AIChatModelCard } from '@/types/aiModel';
2
+
3
+ const sambanovaChatModels: AIChatModelCard[] = [
4
+ {
5
+ abilities: {
6
+ functionCall: true,
7
+ },
8
+ contextWindowTokens: 16_000,
9
+ description: 'Llama 3.3 是 Llama 系列最先进的多语言开源大型语言模型,以极低成本体验媲美 405B 模型的性能。基于 Transformer 结构,并通过监督微调(SFT)和人类反馈强化学习(RLHF)提升有用性和安全性。其指令调优版本专为多语言对话优化,在多项行业基准上表现优于众多开源和封闭聊天模型。知识截止日期为 2023 年 12 月',
10
+ displayName: 'Meta Llama 3.3 70B Instruct',
11
+ enabled: true,
12
+ id: 'Meta-Llama-3.3-70B-Instruct',
13
+ pricing: {
14
+ input: 0.6,
15
+ output: 1.2
16
+ },
17
+ type: 'chat'
18
+ },
19
+ {
20
+ contextWindowTokens: 16_000,
21
+ description: '先进的最尖端小型语言模型,具备语言理解、卓越的推理能力和文本生成能力。',
22
+ displayName: 'Meta Llama 3.2 1B Instruct',
23
+ id: 'Meta-Llama-3.2-1B-Instruct',
24
+ pricing: {
25
+ input: 0.04,
26
+ output: 0.08
27
+ },
28
+ type: 'chat'
29
+ },
30
+ {
31
+ contextWindowTokens: 8000,
32
+ description: '先进的最尖端小型语言模型,具备语言理解、卓越的推理能力和文本生成能力。',
33
+ displayName: 'Meta Llama 3.2 3B Instruct',
34
+ id: 'Meta-Llama-3.2-3B-Instruct',
35
+ pricing: {
36
+ input: 0.08,
37
+ output: 0.16
38
+ },
39
+ type: 'chat'
40
+ },
41
+ {
42
+ abilities: {
43
+ vision: true,
44
+ },
45
+ contextWindowTokens: 4000,
46
+ description: '在高分辨率图像上表现出色的图像推理能力,适用于视觉理解应用。',
47
+ displayName: 'Meta Llama 3.2 11B Vision Instruct',
48
+ enabled: true,
49
+ id: 'Llama-3.2-11B-Vision-Instruct',
50
+ pricing: {
51
+ input: 0.15,
52
+ output: 0.3
53
+ },
54
+ type: 'chat'
55
+ },
56
+ {
57
+ abilities: {
58
+ vision: true,
59
+ },
60
+ contextWindowTokens: 4000,
61
+ description: '适用于视觉理解代理应用的高级图像推理能力。',
62
+ displayName: 'Meta Llama 3.2 90B Vision Instruct',
63
+ enabled: true,
64
+ id: 'Llama-3.2-90B-Vision-Instruct ',
65
+ pricing: {
66
+ input: 0.8,
67
+ output: 1.6
68
+ },
69
+ type: 'chat'
70
+ },
71
+ {
72
+ abilities: {
73
+ functionCall: true,
74
+ },
75
+ contextWindowTokens: 16_000,
76
+ description: 'Llama 3.1指令调优的文本模型,针对多语言对话用例进行了优化,在许多可用的开源和封闭聊天模型中,在常见行业基准上表现优异。',
77
+ displayName: 'Meta Llama 3.1 8B Instruct',
78
+ id: 'Meta-Llama-3.1-8B-Instruct',
79
+ pricing: {
80
+ input: 0.1,
81
+ output: 0.2
82
+ },
83
+ type: 'chat'
84
+ },
85
+ {
86
+ abilities: {
87
+ functionCall: true,
88
+ },
89
+ contextWindowTokens: 128_000,
90
+ description: 'Llama 3.1指令调优的文本模型,针对多语言对话用例进行了优化,在许多可用的开源和封闭聊天模型中,在常见行业基准上表现优异。',
91
+ displayName: 'Meta Llama 3.1 70B Instruct',
92
+ id: 'Meta-Llama-3.1-70B-Instruct',
93
+ pricing: {
94
+ input: 0.6,
95
+ output: 1.2
96
+ },
97
+ type: 'chat'
98
+ },
99
+ {
100
+ abilities: {
101
+ functionCall: true,
102
+ },
103
+ contextWindowTokens: 16_000,
104
+ description: 'Llama 3.1指令调优的文本模型,针对多语言对话用例进行了优化,在许多可用的开源和封闭聊天模型中,在常见行业基准上表现优异。',
105
+ displayName: 'Meta Llama 3.1 405B Instruct',
106
+ id: 'Meta-Llama-3.1-405B-Instruct',
107
+ pricing: {
108
+ input: 5,
109
+ output: 10
110
+ },
111
+ type: 'chat'
112
+ },
113
+ {
114
+ contextWindowTokens: 16_000,
115
+ displayName: 'Llama 3.1 Tulu 3 405B',
116
+ id: 'Llama-3.1-Tulu-3-405B',
117
+ pricing: {
118
+ input: 0.7,
119
+ output: 1.4
120
+ },
121
+ type: 'chat'
122
+ },
123
+ {
124
+ abilities: {
125
+ reasoning: true,
126
+ },
127
+ contextWindowTokens: 4000,
128
+ description: '最先进的高效 LLM,擅长推理、数学和编程。',
129
+ displayName: 'DeepSeek R1',
130
+ id: 'DeepSeek-R1',
131
+ pricing: {
132
+ input: 5,
133
+ output: 7
134
+ },
135
+ type: 'chat'
136
+ },
137
+ {
138
+ abilities: {
139
+ reasoning: true,
140
+ },
141
+ contextWindowTokens: 32_000,
142
+ description: 'DeepSeek R1——DeepSeek 套件中更大更智能的模型——被蒸馏到 Llama 70B 架构中。基于基准测试和人工评估,该模型比原始 Llama 70B 更智能,尤其在需要数学和事实精确性的任务上表现出色。',
143
+ displayName: 'DeepSeek R1 Distill Llama 70B',
144
+ enabled: true,
145
+ id: 'DeepSeek-R1-Distill-Llama-70B',
146
+ pricing: {
147
+ input: 0.7,
148
+ output: 1.4
149
+ },
150
+ type: 'chat'
151
+ },
152
+ {
153
+ abilities: {
154
+ reasoning: true,
155
+ },
156
+ contextWindowTokens: 16_000,
157
+ description: 'Qwen QwQ 是由 Qwen 团队开发的实验研究模型,专注于提升AI推理能力。',
158
+ displayName: 'QwQ 32B Preview',
159
+ enabled: true,
160
+ id: 'QwQ-32B-Preview',
161
+ pricing: {
162
+ input: 1.5,
163
+ output: 3
164
+ },
165
+ type: 'chat'
166
+ },
167
+ {
168
+ contextWindowTokens: 16_000,
169
+ description: '面向中文和英文的 LLM,针对语言、编程、数学、推理等领域。',
170
+ displayName: 'Qwen2.5 72B Instruct',
171
+ enabled: true,
172
+ id: 'Qwen2.5-72B-Instruct',
173
+ pricing: {
174
+ input: 2,
175
+ output: 4
176
+ },
177
+ type: 'chat'
178
+ },
179
+ {
180
+ contextWindowTokens: 16_000,
181
+ description: '高级 LLM,支持代码生成、推理和修复,涵盖主流编程语言。',
182
+ displayName: 'Qwen2.5 Coder 32B Instruct',
183
+ enabled: true,
184
+ id: 'Qwen2.5-Coder-32B-Instruct',
185
+ pricing: {
186
+ input: 1.5,
187
+ output: 3
188
+ },
189
+ type: 'chat'
190
+ },
191
+ ]
192
+
193
+ export const allModels = [...sambanovaChatModels];
194
+
195
+ export default allModels;
package/src/config/llm.ts CHANGED
@@ -140,6 +140,9 @@ export const getLLMConfig = () => {
140
140
 
141
141
  ENABLED_JINA: z.boolean(),
142
142
  JINA_API_KEY: z.string().optional(),
143
+
144
+ ENABLED_SAMBANOVA: z.boolean(),
145
+ SAMBANOVA_API_KEY: z.string().optional(),
143
146
  },
144
147
  runtimeEnv: {
145
148
  API_KEY_SELECT_MODE: process.env.API_KEY_SELECT_MODE,
@@ -278,6 +281,9 @@ export const getLLMConfig = () => {
278
281
 
279
282
  ENABLED_JINA: !!process.env.JINA_API_KEY,
280
283
  JINA_API_KEY: process.env.JINA_API_KEY,
284
+
285
+ ENABLED_SAMBANOVA: !!process.env.SAMBANOVA_API_KEY,
286
+ SAMBANOVA_API_KEY: process.env.SAMBANOVA_API_KEY,
281
287
  },
282
288
  });
283
289
  };
@@ -31,6 +31,7 @@ import OpenAIProvider from './openai';
31
31
  import OpenRouterProvider from './openrouter';
32
32
  import PerplexityProvider from './perplexity';
33
33
  import QwenProvider from './qwen';
34
+ import SambaNovaProvider from './sambanova';
34
35
  import SenseNovaProvider from './sensenova';
35
36
  import SiliconCloudProvider from './siliconcloud';
36
37
  import SparkProvider from './spark';
@@ -71,6 +72,7 @@ export const LOBE_DEFAULT_MODEL_LIST: ChatModelCard[] = [
71
72
  HuggingFaceProvider.chatModels,
72
73
  XAIProvider.chatModels,
73
74
  JinaProvider.chatModels,
75
+ SambaNovaProvider.chatModels,
74
76
  ZeroOneProvider.chatModels,
75
77
  StepfunProvider.chatModels,
76
78
  NovitaProvider.chatModels,
@@ -116,6 +118,7 @@ export const DEFAULT_MODEL_PROVIDER_LIST = [
116
118
  UpstageProvider,
117
119
  XAIProvider,
118
120
  JinaProvider,
121
+ SambaNovaProvider,
119
122
  QwenProvider,
120
123
  WenxinProvider,
121
124
  TencentcloudProvider,
@@ -179,6 +182,7 @@ export { default as OpenAIProviderCard } from './openai';
179
182
  export { default as OpenRouterProviderCard } from './openrouter';
180
183
  export { default as PerplexityProviderCard } from './perplexity';
181
184
  export { default as QwenProviderCard } from './qwen';
185
+ export { default as SambaNovaProviderCard } from './sambanova';
182
186
  export { default as SenseNovaProviderCard } from './sensenova';
183
187
  export { default as SiliconCloudProviderCard } from './siliconcloud';
184
188
  export { default as SparkProviderCard } from './spark';
@@ -0,0 +1,18 @@
1
+ import { ModelProviderCard } from '@/types/llm';
2
+
3
+ const SambaNova: ModelProviderCard = {
4
+ chatModels: [],
5
+ checkModel: 'Meta-Llama-3.2-1B-Instruct',
6
+ description: 'SambaNova Cloud 可让开发者轻松使用最佳的开源模型,并享受最快的推理速度。',
7
+ disableBrowserRequest: true,
8
+ id: 'sambanova',
9
+ modelsUrl: 'https://cloud.sambanova.ai/plans/pricing',
10
+ name: 'SambaNova',
11
+ settings: {
12
+ disableBrowserRequest: true,
13
+ sdkType: 'openai',
14
+ },
15
+ url: 'https://cloud.sambanova.ai',
16
+ };
17
+
18
+ export default SambaNova;
@@ -33,6 +33,7 @@ import { LobeOpenAI } from './openai';
33
33
  import { LobeOpenRouterAI } from './openrouter';
34
34
  import { LobePerplexityAI } from './perplexity';
35
35
  import { LobeQwenAI } from './qwen';
36
+ import { LobeSambaNovaAI } from './sambanova';
36
37
  import { LobeSenseNovaAI } from './sensenova';
37
38
  import { LobeSiliconCloudAI } from './siliconcloud';
38
39
  import { LobeSparkAI } from './spark';
@@ -169,6 +170,7 @@ class AgentRuntime {
169
170
  openrouter: Partial<ClientOptions>;
170
171
  perplexity: Partial<ClientOptions>;
171
172
  qwen: Partial<ClientOptions>;
173
+ sambanova: Partial<ClientOptions>;
172
174
  sensenova: Partial<ClientOptions>;
173
175
  siliconcloud: Partial<ClientOptions>;
174
176
  spark: Partial<ClientOptions>;
@@ -384,6 +386,11 @@ class AgentRuntime {
384
386
  break;
385
387
  }
386
388
 
389
+ case ModelProvider.SambaNova: {
390
+ runtimeModel = new LobeSambaNovaAI(params.sambanova);
391
+ break;
392
+ }
393
+
387
394
  case ModelProvider.Cloudflare: {
388
395
  runtimeModel = new LobeCloudflareAI(params.cloudflare);
389
396
  break;
@@ -0,0 +1,10 @@
1
+ import { ModelProvider } from '../types';
2
+ import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';
3
+
4
+ export const LobeSambaNovaAI = LobeOpenAICompatibleFactory({
5
+ baseURL: 'https://api.sambanova.ai/v1',
6
+ debug: {
7
+ chatCompletion: () => process.env.DEBUG_SAMBANOVA_CHAT_COMPLETION === '1',
8
+ },
9
+ provider: ModelProvider.SambaNova,
10
+ });
@@ -56,6 +56,7 @@ export enum ModelProvider {
56
56
  OpenRouter = 'openrouter',
57
57
  Perplexity = 'perplexity',
58
58
  Qwen = 'qwen',
59
+ SambaNova = 'sambanova',
59
60
  SenseNova = 'sensenova',
60
61
  SiliconCloud = 'siliconcloud',
61
62
  Spark = 'spark',
@@ -59,6 +59,7 @@ export interface UserKeyVaults {
59
59
  password?: string;
60
60
  perplexity?: OpenAICompatibleKeyVault;
61
61
  qwen?: OpenAICompatibleKeyVault;
62
+ sambanova?: OpenAICompatibleKeyVault;
62
63
  sensenova?: OpenAICompatibleKeyVault;
63
64
  siliconcloud?: OpenAICompatibleKeyVault;
64
65
  spark?: OpenAICompatibleKeyVault;