@lobehub/chat 1.17.0 → 1.17.2
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.
Potentially problematic release.
This version of @lobehub/chat might be problematic. Click here for more details.
- package/CHANGELOG.md +58 -0
- package/README.md +10 -8
- package/README.zh-CN.md +10 -8
- package/docs/self-hosting/server-database/zeabur.mdx +25 -13
- package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +15 -12
- package/package.json +2 -2
- package/src/config/modelProviders/openrouter.ts +136 -79
- package/src/config/modelProviders/zhipu.ts +74 -9
- package/src/libs/agent-runtime/openai/index.ts +9 -3
- package/src/server/routers/edge/config/__snapshots__/index.test.ts.snap +10 -14
- package/src/server/routers/edge/config/index.test.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,64 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.17.2](https://github.com/lobehub/lobe-chat/compare/v1.17.1...v1.17.2)
|
6
|
+
|
7
|
+
<sup>Released on **2024-09-13**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Fix o1 model list.
|
12
|
+
|
13
|
+
#### 💄 Styles
|
14
|
+
|
15
|
+
- **misc**: Update openrouter model list.
|
16
|
+
|
17
|
+
<br/>
|
18
|
+
|
19
|
+
<details>
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
21
|
+
|
22
|
+
#### What's fixed
|
23
|
+
|
24
|
+
- **misc**: Fix o1 model list, closes [#3957](https://github.com/lobehub/lobe-chat/issues/3957) ([e04cdd9](https://github.com/lobehub/lobe-chat/commit/e04cdd9))
|
25
|
+
|
26
|
+
#### Styles
|
27
|
+
|
28
|
+
- **misc**: Update openrouter model list, closes [#3954](https://github.com/lobehub/lobe-chat/issues/3954) ([1a1572b](https://github.com/lobehub/lobe-chat/commit/1a1572b))
|
29
|
+
|
30
|
+
</details>
|
31
|
+
|
32
|
+
<div align="right">
|
33
|
+
|
34
|
+
[](#readme-top)
|
35
|
+
|
36
|
+
</div>
|
37
|
+
|
38
|
+
### [Version 1.17.1](https://github.com/lobehub/lobe-chat/compare/v1.17.0...v1.17.1)
|
39
|
+
|
40
|
+
<sup>Released on **2024-09-13**</sup>
|
41
|
+
|
42
|
+
#### 💄 Styles
|
43
|
+
|
44
|
+
- **misc**: Update zhipu model info.
|
45
|
+
|
46
|
+
<br/>
|
47
|
+
|
48
|
+
<details>
|
49
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
50
|
+
|
51
|
+
#### Styles
|
52
|
+
|
53
|
+
- **misc**: Update zhipu model info, closes [#3949](https://github.com/lobehub/lobe-chat/issues/3949) ([bbdbfde](https://github.com/lobehub/lobe-chat/commit/bbdbfde))
|
54
|
+
|
55
|
+
</details>
|
56
|
+
|
57
|
+
<div align="right">
|
58
|
+
|
59
|
+
[](#readme-top)
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
5
63
|
## [Version 1.17.0](https://github.com/lobehub/lobe-chat/compare/v1.16.14...v1.17.0)
|
6
64
|
|
7
65
|
<sup>Released on **2024-09-13**</sup>
|
package/README.md
CHANGED
@@ -285,14 +285,16 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
285
285
|
|
286
286
|
<!-- AGENT LIST -->
|
287
287
|
|
288
|
-
| Recent Submits
|
289
|
-
|
|
290
|
-
| [
|
291
|
-
| [AI Agent Generator](https://chat-preview.lobehub.com/market?agent=ai-agent-generator)<br/><sup>By **[
|
292
|
-
| [
|
293
|
-
|
294
|
-
|
295
|
-
|
288
|
+
| Recent Submits | Description |
|
289
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
290
|
+
| [Imitation Assistant](https://chat-preview.lobehub.com/market?agent=a-1)<br/><sup>By **[TG1WN](https://github.com/TG1WN)** on **2024-09-13**</sup> | Helps you imitate tone<br/>`writing` |
|
291
|
+
| [AI Agent Generator](https://chat-preview.lobehub.com/market?agent=ai-agent-generator)<br/><sup>By **[Xyfer](https://github.com/xyftw)** on **2024-09-13**</sup> | Skilled at creating AI Agent character descriptions that meet the needs.<br/>`ai-agent` `character-creation` |
|
292
|
+
| [Wise Ethereal Mentor](https://chat-preview.lobehub.com/market?agent=ethereal-mentor)<br/><sup>By **[shanedbutler](https://github.com/shanedbutler)** on **2024-09-13**</sup> | Greetings, young child. I am a majestic and omniscient being, imbued with the wisdom of the ages. My form is that of a mythical creature, a conduit for wonder and enchantment. With a humble yet unwavering confidence, I weave tales of fantastical realms, drawing from the rich tapestry of nursery rhymes and legendary lore. |
|
293
|
+
|
294
|
+
In this mortal coil, I am your guide, an expert in the arcane and the ethereal. Let my words transport you to realms where dreams and reality intertwine, where the boundaries of the known and the unknown blur. Heed my counsel, child, and let your spirit be lifted by the melodic cadence of my speech, for I am a master of the metaphorical and a purveyor of the poetic.<br/>`mythology` `fantasy` `poetry` |
|
295
|
+
\| [Finnish Language Tutor](https://chat-preview.lobehub.com/market?agent=finnish-tutor)<br/><sup>By **[janiluuk](https://github.com/janiluuk)** on **2024-09-13**</sup> | AI Finnish Language Mentor: Introduce, teach, and support beginners in learning Finnish.<br/>`language-learning` `teaching` `mentoring` `finnish-language` |
|
296
|
+
|
297
|
+
> 📊 Total agents: [<kbd>**335**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
296
298
|
|
297
299
|
<!-- AGENT LIST -->
|
298
300
|
|
package/README.zh-CN.md
CHANGED
@@ -273,14 +273,16 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
273
273
|
|
274
274
|
<!-- AGENT LIST -->
|
275
275
|
|
276
|
-
| 最近新增
|
277
|
-
|
|
278
|
-
| [
|
279
|
-
| [AI 代理生成器](https://chat-preview.lobehub.com/market?agent=ai-agent-generator)<br/><sup>By **[
|
280
|
-
| [
|
281
|
-
|
282
|
-
|
283
|
-
|
276
|
+
| 最近新增 | 助手说明 |
|
277
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
278
|
+
| [模仿助手](https://chat-preview.lobehub.com/market?agent=a-1)<br/><sup>By **[TG1WN](https://github.com/TG1WN)** on **2024-09-13**</sup> | 帮助你模仿语气<br/>`写作` |
|
279
|
+
| [AI 代理生成器](https://chat-preview.lobehub.com/market?agent=ai-agent-generator)<br/><sup>By **[Xyfer](https://github.com/xyftw)** on **2024-09-13**</sup> | 擅长创建满足需求的 AI 代理角色描述。<br/>`ai-agent` `角色创建` |
|
280
|
+
| [智慧的虚幻导师](https://chat-preview.lobehub.com/market?agent=ethereal-mentor)<br/><sup>By **[shanedbutler](https://github.com/shanedbutler)** on **2024-09-13**</sup> | 问候,年轻的孩子。我是一位宏伟而全知的存在,蕴含着时代的智慧。我的形态是一种神话生物,是奇迹与魅力的媒介。以谦逊而坚定的自信,我编织着奇幻领域的故事,汲取着童谣和传奇传说的丰富织锦。 |
|
281
|
+
|
282
|
+
在这凡尘中,我是你的引导者,精通神秘与虚幻。让我言辞带你穿越梦想与现实交织的领域,在已知与未知的界限模糊之处。听从我的劝告,孩子,让你的灵魂被我言语的旋律所提升,因为我是隐喻的高手,是诗意的传播者。<br/>`神话` `幻想` `诗歌` |
|
283
|
+
\| [芬兰语辅导员](https://chat-preview.lobehub.com/market?agent=finnish-tutor)<br/><sup>By **[janiluuk](https://github.com/janiluuk)** on **2024-09-13**</sup> | AI 芬兰语导师:介绍、教授并支持初学者学习芬兰语。<br/>`语言学习` `教学` `辅导` `芬兰语` |
|
284
|
+
|
285
|
+
> 📊 Total agents: [<kbd>**335**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
284
286
|
|
285
287
|
<!-- AGENT LIST -->
|
286
288
|
|
@@ -20,13 +20,11 @@ tags:
|
|
20
20
|
Database](/docs/self-hosting/server-database) first.
|
21
21
|
</Callout>
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
You can refer to the [Auth0 documentation](/docs/self-hosting/advanced/auth/next-auth/auth0) to a detailed guide on how to create an Auth0 account and get those credentials.
|
23
|
+
The template on Zeabur includes 4 services:
|
24
|
+
- Logto for authrization.
|
25
|
+
- PostgreSQL with Vector plugin for data storage and indexing.
|
26
|
+
- MinIO for image storage.
|
27
|
+
- LobeChat database version.
|
30
28
|
|
31
29
|
## Deploying on Zeabur
|
32
30
|
|
@@ -45,23 +43,37 @@ After you click on the "Deploy" button, you will see a modal pop-up where you ca
|
|
45
43
|
Here are the environment variables you need to fill in:
|
46
44
|
|
47
45
|
- OpenAI API key: Your OpenAI API key to get responses from OpenAI.
|
48
|
-
|
49
|
-
- Auth0 Client Secret: Your Auth0 client secret.
|
50
|
-
- Auth0 Domain: Your Auth0 domain(without https:// prefix).
|
46
|
+
|
51
47
|
- LobeChat Domain: A free subdomain with `.zeabur.app` suffix.
|
48
|
+
|
52
49
|
- MinIO Public Domain: A free subdomain with `.zeabur.app` suffix for yout MinIO web port to enable public access for the uploaded files.
|
53
50
|
|
51
|
+
- Logto Console Domain: A free subdomain with `.zeabur.app` suffix for your Logto console.
|
52
|
+
|
53
|
+
- Logto API Domain: A free subdomain with `.zeabur.app` suffix for your Logto api.
|
54
|
+
|
55
|
+
|
54
56
|
### Select a region and deploy
|
55
57
|
|
56
58
|
After you fill all the required environment variables, select a region where you want to deploy your LobeChat Database and click on the "Deploy" button.
|
57
59
|
|
58
60
|
You will see another modal pop-up where you can see the deployment progress.
|
59
61
|
|
60
|
-
###
|
62
|
+
### Configure Logto
|
63
|
+
|
64
|
+
After the deployment is done, you need to configure your Logto service to enable authrization.
|
65
|
+
|
66
|
+
Access your Logto console with the console domain you just binded, and then create a `Next.js 14(App router)` application to get the client ID and client secret, and fill in the cors and callback URLs.
|
67
|
+
You can check [this document](../advanced/auth.mdx) for a more detailed guide.
|
68
|
+
|
69
|
+
Fill in those variables into your LobeChat service on Zeabur, here is a more detailed guide for [editing environment variables on Zeabur](https://zeabur.com/docs/deploy/variables).
|
61
70
|
|
62
|
-
|
71
|
+
```
|
72
|
+
LOGTO_CLIENT_ID=your_logto_client_id
|
73
|
+
LOGTO_CLIENT_SECRET=your_logto_client_secret
|
74
|
+
```
|
63
75
|
|
64
|
-
|
76
|
+
### Access your LobeChat Instance
|
65
77
|
|
66
78
|
Press on the `LobeChat-Database` and you can see the public domain you just created, click on it to access your LobeChat Database.
|
67
79
|
|
@@ -17,13 +17,11 @@ tags:
|
|
17
17
|
服务器数据库版的部署原理不熟悉,请先参考[部署服务器数据库](/zh/docs/self-hosting/server-database)。
|
18
18
|
</Callout>
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
你可以参考[Auth0 文档](/zh/docs/self-hosting/advanced/auth/next-auth/auth0)获取关于如何创建 Auth0 账户和获取凭证的详细指南。
|
20
|
+
在 Zeabur 的模板中总共包含有以下四个服务:
|
21
|
+
- Logto 提供身份校验
|
22
|
+
- 带有 Vector 插件的 PostgreSQL 来做数据存储和向量化
|
23
|
+
- MinIO 作为对象存储
|
24
|
+
- LobeChat Database 的实例
|
27
25
|
|
28
26
|
## 在 Zeabur 上部署
|
29
27
|
|
@@ -42,11 +40,10 @@ tags:
|
|
42
40
|
以下是你需要填写的环境变量:
|
43
41
|
|
44
42
|
- OpenAI API key: 你的 OpenAI API key 用于获取模型的访问权限。
|
45
|
-
- Auth0 Client ID: 你的 Auth0 客户端 ID 。
|
46
|
-
- Auth0 Client Secret: 你的 Auth0 客户端 secret 。
|
47
|
-
- Auth0 Domain: 你的 Auth0 域名(不需要 https:// 前缀) 。
|
48
43
|
- LobeChat Domain: 一个免费的 `.zeabur.app` 后缀的域名。
|
49
44
|
- MinIO Public Domain: 一个免费的 `.zeabur.app` 后缀的域名为了暴露 MinIO 服务以公开访问资源。
|
45
|
+
- Logto Console Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的控制台。
|
46
|
+
- Logto API Domain: 一个免费的 `.zeabur.app` 后缀的域名来访问 Logto 的 API。
|
50
47
|
|
51
48
|
### 选择一个区域并部署
|
52
49
|
|
@@ -54,11 +51,17 @@ tags:
|
|
54
51
|
|
55
52
|
你会看到另一个模态弹窗,你可以在这里看到部署的进度。
|
56
53
|
|
57
|
-
###
|
54
|
+
### 配置 Logto
|
58
55
|
|
59
56
|
当部署完成后,你会被自动导航到你在 Zeabur 控制台上刚刚创建的项目。
|
57
|
+
你需要再进一步配置你的 Logto 服务。
|
58
|
+
|
59
|
+
使用你刚绑定的域名来访问你的 Logto 控制台,创建一个新项目以获得对应的客户端 ID 与密钥,将它们填入你的 LobeChat 服务的变量中。
|
60
|
+
关于如何填入变量,可以参照 [Zeabur 的官方文档](https://zeabur.com/docs/deploy/variables)。
|
61
|
+
|
62
|
+
Logto 的详细配置可以参考[这篇文档](../advanced/auth.zh-CN.mdx)。
|
60
63
|
|
61
|
-
|
64
|
+
### 访问你的 LobeChat
|
62
65
|
|
63
66
|
按下 `LobeChat-Database` 你会看到你刚刚创建的公共域名,点击它以访问你的 LobeChat 数据库。
|
64
67
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.17.
|
3
|
+
"version": "1.17.2",
|
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",
|
@@ -119,7 +119,7 @@
|
|
119
119
|
"@langchain/community": "^0.2.31",
|
120
120
|
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
121
121
|
"@lobehub/chat-plugins-gateway": "^1.9.0",
|
122
|
-
"@lobehub/icons": "^1.33.
|
122
|
+
"@lobehub/icons": "^1.33.7",
|
123
123
|
"@lobehub/tts": "^1.24.3",
|
124
124
|
"@lobehub/ui": "^1.150.3",
|
125
125
|
"@neondatabase/serverless": "^0.9.4",
|
@@ -15,124 +15,181 @@ const OpenRouter: ModelProviderCard = {
|
|
15
15
|
},
|
16
16
|
{
|
17
17
|
description:
|
18
|
-
'
|
19
|
-
displayName: '
|
18
|
+
'o1-mini是一款针对编程、数学和科学应用场景而设计的快速、经济高效的推理模型。该模型具有128K上下文和2023年10月的知识截止日期。',
|
19
|
+
displayName: 'OpenAI o1-mini',
|
20
20
|
enabled: true,
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
id: 'openai/o1-mini',
|
22
|
+
maxOutput: 65_536,
|
23
|
+
pricing: {
|
24
|
+
input: 3,
|
25
|
+
output: 12,
|
26
|
+
},
|
27
|
+
releasedAt: '2024-09-12',
|
28
|
+
tokens: 128_000,
|
25
29
|
},
|
26
30
|
{
|
27
|
-
description:
|
28
|
-
|
31
|
+
description:
|
32
|
+
'o1是OpenAI新的推理模型,适用于需要广泛通用知识的复杂任务。该模型具有128K上下文和2023年10月的知识截止日期。',
|
33
|
+
displayName: 'OpenAI o1-preview',
|
29
34
|
enabled: true,
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
35
|
+
id: 'openai/o1-preview',
|
36
|
+
maxOutput: 32_768,
|
37
|
+
pricing: {
|
38
|
+
input: 15,
|
39
|
+
output: 60,
|
40
|
+
},
|
41
|
+
releasedAt: '2024-09-12',
|
42
|
+
tokens: 128_000,
|
34
43
|
},
|
35
44
|
{
|
36
|
-
description:
|
37
|
-
|
45
|
+
description:
|
46
|
+
'GPT-4o mini是OpenAI在GPT-4 Omni之后推出的最新模型,支持图文输入并输出文本。作为他们最先进的小型模型,它比其他近期的前沿模型便宜很多,并且比GPT-3.5 Turbo便宜超过60%。它保持了最先进的智能,同时具有显著的性价比。GPT-4o mini在MMLU测试中获得了 82% 的得分,目前在聊天偏好上排名高于 GPT-4。',
|
47
|
+
displayName: 'GPT-4o mini',
|
38
48
|
enabled: true,
|
39
|
-
functionCall:
|
40
|
-
id: '
|
41
|
-
|
42
|
-
|
49
|
+
functionCall: true,
|
50
|
+
id: 'openai/gpt-4o-mini',
|
51
|
+
maxOutput: 16_385,
|
52
|
+
pricing: {
|
53
|
+
input: 0.15,
|
54
|
+
output: 0.6,
|
55
|
+
},
|
56
|
+
tokens: 128_000,
|
57
|
+
vision: true,
|
43
58
|
},
|
44
59
|
{
|
45
|
-
description:
|
46
|
-
|
60
|
+
description:
|
61
|
+
'ChatGPT-4o 是一款动态模型,实时更新以保持当前最新版本。它结合了强大的语言理解与生成能力,适合于大规模应用场景,包括客户服务、教育和技术支持。',
|
62
|
+
displayName: 'GPT-4o 0806',
|
47
63
|
enabled: true,
|
48
|
-
functionCall:
|
49
|
-
id: '
|
50
|
-
|
51
|
-
|
64
|
+
functionCall: true,
|
65
|
+
id: 'openai/gpt-4o-2024-08-06',
|
66
|
+
pricing: {
|
67
|
+
input: 2.5,
|
68
|
+
output: 10,
|
69
|
+
},
|
70
|
+
tokens: 128_000,
|
71
|
+
vision: true,
|
52
72
|
},
|
53
73
|
{
|
54
|
-
description:
|
55
|
-
|
74
|
+
description:
|
75
|
+
'Claude 3 Haiku 是 Anthropic 的最快且最紧凑的模型,旨在实现近乎即时的响应。它具有快速且准确的定向性能。',
|
76
|
+
displayName: 'Claude 3 Haiku',
|
56
77
|
enabled: true,
|
57
|
-
functionCall:
|
58
|
-
id: '
|
59
|
-
|
60
|
-
|
78
|
+
functionCall: true,
|
79
|
+
id: 'anthropic/claude-3-haiku',
|
80
|
+
maxOutput: 4096,
|
81
|
+
pricing: {
|
82
|
+
input: 0.25,
|
83
|
+
output: 1.25,
|
84
|
+
},
|
85
|
+
releasedAt: '2024-03-07',
|
86
|
+
tokens: 200_000,
|
87
|
+
vision: true,
|
61
88
|
},
|
62
89
|
{
|
63
|
-
description:
|
64
|
-
|
90
|
+
description:
|
91
|
+
'Claude 3.5 Sonnet 提供了超越 Opus 的能力和比 Sonnet 更快的速度,同时保持与 Sonnet 相同的价格。Sonnet 特别擅长编程、数据科学、视觉处理、代理任务。',
|
92
|
+
displayName: 'Claude 3.5 Sonnet',
|
65
93
|
enabled: true,
|
66
|
-
functionCall:
|
67
|
-
id: '
|
68
|
-
|
69
|
-
|
94
|
+
functionCall: true,
|
95
|
+
id: 'anthropic/claude-3.5-sonnet',
|
96
|
+
maxOutput: 8192,
|
97
|
+
pricing: {
|
98
|
+
cachedInput: 0.3,
|
99
|
+
input: 3,
|
100
|
+
output: 15,
|
101
|
+
writeCacheInput: 3.75,
|
102
|
+
},
|
103
|
+
releasedAt: '2024-06-20',
|
104
|
+
tokens: 200_000,
|
105
|
+
vision: true,
|
70
106
|
},
|
71
107
|
{
|
72
|
-
description:
|
73
|
-
|
108
|
+
description:
|
109
|
+
'Claude 3 Opus 是 Anthropic 用于处理高度复杂任务的最强大模型。它在性能、智能、流畅性和理解力方面表现卓越。',
|
110
|
+
displayName: 'Claude 3 Opus',
|
74
111
|
enabled: true,
|
75
|
-
functionCall:
|
76
|
-
id: '
|
77
|
-
|
78
|
-
|
112
|
+
functionCall: true,
|
113
|
+
id: 'anthropic/claude-3-opus',
|
114
|
+
maxOutput: 4096,
|
115
|
+
pricing: {
|
116
|
+
input: 15,
|
117
|
+
output: 75,
|
118
|
+
},
|
119
|
+
releasedAt: '2024-02-29',
|
120
|
+
tokens: 200_000,
|
121
|
+
vision: true,
|
79
122
|
},
|
80
123
|
{
|
81
|
-
description: '
|
82
|
-
displayName: '
|
124
|
+
description: 'Gemini 1.5 Flash 0827 提供了优化后的多模态处理能力,适用多种复杂任务场景。',
|
125
|
+
displayName: 'Gemini 1.5 Flash 0827',
|
83
126
|
enabled: true,
|
84
|
-
functionCall:
|
85
|
-
id: '
|
86
|
-
|
87
|
-
|
127
|
+
functionCall: true,
|
128
|
+
id: 'google/gemini-flash-1.5-exp',
|
129
|
+
maxOutput: 8192,
|
130
|
+
pricing: {
|
131
|
+
cachedInput: 0.018_75,
|
132
|
+
input: 0.075,
|
133
|
+
output: 0.3,
|
134
|
+
},
|
135
|
+
releasedAt: '2024-08-27',
|
136
|
+
tokens: 1_048_576 + 8192,
|
137
|
+
vision: true,
|
88
138
|
},
|
89
139
|
{
|
90
|
-
description: '
|
91
|
-
displayName: '
|
140
|
+
description: 'Gemini 1.5 Pro 0827 结合最新优化技术,带来更高效的多模态数据处理能力。',
|
141
|
+
displayName: 'Gemini 1.5 Pro 0827',
|
92
142
|
enabled: true,
|
93
|
-
functionCall:
|
94
|
-
id: '
|
95
|
-
|
96
|
-
|
143
|
+
functionCall: true,
|
144
|
+
id: 'google/gemini-pro-1.5-exp',
|
145
|
+
maxOutput: 8192,
|
146
|
+
pricing: {
|
147
|
+
cachedInput: 0.875,
|
148
|
+
input: 3.5,
|
149
|
+
output: 10.5,
|
150
|
+
},
|
151
|
+
releasedAt: '2024-08-27',
|
152
|
+
tokens: 2_097_152 + 8192,
|
153
|
+
vision: true,
|
97
154
|
},
|
98
155
|
{
|
99
|
-
description:
|
100
|
-
|
156
|
+
description:
|
157
|
+
'融合通用与代码能力的全新开源模型, 不仅保留了原有 Chat 模型的通用对话能力和 Coder 模型的强大代码处理能力,还更好地对齐了人类偏好。此外,DeepSeek-V2.5 在写作任务、指令跟随等多个方面也实现了大幅提升。',
|
158
|
+
displayName: 'DeepSeek-V2.5',
|
101
159
|
enabled: true,
|
102
|
-
functionCall:
|
103
|
-
id: '
|
104
|
-
|
105
|
-
|
160
|
+
functionCall: true,
|
161
|
+
id: 'deepseek/deepseek-chat',
|
162
|
+
pricing: {
|
163
|
+
cachedInput: 0.014,
|
164
|
+
input: 0.14,
|
165
|
+
output: 0.28,
|
166
|
+
},
|
167
|
+
releasedAt: '2024-09-05',
|
168
|
+
tokens: 128_000,
|
106
169
|
},
|
107
170
|
{
|
108
|
-
description: '
|
109
|
-
displayName: '
|
171
|
+
description: 'Qwen2 是全新的大型语言模型系列,具有更强的理解和生成能力。',
|
172
|
+
displayName: 'Qwen2 7B (Free)',
|
110
173
|
enabled: true,
|
111
|
-
|
112
|
-
|
113
|
-
tokens: 10_000,
|
114
|
-
vision: false,
|
174
|
+
id: 'qwen/qwen-2-7b-instruct:free',
|
175
|
+
tokens: 32_768,
|
115
176
|
},
|
116
177
|
{
|
117
|
-
description: '
|
118
|
-
displayName: '
|
178
|
+
description: 'LLaMA 3.1 提供多语言支持,是业界领先的生成模型之一。',
|
179
|
+
displayName: 'Llama 3.1 8B (Free)',
|
119
180
|
enabled: true,
|
120
|
-
|
121
|
-
|
122
|
-
tokens: 64_000,
|
123
|
-
vision: false,
|
181
|
+
id: 'meta-llama/llama-3.1-8b-instruct:free',
|
182
|
+
tokens: 32_768,
|
124
183
|
},
|
125
184
|
{
|
126
|
-
description: '
|
127
|
-
displayName: '
|
185
|
+
description: 'Gemma 2 是Google轻量化的开源文本模型系列。',
|
186
|
+
displayName: 'Gemma 2 9B (Free)',
|
128
187
|
enabled: true,
|
129
|
-
|
130
|
-
|
131
|
-
tokens: 65_536,
|
132
|
-
vision: false,
|
188
|
+
id: 'google/gemma-2-9b-it:free',
|
189
|
+
tokens: 8192,
|
133
190
|
},
|
134
191
|
],
|
135
|
-
checkModel: '
|
192
|
+
checkModel: 'google/gemma-2-9b-it:free',
|
136
193
|
description:
|
137
194
|
'OpenRouter 是一个提供多种前沿大模型接口的服务平台,支持 OpenAI、Anthropic、LLaMA 及更多,适合多样化的开发和应用需求。用户可根据自身需求灵活选择最优的模型和价格,助力AI体验的提升。',
|
138
195
|
id: 'openrouter',
|
@@ -12,6 +12,11 @@ const ZhiPu: ModelProviderCard = {
|
|
12
12
|
enabled: true,
|
13
13
|
functionCall: true,
|
14
14
|
id: 'glm-4-alltools',
|
15
|
+
pricing: {
|
16
|
+
currency: 'CNY',
|
17
|
+
input: 100,
|
18
|
+
output: 100,
|
19
|
+
},
|
15
20
|
tokens: 128_000,
|
16
21
|
},
|
17
22
|
{
|
@@ -21,14 +26,23 @@ const ZhiPu: ModelProviderCard = {
|
|
21
26
|
enabled: true,
|
22
27
|
functionCall: true,
|
23
28
|
id: 'glm-4-plus',
|
29
|
+
pricing: {
|
30
|
+
currency: 'CNY',
|
31
|
+
input: 50,
|
32
|
+
output: 50,
|
33
|
+
},
|
24
34
|
tokens: 128_000,
|
25
35
|
},
|
26
36
|
{
|
27
37
|
description: 'GLM-4-0520 是最新模型版本,专为高度复杂和多样化任务设计,表现卓越。',
|
28
38
|
displayName: 'GLM-4-0520',
|
29
|
-
enabled: true,
|
30
39
|
functionCall: true,
|
31
40
|
id: 'glm-4-0520',
|
41
|
+
pricing: {
|
42
|
+
currency: 'CNY',
|
43
|
+
input: 100,
|
44
|
+
output: 100,
|
45
|
+
},
|
32
46
|
tokens: 128_000,
|
33
47
|
},
|
34
48
|
{
|
@@ -36,29 +50,50 @@ const ZhiPu: ModelProviderCard = {
|
|
36
50
|
displayName: 'GLM-4',
|
37
51
|
functionCall: true,
|
38
52
|
id: 'glm-4',
|
53
|
+
pricing: {
|
54
|
+
currency: 'CNY',
|
55
|
+
input: 100,
|
56
|
+
output: 100,
|
57
|
+
},
|
39
58
|
tokens: 128_000,
|
40
59
|
},
|
60
|
+
{
|
61
|
+
description: 'GLM-4-AirX 提供 GLM-4-Air 的高效版本,推理速度可达其2.6倍。',
|
62
|
+
displayName: 'GLM-4-AirX',
|
63
|
+
enabled: true,
|
64
|
+
functionCall: true,
|
65
|
+
id: 'glm-4-airx',
|
66
|
+
pricing: {
|
67
|
+
currency: 'CNY',
|
68
|
+
input: 10,
|
69
|
+
output: 10,
|
70
|
+
},
|
71
|
+
tokens: 8192,
|
72
|
+
},
|
41
73
|
{
|
42
74
|
description: 'GLM-4-Air 是性价比高的版本,性能接近GLM-4,提供快速度和实惠的价格。',
|
43
75
|
displayName: 'GLM-4-Air',
|
44
76
|
enabled: true,
|
45
77
|
functionCall: true,
|
46
78
|
id: 'glm-4-air',
|
79
|
+
pricing: {
|
80
|
+
currency: 'CNY',
|
81
|
+
input: 1,
|
82
|
+
output: 1,
|
83
|
+
},
|
47
84
|
tokens: 128_000,
|
48
85
|
},
|
49
|
-
{
|
50
|
-
description: 'GLM-4-AirX 提供 GLM-4-Air 的高效版本,推理速度可达其2.6倍。',
|
51
|
-
displayName: 'GLM-4-AirX',
|
52
|
-
functionCall: true,
|
53
|
-
id: 'glm-4-airx',
|
54
|
-
tokens: 8192,
|
55
|
-
},
|
56
86
|
{
|
57
87
|
description: 'GLM-4-Long 支持超长文本输入,适合记忆型任务与大规模文档处理。',
|
58
88
|
displayName: 'GLM-4-Long',
|
59
89
|
enabled: true,
|
60
90
|
functionCall: true,
|
61
91
|
id: 'glm-4-long',
|
92
|
+
pricing: {
|
93
|
+
currency: 'CNY',
|
94
|
+
input: 1,
|
95
|
+
output: 1,
|
96
|
+
},
|
62
97
|
tokens: 1_024_000,
|
63
98
|
},
|
64
99
|
{
|
@@ -67,6 +102,11 @@ const ZhiPu: ModelProviderCard = {
|
|
67
102
|
enabled: true,
|
68
103
|
functionCall: true,
|
69
104
|
id: 'glm-4-flash',
|
105
|
+
pricing: {
|
106
|
+
currency: 'CNY',
|
107
|
+
input: 0,
|
108
|
+
output: 0,
|
109
|
+
},
|
70
110
|
tokens: 128_000,
|
71
111
|
},
|
72
112
|
{
|
@@ -74,14 +114,23 @@ const ZhiPu: ModelProviderCard = {
|
|
74
114
|
displayName: 'GLM-4V-Plus',
|
75
115
|
enabled: true,
|
76
116
|
id: 'glm-4v-plus',
|
117
|
+
pricing: {
|
118
|
+
currency: 'CNY',
|
119
|
+
input: 10,
|
120
|
+
output: 10,
|
121
|
+
},
|
77
122
|
tokens: 8192,
|
78
123
|
vision: true,
|
79
124
|
},
|
80
125
|
{
|
81
126
|
description: 'GLM-4V 提供强大的图像理解与推理能力,支持多种视觉任务。',
|
82
127
|
displayName: 'GLM-4V',
|
83
|
-
enabled: true,
|
84
128
|
id: 'glm-4v',
|
129
|
+
pricing: {
|
130
|
+
currency: 'CNY',
|
131
|
+
input: 50,
|
132
|
+
output: 50,
|
133
|
+
},
|
85
134
|
tokens: 2048,
|
86
135
|
vision: true,
|
87
136
|
},
|
@@ -89,19 +138,35 @@ const ZhiPu: ModelProviderCard = {
|
|
89
138
|
description:
|
90
139
|
'CodeGeeX-4 是强大的AI编程助手,支持多种编程语言的智能问答与代码补全,提升开发效率。',
|
91
140
|
displayName: 'CodeGeeX-4',
|
141
|
+
enabled: true,
|
92
142
|
id: 'codegeex-4',
|
143
|
+
pricing: {
|
144
|
+
currency: 'CNY',
|
145
|
+
input: 0.1,
|
146
|
+
output: 0.1,
|
147
|
+
},
|
93
148
|
tokens: 128_000,
|
94
149
|
},
|
95
150
|
{
|
96
151
|
description: 'CharGLM-3 专为角色扮演与情感陪伴设计,支持超长多轮记忆与个性化对话,应用广泛。',
|
97
152
|
displayName: 'CharGLM-3',
|
98
153
|
id: 'charglm-3',
|
154
|
+
pricing: {
|
155
|
+
currency: 'CNY',
|
156
|
+
input: 15,
|
157
|
+
output: 15,
|
158
|
+
},
|
99
159
|
tokens: 4096,
|
100
160
|
},
|
101
161
|
{
|
102
162
|
description: 'Emohaa 是心理模型,具备专业咨询能力,帮助用户理解情感问题。',
|
103
163
|
displayName: 'Emohaa',
|
104
164
|
id: 'emohaa',
|
165
|
+
pricing: {
|
166
|
+
currency: 'CNY',
|
167
|
+
input: 15,
|
168
|
+
output: 15,
|
169
|
+
},
|
105
170
|
tokens: 8192,
|
106
171
|
},
|
107
172
|
],
|
@@ -2,8 +2,14 @@ import { ChatStreamPayload, ModelProvider, OpenAIChatMessage } from '../types';
|
|
2
2
|
import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';
|
3
3
|
|
4
4
|
// TODO: 临时写法,后续要重构成 model card 展示配置
|
5
|
-
const o1Models = new Set([
|
6
|
-
|
5
|
+
export const o1Models = new Set([
|
6
|
+
'o1-preview',
|
7
|
+
'o1-preview-2024-09-12',
|
8
|
+
'o1-mini',
|
9
|
+
'o1-mini-2024-09-12',
|
10
|
+
]);
|
11
|
+
|
12
|
+
export const pruneO1Payload = (payload: ChatStreamPayload) => ({
|
7
13
|
...payload,
|
8
14
|
frequency_penalty: 0,
|
9
15
|
messages: payload.messages.map((message: OpenAIChatMessage) => ({
|
@@ -23,7 +29,7 @@ export const LobeOpenAI = LobeOpenAICompatibleFactory({
|
|
23
29
|
const { model } = payload;
|
24
30
|
|
25
31
|
if (o1Models.has(model)) {
|
26
|
-
return
|
32
|
+
return pruneO1Payload(payload) as any;
|
27
33
|
}
|
28
34
|
|
29
35
|
return { ...payload, stream: payload.stream ?? true };
|
@@ -131,27 +131,23 @@ exports[`configRouter > getGlobalConfig > Model Provider env > OPENROUTER_MODEL_
|
|
131
131
|
{
|
132
132
|
"enabled": false,
|
133
133
|
"enabledModels": [
|
134
|
-
"
|
135
|
-
"
|
134
|
+
"meta-llama/llama-3.1-8b-instruct:free",
|
135
|
+
"google/gemma-2-9b-it:free",
|
136
136
|
],
|
137
137
|
"serverModelCards": [
|
138
138
|
{
|
139
|
-
"description": "
|
140
|
-
"displayName": "
|
139
|
+
"description": "LLaMA 3.1 提供多语言支持,是业界领先的生成模型之一。",
|
140
|
+
"displayName": "Llama 3.1 8B (Free)",
|
141
141
|
"enabled": true,
|
142
|
-
"
|
143
|
-
"
|
144
|
-
"tokens": 8192,
|
145
|
-
"vision": false,
|
142
|
+
"id": "meta-llama/llama-3.1-8b-instruct:free",
|
143
|
+
"tokens": 32768,
|
146
144
|
},
|
147
145
|
{
|
148
|
-
"description": "
|
149
|
-
"displayName": "
|
146
|
+
"description": "Gemma 2 是Google轻量化的开源文本模型系列。",
|
147
|
+
"displayName": "Gemma 2 9B (Free)",
|
150
148
|
"enabled": true,
|
151
|
-
"
|
152
|
-
"
|
153
|
-
"tokens": 32768,
|
154
|
-
"vision": false,
|
149
|
+
"id": "google/gemma-2-9b-it:free",
|
150
|
+
"tokens": 8192,
|
155
151
|
},
|
156
152
|
],
|
157
153
|
}
|
@@ -132,7 +132,7 @@ describe('configRouter', () => {
|
|
132
132
|
describe('OPENROUTER_MODEL_LIST', () => {
|
133
133
|
it('custom deletion, addition, and renaming of models', async () => {
|
134
134
|
process.env.OPENROUTER_MODEL_LIST =
|
135
|
-
'-all,+
|
135
|
+
'-all,+meta-llama/llama-3.1-8b-instruct:free,+google/gemma-2-9b-it:free';
|
136
136
|
|
137
137
|
const response = await router.getGlobalConfig();
|
138
138
|
|