@lobehub/chat 0.151.2 → 0.151.3

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 0.151.3](https://github.com/lobehub/lobe-chat/compare/v0.151.2...v0.151.3)
6
+
7
+ <sup>Released on **2024-04-29**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Patching models info.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Patching models info, closes [#2269](https://github.com/lobehub/lobe-chat/issues/2269) [#22802280](https://github.com/lobehub/lobe-chat/issues/22802280) ([03bcb06](https://github.com/lobehub/lobe-chat/commit/03bcb06))
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 0.151.2](https://github.com/lobehub/lobe-chat/compare/v0.151.1...v0.151.2)
6
31
 
7
32
  <sup>Released on **2024-04-29**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.151.2",
3
+ "version": "0.151.3",
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",
@@ -1,6 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
- // ref https://docs.anthropic.com/claude/docs/models-overview
3
+ // ref https://docs.anthropic.com/claude/docs/models-overview#model-comparison
4
4
  const Anthropic: ModelProviderCard = {
5
5
  chatModels: [
6
6
  {
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/models
3
4
  const Azure: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -56,14 +56,14 @@ const Bedrock: ModelProviderCard = {
56
56
  displayName: 'Llama 2 Chat 13B',
57
57
  enabled: true,
58
58
  id: 'meta.llama2-13b-chat-v1',
59
- tokens: 4000,
59
+ tokens: 4096,
60
60
  },
61
61
  {
62
62
  description: 'Llama 2 Chat 70B v1,上下文大小为 4k,Llama 2 模型的对话用例优化变体。',
63
63
  displayName: 'Llama 2 Chat 70B',
64
64
  enabled: true,
65
65
  id: 'meta.llama2-70b-chat-v1',
66
- tokens: 4000,
66
+ tokens: 4096,
67
67
  },
68
68
  ],
69
69
  id: 'bedrock',
@@ -1,6 +1,7 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
3
  // ref https://ai.google.dev/models/gemini
4
+ // api https://ai.google.dev/api/rest/v1beta/models/list
4
5
  const Google: ModelProviderCard = {
5
6
  chatModels: [
6
7
  {
@@ -8,13 +9,14 @@ const Google: ModelProviderCard = {
8
9
  displayName: 'PaLM 2 Chat (Legacy)',
9
10
  id: 'chat-bison-001',
10
11
  maxOutput: 1024,
12
+ // tokens: 4096 + 1024, // none tokens test
11
13
  },
12
14
  {
13
15
  description: 'A legacy model that understands text and generates text as an output',
14
16
  displayName: 'PaLM 2 (Legacy)',
15
17
  id: 'text-bison-001',
16
18
  maxOutput: 1024,
17
- tokens: 9220,
19
+ tokens: 8196 + 1024,
18
20
  },
19
21
  {
20
22
  description: 'The best model for scaling across a wide range of tasks',
@@ -22,14 +24,14 @@ const Google: ModelProviderCard = {
22
24
  enabled: true,
23
25
  id: 'gemini-pro',
24
26
  maxOutput: 2048,
25
- tokens: 32_768,
27
+ tokens: 30_720 + 2048,
26
28
  },
27
29
  {
28
30
  description: 'The best image understanding model to handle a broad range of applications',
29
31
  displayName: 'Gemini 1.0 Pro Vision',
30
32
  id: 'gemini-1.0-pro-vision-latest',
31
33
  maxOutput: 4096,
32
- tokens: 16_384,
34
+ tokens: 12_288 + 4096,
33
35
  vision: true,
34
36
  },
35
37
  {
@@ -38,7 +40,7 @@ const Google: ModelProviderCard = {
38
40
  enabled: true,
39
41
  id: 'gemini-pro-vision',
40
42
  maxOutput: 4096,
41
- tokens: 16_384,
43
+ tokens: 12_288 + 4096,
42
44
  vision: true,
43
45
  },
44
46
  {
@@ -47,7 +49,7 @@ const Google: ModelProviderCard = {
47
49
  displayName: 'Gemini 1.0 Pro 001 (Tuning)',
48
50
  id: 'gemini-1.0-pro-001',
49
51
  maxOutput: 2048,
50
- tokens: 32_768,
52
+ tokens: 30_720 + 2048,
51
53
  },
52
54
  {
53
55
  description:
@@ -55,7 +57,7 @@ const Google: ModelProviderCard = {
55
57
  displayName: 'Gemini 1.0 Pro Latest',
56
58
  id: 'gemini-1.0-pro-latest',
57
59
  maxOutput: 2048,
58
- tokens: 32_768,
60
+ tokens: 30_720 + 2048,
59
61
  },
60
62
  {
61
63
  description: 'Mid-size multimodal model that supports up to 1 million tokens',
@@ -63,7 +65,7 @@ const Google: ModelProviderCard = {
63
65
  enabled: true,
64
66
  id: 'gemini-1.5-pro-latest',
65
67
  maxOutput: 8192,
66
- tokens: 1_056_768,
68
+ tokens: 1_048_576 + 8192,
67
69
  vision: true,
68
70
  },
69
71
  {
@@ -29,7 +29,6 @@ const Groq: ModelProviderCard = {
29
29
  },
30
30
  {
31
31
  displayName: 'LLaMA2-70b-chat',
32
- enabled: true,
33
32
  id: 'llama2-70b-4096',
34
33
  tokens: 4096,
35
34
  },
@@ -1,7 +1,22 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://www.minimaxi.com/document/guides/chat-model/pro/api
3
4
  const Minimax: ModelProviderCard = {
4
5
  chatModels: [
6
+ {
7
+ description: '复杂场景,例如应用题计算、科学计算等场景',
8
+ displayName: 'abab6.5',
9
+ enabled: true,
10
+ id: 'abab6.5-chat',
11
+ tokens: 8192,
12
+ },
13
+ {
14
+ description: '通用场景',
15
+ displayName: 'abab6.5s',
16
+ enabled: true,
17
+ id: 'abab6.5s-chat',
18
+ tokens: 245_760,
19
+ },
5
20
  {
6
21
  description: '更复杂的格式化文本生成',
7
22
  displayName: 'abab6',
@@ -1,6 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
- // ref https://docs.mistral.ai/platform/pricing/#chat-completions-api
3
+ // ref https://docs.mistral.ai/getting-started/models/
4
4
  const Mistral: ModelProviderCard = {
5
5
  chatModels: [
6
6
  {
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://platform.moonshot.cn/docs/intro#模型列表
3
4
  const Moonshot: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -6,7 +6,7 @@ const Ollama: ModelProviderCard = {
6
6
  displayName: 'Llama3 8B',
7
7
  enabled: true,
8
8
  id: 'llama3',
9
- tokens: 8000,
9
+ tokens: 8000, // https://huggingface.co/blog/zh/llama3#llama-3-的新进展
10
10
  },
11
11
  {
12
12
  displayName: 'Llama3 70B',
@@ -17,48 +17,48 @@ const Ollama: ModelProviderCard = {
17
17
  displayName: 'Command R 35B',
18
18
  enabled: true,
19
19
  id: 'command-r',
20
- tokens: 128_000,
20
+ tokens: 131_072, // https://huggingface.co/CohereForAI/c4ai-command-r-v01/blob/main/config.json
21
21
  },
22
22
  {
23
23
  displayName: 'Command R+ 104B (Q2_K)',
24
24
  id: 'command-r-plus:104b-q2_K',
25
- tokens: 128_000,
25
+ tokens: 131_072, // https://huggingface.co/CohereForAI/c4ai-command-r-plus/blob/main/config.json
26
26
  },
27
27
  {
28
28
  displayName: 'Gemma 7B',
29
29
  enabled: true,
30
30
  id: 'gemma',
31
- tokens: 4000,
31
+ tokens: 8192, // https://huggingface.co/google/gemma-7b-it/discussions/73#65e9678c0cda621164a95bad
32
32
  },
33
33
  {
34
34
  displayName: 'Gemma 2B',
35
35
  id: 'gemma:2b',
36
- tokens: 4000,
36
+ tokens: 8192,
37
37
  },
38
38
  {
39
39
  displayName: 'Llama2 Chat 13B',
40
40
  id: 'llama2:13b',
41
- tokens: 4000,
41
+ tokens: 4096, // https://llama.meta.com/llama2/
42
42
  },
43
43
  {
44
44
  displayName: 'Llama2 Chat 7B',
45
45
  id: 'llama2',
46
- tokens: 4000,
46
+ tokens: 4096,
47
47
  },
48
48
  {
49
49
  displayName: 'Llama2 Chat 70B',
50
50
  id: 'llama2:70b',
51
- tokens: 4000,
51
+ tokens: 4096,
52
52
  },
53
53
  {
54
54
  displayName: 'Llama2 CN 13B',
55
55
  id: 'llama2-chinese:13b',
56
- tokens: 4000,
56
+ tokens: 4096,
57
57
  },
58
58
  {
59
59
  displayName: 'Llama2 CN 7B',
60
60
  id: 'llama2-chinese',
61
- tokens: 4000,
61
+ tokens: 4096,
62
62
  },
63
63
  {
64
64
  displayName: 'WizardLM 2 7B',
@@ -74,45 +74,45 @@ const Ollama: ModelProviderCard = {
74
74
  {
75
75
  displayName: 'Code Llama 7B',
76
76
  id: 'codellama',
77
- tokens: 16_000,
77
+ tokens: 16_384, // https://huggingface.co/codellama/CodeLlama-7b-hf/blob/main/config.json
78
78
  },
79
79
  {
80
80
  displayName: 'Code Llama 34B',
81
81
  id: 'codellama:34b',
82
- tokens: 16_000,
82
+ tokens: 16_384,
83
83
  },
84
84
  {
85
85
  displayName: 'Code Llama 70B',
86
86
  id: 'codellama:70b',
87
- tokens: 16_000,
87
+ tokens: 16_384,
88
88
  },
89
89
  {
90
90
  displayName: 'Code Llama 7B (Python)',
91
91
  id: 'codellama:python',
92
- tokens: 16_000,
92
+ tokens: 16_384,
93
93
  },
94
94
  {
95
95
  displayName: 'Phi3-Instruct 3.8B',
96
96
  enabled: true,
97
97
  id: 'phi3:instruct',
98
- tokens: 128_000,
98
+ tokens: 131_072, // https://huggingface.co/microsoft/Phi-3-mini-128k-instruct/blob/main/config.json
99
99
  },
100
100
  {
101
101
  displayName: 'Mistral',
102
102
  enabled: true,
103
103
  id: 'mistral',
104
- tokens: 4800,
104
+ tokens: 32_768, // https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2/blob/main/config.json
105
105
  },
106
106
  {
107
107
  displayName: 'Mixtral 8x7B',
108
108
  enabled: true,
109
109
  id: 'mixtral',
110
- tokens: 32_000,
110
+ tokens: 32_768,
111
111
  },
112
112
  {
113
113
  displayName: 'Mixtral 8x22B',
114
114
  id: 'mixtral:8x22b',
115
- tokens: 64_000,
115
+ tokens: 65_536, // https://huggingface.co/mistralai/Mixtral-8x22B-v0.1/blob/main/config.json
116
116
  },
117
117
  {
118
118
  displayName: 'Qwen Chat 4B',
@@ -138,19 +138,19 @@ const Ollama: ModelProviderCard = {
138
138
  {
139
139
  displayName: 'LLaVA 7B',
140
140
  id: 'llava',
141
- tokens: 4000,
141
+ tokens: 4096, // https://huggingface.co/llava-hf/llava-1.5-7b-hf/blob/main/config.json
142
142
  vision: true,
143
143
  },
144
144
  {
145
145
  displayName: 'LLaVA 13B',
146
146
  id: 'llava:13b',
147
- tokens: 4000,
147
+ tokens: 4096,
148
148
  vision: true,
149
149
  },
150
150
  {
151
151
  displayName: 'LLaVA 34B',
152
152
  id: 'llava:34b',
153
- tokens: 4000,
153
+ tokens: 4096,
154
154
  vision: true,
155
155
  },
156
156
  ],
@@ -1,6 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
- // refs to: https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4
3
+ // ref https://platform.openai.com/docs/models
4
4
  const OpenAI: ModelProviderCard = {
5
5
  chatModels: [
6
6
  {
@@ -1,6 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
- // ref https://api.together.xyz/models
3
+ // ref https://docs.together.ai/docs/inference-models
4
4
  const TogetherAI: ModelProviderCard = {
5
5
  chatModels: [
6
6
  {
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://platform.lingyiwanwu.com/
3
4
  const ZeroOne: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -7,7 +8,7 @@ const ZeroOne: ModelProviderCard = {
7
8
  displayName: 'YI 34B Chat',
8
9
  enabled: true,
9
10
  id: 'yi-34b-chat-0205',
10
- tokens: 4000,
11
+ tokens: 4096, // https://huggingface.co/01-ai/Yi-34B-Chat/blob/main/config.json
11
12
  },
12
13
  {
13
14
  description:
@@ -15,7 +16,7 @@ const ZeroOne: ModelProviderCard = {
15
16
  displayName: 'YI Vision Plus',
16
17
  enabled: true,
17
18
  id: 'yi-vl-plus',
18
- tokens: 4000,
19
+ tokens: 4096,
19
20
  vision: true,
20
21
  },
21
22
  {
@@ -23,7 +24,7 @@ const ZeroOne: ModelProviderCard = {
23
24
  displayName: 'YI 34B Chat 200k',
24
25
  enabled: true,
25
26
  id: 'yi-34b-chat-200k',
26
- tokens: 200_000,
27
+ tokens: 200_000, // https://huggingface.co/01-ai/Yi-34B-200K/blob/main/config.json
27
28
  },
28
29
  ],
29
30
  id: 'zeroone',
@@ -1,8 +1,10 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
3
  // TODO: 等待 ZhiPu 修复 API 问题后开启 functionCall
4
- // refs: https://github.com/lobehub/lobe-chat/discussions/737#discussioncomment-8315815
5
4
  // 暂时不透出 GLM 系列的 function_call 功能
5
+ // refs https://github.com/lobehub/lobe-chat/discussions/737#discussioncomment-8315815
6
+
7
+ // ref https://open.bigmodel.cn/dev/howuse/model
6
8
  const ZhiPu: ModelProviderCard = {
7
9
  chatModels: [
8
10
  {
@@ -19,7 +21,7 @@ const ZhiPu: ModelProviderCard = {
19
21
  displayName: 'GLM-4 Vision',
20
22
  enabled: true,
21
23
  id: 'glm-4v',
22
- tokens: 128_000,
24
+ tokens: 2000,
23
25
  vision: true,
24
26
  },
25
27
  {
@@ -48,7 +48,7 @@
48
48
  "displayName": "LLaVA 7B",
49
49
  "enabled": true,
50
50
  "id": "llava",
51
- "tokens": 4000,
51
+ "tokens": 4096,
52
52
  "vision": true
53
53
  }
54
54
  ]
@@ -109,7 +109,7 @@ describe('LLMSettingsSliceAction', () => {
109
109
  displayName: 'LLaVA 7B',
110
110
  enabled: true,
111
111
  id: 'llava',
112
- tokens: 4000,
112
+ tokens: 4096,
113
113
  vision: true,
114
114
  });
115
115
  });
package/src/types/llm.ts CHANGED
@@ -32,7 +32,7 @@ export interface ChatModelCard {
32
32
  legacy?: boolean;
33
33
  maxOutput?: number;
34
34
  /**
35
- * the context window
35
+ * the context window (or input + output tokens limit)
36
36
  */
37
37
  tokens?: number;
38
38
  /**