@lobehub/chat 0.147.17 → 0.147.19

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,57 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.147.19](https://github.com/lobehub/lobe-chat/compare/v0.147.18...v0.147.19)
6
+
7
+ <sup>Released on **2024-04-18**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Add M and B support max token in ModelInfoTags.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Add M and B support max token in ModelInfoTags, closes [#2073](https://github.com/lobehub/lobe-chat/issues/2073) ([a985d8f](https://github.com/lobehub/lobe-chat/commit/a985d8f))
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
+
30
+ ### [Version 0.147.18](https://github.com/lobehub/lobe-chat/compare/v0.147.17...v0.147.18)
31
+
32
+ <sup>Released on **2024-04-17**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Add claude 3 opus to AWS Bedrock, remove custom models from providers, and update Perplexity model names.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Add claude 3 opus to AWS Bedrock, closes [#2072](https://github.com/lobehub/lobe-chat/issues/2072) ([479f562](https://github.com/lobehub/lobe-chat/commit/479f562))
46
+ - **misc**: Remove custom models from providers, and update Perplexity model names, closes [#2069](https://github.com/lobehub/lobe-chat/issues/2069) ([e04754d](https://github.com/lobehub/lobe-chat/commit/e04754d))
47
+
48
+ </details>
49
+
50
+ <div align="right">
51
+
52
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
53
+
54
+ </div>
55
+
5
56
  ### [Version 0.147.17](https://github.com/lobehub/lobe-chat/compare/v0.147.16...v0.147.17)
6
57
 
7
58
  <sup>Released on **2024-04-16**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.147.17",
3
+ "version": "0.147.19",
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",
@@ -56,11 +56,17 @@ const useStyles = createStyles(({ css, token }) => ({
56
56
  border-radius: 4px;
57
57
  `,
58
58
  }));
59
+ const formatTokenNumber = (num: number): string => {
60
+ if (num < 1000) return '1K';
61
+ const kiloToken = Math.floor(num / 1000);
62
+ return kiloToken < 1000 ? `${kiloToken}K` : `${Math.floor(kiloToken / 1000)}M`;
63
+ }
59
64
 
60
65
  interface ModelInfoTagsProps extends ChatModelCard {
61
66
  directionReverse?: boolean;
62
67
  placement?: 'top' | 'right';
63
68
  }
69
+
64
70
  export const ModelInfoTags = memo<ModelInfoTagsProps>(
65
71
  ({ directionReverse, placement = 'right', ...model }) => {
66
72
  const { t } = useTranslation('components');
@@ -101,7 +107,7 @@ export const ModelInfoTags = memo<ModelInfoTagsProps>(
101
107
  tokens: numeral(model.tokens).format('0,0'),
102
108
  })}
103
109
  >
104
- <Center className={styles.token}>{Math.floor(model.tokens / 1000)}K</Center>
110
+ <Center className={styles.token}>{formatTokenNumber(model.tokens)}</Center>
105
111
  </Tooltip>
106
112
  )}
107
113
  {/*{model.isCustom && (*/}
@@ -121,6 +127,7 @@ export const ModelInfoTags = memo<ModelInfoTagsProps>(
121
127
  interface ModelItemRenderProps extends ChatModelCard {
122
128
  showInfoTag?: boolean;
123
129
  }
130
+
124
131
  export const ModelItemRender = memo<ModelItemRenderProps>(({ showInfoTag = true, ...model }) => {
125
132
  return (
126
133
  <Flexbox align={'center'} gap={32} horizontal justify={'space-between'}>
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://docs.anthropic.com/claude/docs/models-overview
3
4
  const Anthropic: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html
3
4
  const Bedrock: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -9,6 +10,15 @@ const Bedrock: ModelProviderCard = {
9
10
  id: 'amazon.titan-text-express-v1:0:8k',
10
11
  tokens: 8000,
11
12
  },
13
+ {
14
+ description:
15
+ 'Claude 3 Opus 是 Anthropic 最强大的人工智能模型,在处理高度复杂的任务方面具备顶尖性能。该模型能够以非凡的流畅性和类似人类的理解能力引导开放式的提示和未可见的场景。Claude 3 Opus 向我们展示生成式人工智能的美好前景。 Claude 3 Opus 可以处理图像和返回文本输出,并且提供 200K 上下文窗口。',
16
+ displayName: 'Claude 3 Opus',
17
+ enabled: true,
18
+ id: 'anthropic.claude-3-opus-20240229-v1:0',
19
+ tokens: 200_000,
20
+ vision: true,
21
+ },
12
22
  {
13
23
  description:
14
24
  'Anthropic 推出的 Claude 3 Sonnet 模型在智能和速度之间取得理想的平衡,尤其是在处理企业工作负载方面。该模型提供最大的效用,同时价格低于竞争产品,并且其经过精心设计,是大规模部署人工智能的可信赖、高耐久性骨干模型。 Claude 3 Sonnet 可以处理图像和返回文本输出,并且提供 200K 上下文窗口。',
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://ai.google.dev/models/gemini
3
4
  const Google: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://console.groq.com/docs/models
3
4
  const Groq: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -33,11 +33,6 @@ const Mistral: ModelProviderCard = {
33
33
  id: 'mistral-large-latest',
34
34
  tokens: 32_768,
35
35
  },
36
- {
37
- displayName: 'Mixtral 8x22B',
38
- id: 'mixtral-8x22b',
39
- tokens: 32_768,
40
- },
41
36
  ],
42
37
  id: 'mistral',
43
38
  };
@@ -20,13 +20,6 @@ const Moonshot: ModelProviderCard = {
20
20
  id: 'moonshot-v1-128k',
21
21
  tokens: 128_000,
22
22
  },
23
- {
24
- displayName: 'Moonshot Kimi Reverse',
25
- files: true,
26
- id: 'moonshot-v1',
27
- tokens: 200_000,
28
- vision: true,
29
- },
30
23
  ],
31
24
  id: 'moonshot',
32
25
  };
@@ -148,49 +148,6 @@ const Ollama: ModelProviderCard = {
148
148
  tokens: 4000,
149
149
  vision: true,
150
150
  },
151
- // TODO: 在单独支持千问之后这些 Qwen 模型需要移动到千问的配置中
152
- {
153
- displayName: 'Qwen Plus',
154
- functionCall: true,
155
- id: 'qwen-plus',
156
- tokens: 30_000,
157
- vision: false,
158
- },
159
- {
160
- displayName: 'Qwen Turbo',
161
- functionCall: true,
162
- id: 'qwen-turbo',
163
- tokens: 6000,
164
- vision: false,
165
- },
166
- {
167
- displayName: 'Qwen Max',
168
- functionCall: true,
169
- id: 'qwen-max',
170
- tokens: 6000,
171
- vision: false,
172
- },
173
- {
174
- displayName: 'Qwen Max Long',
175
- functionCall: true,
176
- id: 'qwen-max-longcontext',
177
- tokens: 28_000,
178
- vision: false,
179
- },
180
- {
181
- displayName: 'Qwen VL Max',
182
- functionCall: false,
183
- id: 'qwen-vl-max',
184
- tokens: 6000,
185
- vision: true,
186
- },
187
- {
188
- displayName: 'Qwen VL Plus',
189
- functionCall: false,
190
- id: 'qwen-vl-plus',
191
- tokens: 30_000,
192
- vision: true,
193
- },
194
151
  ],
195
152
  id: 'ollama',
196
153
  };
@@ -117,14 +117,6 @@ const OpenAI: ModelProviderCard = {
117
117
  tokens: 128_000,
118
118
  vision: true,
119
119
  },
120
- {
121
- displayName: 'GPT-4 ALL',
122
- files: true,
123
- functionCall: true,
124
- id: 'gpt-4-all',
125
- tokens: 32_768,
126
- vision: true,
127
- },
128
120
  ],
129
121
  enabled: true,
130
122
  id: 'openai',
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://openrouter.ai/docs#models
3
4
  const OpenRouter: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -99,13 +100,21 @@ const OpenRouter: ModelProviderCard = {
99
100
  vision: false,
100
101
  },
101
102
  {
102
- displayName: 'Mistral: Mixtral 8x22B (base) (free)',
103
+ displayName: 'Mistral: Mixtral 8x22B (base)',
103
104
  enabled: true,
104
105
  functionCall: false,
105
106
  id: 'mistralai/mixtral-8x22b',
106
107
  tokens: 64_000,
107
108
  vision: false,
108
109
  },
110
+ {
111
+ displayName: 'Microsoft: WizardLM-2 8x22B',
112
+ enabled: true,
113
+ functionCall: false,
114
+ id: 'microsoft/wizardlm-2-8x22b',
115
+ tokens: 65_536,
116
+ vision: false,
117
+ },
109
118
  ],
110
119
  id: 'openrouter',
111
120
  };
@@ -1,43 +1,44 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://docs.perplexity.ai/docs/model-cards
3
4
  const Perplexity: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
6
7
  displayName: 'Perplexity 7B Chat',
7
- id: 'pplx-7b-chat',
8
- tokens: 8192,
8
+ id: 'sonar-small-chat',
9
+ tokens: 16_384,
9
10
  },
10
11
  {
11
- displayName: 'Perplexity 70B Chat',
12
+ displayName: 'Perplexity 8x7B Chat',
12
13
  enabled: true,
13
- id: 'pplx-70b-chat',
14
- tokens: 8192,
14
+ id: 'sonar-medium-chat',
15
+ tokens: 16_384,
15
16
  },
16
17
  {
17
18
  displayName: 'Perplexity 7B Online',
18
- id: 'pplx-7b-online',
19
- tokens: 8192,
19
+ id: 'sonar-small-online',
20
+ tokens: 12_000,
20
21
  },
21
22
  {
22
- displayName: 'Perplexity 70B Online',
23
+ displayName: 'Perplexity 8x7B Online',
23
24
  enabled: true,
24
- id: 'pplx-70b-online',
25
- tokens: 8192,
25
+ id: 'sonar-medium-online',
26
+ tokens: 12_000,
26
27
  },
27
28
  {
28
- displayName: 'Codellama 34B Instruct',
29
- id: 'codellama-34b-instruct',
29
+ displayName: 'Codellama 70B Instruct',
30
+ id: 'codellama-70b-instruct',
30
31
  tokens: 16_384,
31
32
  },
32
33
  {
33
- displayName: 'Codellama 70B Instruct',
34
- id: 'codellama-70b-instruct',
34
+ displayName: 'Mistral 7B Instruct',
35
+ id: 'mistral-7b-instruc',
35
36
  tokens: 16_384,
36
37
  },
37
38
  {
38
39
  displayName: 'Mixtral 8x7B Instruct',
39
40
  id: 'mixtral-8x7b-instruct',
40
- tokens: 8192,
41
+ tokens: 16_384,
41
42
  },
42
43
  ],
43
44
  id: 'perplexity',
@@ -1,5 +1,6 @@
1
1
  import { ModelProviderCard } from '@/types/llm';
2
2
 
3
+ // ref https://api.together.xyz/models
3
4
  const TogetherAI: ModelProviderCard = {
4
5
  chatModels: [
5
6
  {
@@ -85,14 +85,14 @@ describe('modelProviderSelectors', () => {
85
85
  });
86
86
 
87
87
  describe('modelEnabledFiles', () => {
88
- it('should return false if the model does not have file ability', () => {
88
+ it.skip('should return false if the model does not have file ability', () => {
89
89
  const enabledFiles = modelProviderSelectors.isModelEnabledFiles('gpt-4-vision-preview')(
90
90
  useGlobalStore.getState(),
91
91
  );
92
92
  expect(enabledFiles).toBeFalsy();
93
93
  });
94
94
 
95
- it('should return true if the model has file ability', () => {
95
+ it.skip('should return true if the model has file ability', () => {
96
96
  const enabledFiles = modelProviderSelectors.isModelEnabledFiles('gpt-4-all')(
97
97
  useGlobalStore.getState(),
98
98
  );