@lobehub/chat 1.36.5 → 1.36.7

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 1.36.7](https://github.com/lobehub/lobe-chat/compare/v1.36.6...v1.36.7)
6
+
7
+ <sup>Released on **2024-12-10**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix pricing with 0 digit.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix pricing with 0 digit, closes [#4964](https://github.com/lobehub/lobe-chat/issues/4964) ([c1061b4](https://github.com/lobehub/lobe-chat/commit/c1061b4))
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 1.36.6](https://github.com/lobehub/lobe-chat/compare/v1.36.5...v1.36.6)
31
+
32
+ <sup>Released on **2024-12-10**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Update groq, add llama3.3, Upgrade lobe-ui.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Update groq, add llama3.3, closes [#4942](https://github.com/lobehub/lobe-chat/issues/4942) ([68e4379](https://github.com/lobehub/lobe-chat/commit/68e4379))
46
+ - **misc**: Upgrade lobe-ui, closes [#4950](https://github.com/lobehub/lobe-chat/issues/4950) ([54ce087](https://github.com/lobehub/lobe-chat/commit/54ce087))
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 1.36.5](https://github.com/lobehub/lobe-chat/compare/v1.36.4...v1.36.5)
6
57
 
7
58
  <sup>Released on **2024-12-09**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,22 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Fix pricing with 0 digit."
6
+ ]
7
+ },
8
+ "date": "2024-12-10",
9
+ "version": "1.36.7"
10
+ },
11
+ {
12
+ "children": {
13
+ "improvements": [
14
+ "Update groq, add llama3.3, Upgrade lobe-ui."
15
+ ]
16
+ },
17
+ "date": "2024-12-10",
18
+ "version": "1.36.6"
19
+ },
2
20
  {
3
21
  "children": {
4
22
  "fixes": [
@@ -0,0 +1,120 @@
1
+ ---
2
+ title: Deploy LobeChat with database on Dokploy
3
+ description: >-
4
+ Learn how to deploy LobeChat with database on Dokploy with ease, including:
5
+ database, authentication and S3 storage service.
6
+ tags:
7
+ - Deploy LobeChat
8
+ - Vercel Deployment
9
+ - OpenAI API Key
10
+ - Custom Domain Binding
11
+ ---
12
+
13
+ # Deploying Server Database Version on Dokploy.
14
+ This article will detail how to deploy the server database version of LobeChat.
15
+ ## 1. Preparation Work
16
+ ### Deploy Dokploy and configure related settings.
17
+ ```shell
18
+ curl -sSL https://dokploy.com/install.sh | sh
19
+ ```
20
+ 1. Connect your GitHub to Dokploy in the Settings / Git section according to the prompt.
21
+
22
+ ![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996)
23
+
24
+ 2. Enter the Projects interface to create a Project.
25
+
26
+ ![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e)
27
+
28
+ ### Configure S3 Storage Service
29
+ In the server-side database, we need to configure the S3 storage service to store files. For detailed configuration instructions, please refer to the section [Configure S3 Storage Service](https://lobehub.com/docs/self-hosting/server-database/vercel#3-configure-s-3-storage-service) in the Vercel deployment guide。After the configuration is complete, you will obtain the following environment variables:
30
+ ```shell
31
+ S3_ACCESS_KEY_ID=
32
+ S3_SECRET_ACCESS_KEY=
33
+ S3_ENDPOINT=
34
+ S3_BUCKET=
35
+ S3_PUBLIC_DOMAIN=
36
+ S3_ENABLE_PATH_STYLE=
37
+ ```
38
+ ### Configure the Clerk authentication service.
39
+ Obtain the three environment variables: `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`, `CLERK_SECRET_KEY`, and `CLERK_WEBHOOK_SECRET`. For detailed configuration steps for Clerk, please refer to the section [Configure Authentication Service](https://lobehub.com/docs/self-hosting/server-database/vercel#2-configure-authentication-service) in the Vercel deployment guide.
40
+ ```shell
41
+ NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
42
+ CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
43
+ CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
44
+ ```
45
+ ## 2. Deploying the database on Dokploy
46
+ Enter the previously created Project, click on Create Service, and select Database. In the Database interface, choose PostgreSQL, then set the database name, user, and password. In the Docker image field, enter `pgvector/pgvector:pg17`, and finally click Create to create the database.
47
+
48
+ ![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f)
49
+
50
+ Enter the created database and set an unused port in External Credentials to allow external access; otherwise, LobeChat will not be able to connect to the database.
51
+ You can view the Postgres database connection URL in External Host, as shown below:
52
+ ```shell
53
+ postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres
54
+ ```
55
+ Finally, click Deploy to deploy the database.
56
+
57
+ ![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e)
58
+
59
+ ## Deploy LobeChat on Dokploy.
60
+ Click "Create Service", select "Application", and create the LobeChat application.
61
+
62
+ ![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c)
63
+
64
+ Enter the created LobeChat application, select the forked lobe-chat project and branch, and click Save to save.
65
+
66
+ ![](https://github.com/user-attachments/assets/2bb4c09d-75bb-4c46-bb2f-faf538308305)
67
+
68
+ Switch to the Environment section, fill in the environment variables, and click Save.
69
+
70
+ ![](https://github.com/user-attachments/assets/0f79c266-cce5-4936-aabd-4c8f19196d91)
71
+
72
+ ```shell
73
+ # Environment variables required for building
74
+ NIXPACKS_PKGS="pnpm bun"
75
+ NIXPACKS_INSTALL_CMD="pnpm install"
76
+ NIXPACKS_BUILD_CMD="pnpm run build"
77
+ NIXPACKS_START_CMD="pnpm start"
78
+
79
+ APP_URL=
80
+
81
+ # Set the service mode to server
82
+ NEXT_PUBLIC_SERVICE_MODE=server
83
+
84
+ # Configuration related to Postgres database
85
+ DATABASE_DRIVER=node
86
+ DATABASE_URL=
87
+
88
+ # You can use openssl rand -base64 32 to generate a random 32-character string as a key.
89
+ KEY_VAULTS_SECRET=
90
+
91
+ # Clerk related configuration
92
+ NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
93
+ CLERK_SECRET_KEY=
94
+ CLERK_WEBHOOK_SECRET=
95
+
96
+ # S3 related configuration
97
+ S3_ACCESS_KEY_ID=
98
+ S3_SECRET_ACCESS_KEY=
99
+ S3_ENDPOINT=
100
+ S3_BUCKET=
101
+ S3_PUBLIC_DOMAIN=
102
+ S3_ENABLE_PATH_STYLE=
103
+
104
+ # OpenAI related configuration
105
+ OPENAI_API_KEY=
106
+ OPENAI_MODEL_LIST=
107
+ OPENAI_PROXY_URL=
108
+ ```
109
+ After adding the environment variables and saving, click Deploy to initiate the deployment. You can check the deployment progress and log information under Deployments.
110
+
111
+ ![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec)
112
+
113
+ After a successful deployment, bind your own domain to your LobeChat application and request a certificate on the Domains page.
114
+
115
+ ![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7)
116
+
117
+ ## Check if LobeChat is working properly.
118
+ Go to your LobeChat website, and if you click on the login button in the upper left corner and the login pop-up appears normally, it means you have configured it successfully. Enjoy it to the fullest!
119
+
120
+ ![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26)
@@ -0,0 +1,122 @@
1
+ ---
2
+ title: 在 Dokploy 上部署 LobeChat 的服务端数据库版本
3
+ description: 本文详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat,包括数据库配置、身份验证服务配置的设置步骤。
4
+ tags:
5
+ - 服务端数据库
6
+ - Postgres
7
+ - Clerk
8
+ - Dokploy部署
9
+ - 数据库配置
10
+ - 身份验证服务
11
+ - 环境变量配置
12
+ ---
13
+
14
+ # 在 Dokploy 上部署服务端数据库版
15
+ 本文将详细介绍如何在 Dokploy 中部署服务端数据库版 LobeChat。
16
+ ## 一、准备工作
17
+ ### 部署 Dokploy 并进行相关设置
18
+ ```shell
19
+ curl -sSL https://dokploy.com/install.sh | sh
20
+ ```
21
+ 1. 在 Dokploy 的 Settings / Git 处根据提示将 Github 绑定到 Dokploy
22
+
23
+ ![](https://github.com/user-attachments/assets/c75eb19e-e0f5-4135-91e4-55be8be8a996)
24
+
25
+ 2. 进入 Projects 界面创建一个 Project
26
+
27
+ ![](https://github.com/user-attachments/assets/4e04928d-0171-48d1-afff-e22fc2faaf4e)
28
+
29
+ ### 配置 S3 存储服务
30
+ 在服务端数据库中我们需要配置 S3 存储服务来存储文件,详细配置教程请参考 使用 Vercel 部署中 [配置S3储存服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#%E4%B8%89%E3%80%81-%E9%85%8D%E7%BD%AE-s-3-%E5%AD%98%E5%82%A8%E6%9C%8D%E5%8A%A1)。配置完成后你将获得以下环境变量:
31
+ ```shell
32
+ S3_ACCESS_KEY_ID=
33
+ S3_SECRET_ACCESS_KEY=
34
+ S3_ENDPOINT=
35
+ S3_BUCKET=
36
+ S3_PUBLIC_DOMAIN=
37
+ S3_ENABLE_PATH_STYLE=
38
+ ```
39
+ ### 配置 Clerk 身份验证服务
40
+ 获取 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 、`CLERK_SECRET_KEY` 、`CLERK_WEBHOOK_SECRET` 这三个环境变量,Clerk的详细配置流程请参考 使用 Vercel 部署中 [配置身份验证服务](https://lobehub.com/zh/docs/self-hosting/server-database/vercel#二、-配置身份验证服务)
41
+ ```shell
42
+ NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_xxxxxxxxxxx
43
+ CLERK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxxxx
44
+ CLERK_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxx
45
+ ```
46
+ ## 二、在 Dokploy 上部署数据库
47
+ 进入前面创建的Project,点击 Create Service 选择 Database,在 Database 界面选择 PostgreSQL ,然后设置数据库名、用户、密码,在 Docker image 中填入 `pgvector/pgvector:pg17` 最后点击 Create 创建数据库。
48
+
49
+ ![](https://github.com/user-attachments/assets/97899819-278f-42fd-804a-144d521d4b4f)
50
+
51
+ 进入创建的数据库,在 External Credentials 设置一个未被占用的端口,使其能能通过外部访问,否则 LobeChat 将无法连接到该数据库。
52
+ 你可以在 External Host 查看 Postgres 数据库连接 URL ,如下:
53
+ ```shell
54
+ postgresql://postgres:wAbLxfXSwkxxxxxx@45.577.281.48:5432/postgres
55
+ ```
56
+ 最后点击 Deploy 部署数据库
57
+
58
+ ![](https://github.com/user-attachments/assets/b4e89dd4-877b-43fe-aa42-4680de17ba8e)
59
+
60
+ ## 在 Dokploy 上部署 LobeChat
61
+ 点击 Create Service 选择 Application,创建 LobeChat 应用
62
+
63
+ ![](https://github.com/user-attachments/assets/4cbbbcce-36be-48ff-bb0b-31607a0bba5c)
64
+
65
+ 进入创建的 LobeChat 应用,选择你 fork 的 lobe-chat 项目及分支,点击 Save 保存
66
+
67
+ ![](https://github.com/user-attachments/assets/2bb4c09d-75bb-4c46-bb2f-faf538308305)
68
+
69
+ 切换到 Environment ,在其中填入环境变量,点击保存。
70
+
71
+ ![](https://github.com/user-attachments/assets/0f79c266-cce5-4936-aabd-4c8f19196d91)
72
+
73
+ ```shell
74
+ # 构建所必需的环境变量
75
+ NIXPACKS_PKGS="pnpm bun"
76
+ NIXPACKS_INSTALL_CMD="pnpm install"
77
+ NIXPACKS_BUILD_CMD="pnpm run build"
78
+ NIXPACKS_START_CMD="pnpm start"
79
+
80
+ APP_URL=
81
+
82
+ # 指定服务模式为 server
83
+ NEXT_PUBLIC_SERVICE_MODE=server
84
+
85
+ # Postgres 数据库相关配置
86
+ DATABASE_DRIVER=node
87
+ DATABASE_URL=
88
+
89
+ # 你可以使用 openssl rand -base64 32 生成一个随机的 32 位字符串作为密钥。
90
+ KEY_VAULTS_SECRET=
91
+
92
+ # Clerk 相关配置
93
+ NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
94
+ CLERK_SECRET_KEY=
95
+ CLERK_WEBHOOK_SECRET=
96
+
97
+ # S3 相关配置
98
+ S3_ACCESS_KEY_ID=
99
+ S3_SECRET_ACCESS_KEY=
100
+ S3_ENDPOINT=
101
+ S3_BUCKET=
102
+ S3_PUBLIC_DOMAIN=
103
+ S3_ENABLE_PATH_STYLE=
104
+
105
+ # OpenAI 相关配置
106
+ OPENAI_API_KEY=
107
+ OPENAI_MODEL_LIST=
108
+ OPENAI_PROXY_URL=
109
+ ```
110
+ 添加完环境变量并保存后,点击 Deploy 进行部署,你可以在 Deployments 处查看部署进程及日志信息
111
+
112
+ ![](https://github.com/user-attachments/assets/411e2002-61f0-4010-9841-18e88ca895ec)
113
+
114
+ 部署成功后在 Domains 页面,为你的 LobeChat 应用绑定自己的域名并申请证书。
115
+
116
+ ![](https://github.com/user-attachments/assets/dd6bc4a4-3c20-4162-87fd-5cac57e5d7e7)
117
+
118
+ ## 验证 LobeChat 是否正常工作
119
+ 进入你的 LobeChat 网址,如果你点击左上角登录,可以正常显示登录弹窗,那么说明你已经配置成功了,尽情享用吧~
120
+
121
+ ![](https://github.com/user-attachments/assets/798ddb18-50c7-462a-a083-0c6841351d26)
122
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.36.5",
3
+ "version": "1.36.7",
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",
@@ -124,9 +124,9 @@
124
124
  "@langchain/community": "^0.3.0",
125
125
  "@lobehub/chat-plugin-sdk": "^1.32.4",
126
126
  "@lobehub/chat-plugins-gateway": "^1.9.0",
127
- "@lobehub/icons": "^1.38.1",
127
+ "@lobehub/icons": "^1.56.0",
128
128
  "@lobehub/tts": "^1.25.1",
129
- "@lobehub/ui": "^1.152.0",
129
+ "@lobehub/ui": "^1.153.13",
130
130
  "@neondatabase/serverless": "^0.10.1",
131
131
  "@next/third-parties": "^14.2.15",
132
132
  "@react-spring/web": "^9.7.5",
@@ -194,7 +194,6 @@
194
194
  "pwa-install-handler": "^2.6.1",
195
195
  "query-string": "^9.1.1",
196
196
  "random-words": "^2.0.1",
197
- "re-resizable": "6.10.1",
198
197
  "react": "^18.3.1",
199
198
  "react-confetti": "^6.1.0",
200
199
  "react-dom": "^18.3.1",
@@ -4,8 +4,10 @@ import dynamic from 'next/dynamic';
4
4
  import { memo } from 'react';
5
5
  import { Center } from 'react-layout-kit';
6
6
 
7
- const LogoThree = dynamic(() => import('@lobehub/ui/es/LogoThree'), { ssr: false });
8
- const LogoSpline = dynamic(() => import('@lobehub/ui/es/LogoThree/LogoSpline'), { ssr: false });
7
+ const LogoThree = dynamic(() => import('@lobehub/ui/es/brand/LogoThree'), { ssr: false });
8
+ const LogoSpline = dynamic(() => import('@lobehub/ui/es/brand/LogoThree/LogoSpline'), {
9
+ ssr: false,
10
+ });
9
11
 
10
12
  const WelcomeLogo = memo<{ mobile?: boolean }>(({ mobile }) => {
11
13
  return mobile ? (
@@ -4,6 +4,20 @@ import { ModelProviderCard } from '@/types/llm';
4
4
  const Groq: ModelProviderCard = {
5
5
  chatModels: [
6
6
  // TODO: During preview launch, Groq is limiting 3.2 models to max_tokens of 8k.
7
+ {
8
+ description:
9
+ 'Meta Llama 3.3 多语言大语言模型 ( LLM ) 是 70B(文本输入/文本输出)中的预训练和指令调整生成模型。 Llama 3.3 指令调整的纯文本模型针对多语言对话用例进行了优化,并且在常见行业基准上优于许多可用的开源和封闭式聊天模型。',
10
+ displayName: 'Llama 3.3 70B',
11
+ enabled: true,
12
+ functionCall: true,
13
+ id: 'llama-3.3-70b-versatile',
14
+ maxOutput: 8192,
15
+ pricing: {
16
+ input: 0.05,
17
+ output: 0.08,
18
+ },
19
+ tokens: 131_072,
20
+ },
7
21
  {
8
22
  description:
9
23
  'Llama 3.2 旨在处理结合视觉和文本数据的任务。它在图像描述和视觉问答等任务中表现出色,跨越了语言生成和视觉推理之间的鸿沟。',
@@ -159,6 +173,7 @@ const Groq: ModelProviderCard = {
159
173
  description:
160
174
  'Groq 的 LPU 推理引擎在最新的独立大语言模型(LLM)基准测试中表现卓越,以其惊人的速度和效率重新定义了 AI 解决方案的标准。Groq 是一种即时推理速度的代表,在基于云的部署中展现了良好的性能。',
161
175
  id: 'groq',
176
+ modelList: { showModelFetcher: true },
162
177
  modelsUrl: 'https://console.groq.com/docs/models',
163
178
  name: 'Groq',
164
179
  proxyUrl: {
@@ -1,5 +1,5 @@
1
1
  import { ActionIconGroup } from '@lobehub/ui';
2
- import { ActionsBarProps } from '@lobehub/ui/es/ChatList/ActionsBar';
2
+ import { ActionsBarProps } from '@lobehub/ui/es/chat/ChatList/ActionsBar';
3
3
  import { memo } from 'react';
4
4
 
5
5
  import { useChatListActionsBar } from '../hooks/useChatListActionsBar';
@@ -177,6 +177,13 @@ describe('format', () => {
177
177
  expect(formatPrice(0.99)).toBe('0.99');
178
178
  expect(formatPrice(1000000.01)).toBe('1,000,000.01');
179
179
  });
180
+
181
+ it('should format prices with digits correctly', () => {
182
+ expect(formatPrice(1000, 1)).toBe('1,000.0');
183
+ expect(formatPrice(1234.56)).toBe('1,234.56');
184
+ expect(formatPrice(0.99)).toBe('0.99');
185
+ expect(formatPrice(1000000.01, 0)).toBe('1,000,000');
186
+ });
180
187
  });
181
188
 
182
189
  describe('formatPriceByCurrency', () => {
@@ -110,6 +110,8 @@ export const formatTokenNumber = (num: number): string => {
110
110
  export const formatPrice = (price: number, fractionDigits: number = 2) => {
111
111
  if (!price && price !== 0) return '--';
112
112
 
113
+ if (fractionDigits === 0) return numeral(price).format('0,0');
114
+
113
115
  const [a, b] = price.toFixed(fractionDigits).split('.');
114
116
  return `${numeral(a).format('0,0')}.${b}`;
115
117
  };