@lobehub/chat 1.115.0 → 1.116.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/.cursor/rules/add-provider-doc.mdc +183 -0
- package/.env.example +8 -0
- package/.github/workflows/release.yml +3 -3
- package/.github/workflows/test.yml +3 -7
- package/CHANGELOG.md +25 -0
- package/CLAUDE.md +6 -6
- package/Dockerfile +5 -1
- package/Dockerfile.database +5 -1
- package/Dockerfile.pglite +5 -1
- package/changelog/v1.json +9 -0
- package/docs/development/basic/setup-development.mdx +10 -13
- package/docs/development/basic/setup-development.zh-CN.mdx +9 -12
- package/docs/self-hosting/environment-variables/model-provider.mdx +27 -2
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +27 -2
- package/docs/usage/providers/bfl.mdx +68 -0
- package/docs/usage/providers/bfl.zh-CN.mdx +67 -0
- package/locales/ar/components.json +11 -0
- package/locales/ar/error.json +11 -0
- package/locales/ar/models.json +64 -4
- package/locales/ar/providers.json +3 -0
- package/locales/bg-BG/components.json +11 -0
- package/locales/bg-BG/error.json +11 -0
- package/locales/bg-BG/models.json +64 -4
- package/locales/bg-BG/providers.json +3 -0
- package/locales/de-DE/components.json +11 -0
- package/locales/de-DE/error.json +11 -12
- package/locales/de-DE/models.json +64 -4
- package/locales/de-DE/providers.json +3 -0
- package/locales/en-US/components.json +6 -0
- package/locales/en-US/error.json +11 -12
- package/locales/en-US/models.json +64 -4
- package/locales/en-US/providers.json +3 -0
- package/locales/es-ES/components.json +11 -0
- package/locales/es-ES/error.json +11 -0
- package/locales/es-ES/models.json +64 -6
- package/locales/es-ES/providers.json +3 -0
- package/locales/fa-IR/components.json +11 -0
- package/locales/fa-IR/error.json +11 -0
- package/locales/fa-IR/models.json +64 -4
- package/locales/fa-IR/providers.json +3 -0
- package/locales/fr-FR/components.json +11 -0
- package/locales/fr-FR/error.json +11 -12
- package/locales/fr-FR/models.json +64 -4
- package/locales/fr-FR/providers.json +3 -0
- package/locales/it-IT/components.json +11 -0
- package/locales/it-IT/error.json +11 -0
- package/locales/it-IT/models.json +64 -4
- package/locales/it-IT/providers.json +3 -0
- package/locales/ja-JP/components.json +11 -0
- package/locales/ja-JP/error.json +11 -12
- package/locales/ja-JP/models.json +64 -4
- package/locales/ja-JP/providers.json +3 -0
- package/locales/ko-KR/components.json +11 -0
- package/locales/ko-KR/error.json +11 -12
- package/locales/ko-KR/models.json +64 -6
- package/locales/ko-KR/providers.json +3 -0
- package/locales/nl-NL/components.json +11 -0
- package/locales/nl-NL/error.json +11 -0
- package/locales/nl-NL/models.json +62 -4
- package/locales/nl-NL/providers.json +3 -0
- package/locales/pl-PL/components.json +11 -0
- package/locales/pl-PL/error.json +11 -0
- package/locales/pl-PL/models.json +64 -4
- package/locales/pl-PL/providers.json +3 -0
- package/locales/pt-BR/components.json +11 -0
- package/locales/pt-BR/error.json +11 -0
- package/locales/pt-BR/models.json +64 -4
- package/locales/pt-BR/providers.json +3 -0
- package/locales/ru-RU/components.json +11 -0
- package/locales/ru-RU/error.json +11 -0
- package/locales/ru-RU/models.json +64 -4
- package/locales/ru-RU/providers.json +3 -0
- package/locales/tr-TR/components.json +11 -0
- package/locales/tr-TR/error.json +11 -0
- package/locales/tr-TR/models.json +64 -4
- package/locales/tr-TR/providers.json +3 -0
- package/locales/vi-VN/components.json +11 -0
- package/locales/vi-VN/error.json +11 -0
- package/locales/vi-VN/models.json +64 -4
- package/locales/vi-VN/providers.json +3 -0
- package/locales/zh-CN/components.json +6 -0
- package/locales/zh-CN/error.json +11 -0
- package/locales/zh-CN/models.json +64 -4
- package/locales/zh-CN/providers.json +3 -0
- package/locales/zh-TW/components.json +11 -0
- package/locales/zh-TW/error.json +11 -12
- package/locales/zh-TW/models.json +64 -6
- package/locales/zh-TW/providers.json +3 -0
- package/package.json +1 -1
- package/packages/model-runtime/src/google/index.ts +3 -0
- package/packages/model-runtime/src/qwen/createImage.test.ts +0 -19
- package/packages/model-runtime/src/qwen/createImage.ts +1 -27
- package/packages/model-runtime/src/utils/streams/google-ai.ts +26 -14
- package/packages/types/src/aiModel.ts +2 -1
- package/src/config/aiModels/google.ts +22 -1
- package/src/config/aiModels/qwen.ts +2 -2
- package/src/config/aiModels/vertexai.ts +22 -0
- package/.cursor/rules/debug.mdc +0 -193
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Complete guide for adding a new AI provider documentation to LobeChat
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Adding New AI Provider Documentation
|
|
7
|
+
|
|
8
|
+
This document provides a step-by-step guide for adding documentation for a new AI provider to LobeChat, based on the complete workflow used for adding providers like BFL (Black Forest Labs) and FAL.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Adding a new provider requires creating both user-facing documentation and technical configuration files. The process involves:
|
|
13
|
+
|
|
14
|
+
1. Creating usage documentation (EN + CN)
|
|
15
|
+
2. Adding environment variable documentation (EN + CN)
|
|
16
|
+
3. Updating Docker configuration files
|
|
17
|
+
4. Updating .env.example file
|
|
18
|
+
5. Preparing image resources
|
|
19
|
+
|
|
20
|
+
## Step 1: Create Provider Usage Documentation
|
|
21
|
+
|
|
22
|
+
Create user-facing documentation that explains how to use the new provider.
|
|
23
|
+
|
|
24
|
+
### Required Files
|
|
25
|
+
|
|
26
|
+
Create both English and Chinese versions:
|
|
27
|
+
- `docs/usage/providers/{provider-name}.mdx` (English)
|
|
28
|
+
- `docs/usage/providers/{provider-name}.zh-CN.mdx` (Chinese)
|
|
29
|
+
|
|
30
|
+
### Documentation Structure
|
|
31
|
+
|
|
32
|
+
Follow the structure and format used in existing provider documentation. For reference, see:
|
|
33
|
+
- `docs/usage/providers/fal.mdx` (English template)
|
|
34
|
+
- `docs/usage/providers/fal.zh-CN.mdx` (Chinese template)
|
|
35
|
+
|
|
36
|
+
### Key Requirements
|
|
37
|
+
|
|
38
|
+
- **Images**: Prepare 5-6 screenshots showing the process
|
|
39
|
+
- **Cover Image**: Create or obtain a cover image for the provider
|
|
40
|
+
- **Accurate URLs**: Use real registration and dashboard URLs
|
|
41
|
+
- **Service Type**: Specify whether it's for image generation, text generation, etc.
|
|
42
|
+
- **Pricing Warning**: Include pricing information callout
|
|
43
|
+
|
|
44
|
+
### Important Notes
|
|
45
|
+
|
|
46
|
+
- **🔒 API Key Security**: Never include real API keys in documentation. Always use placeholder format (e.g., `bfl-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`)
|
|
47
|
+
- **🖼️ Image Hosting**: Use LobeHub's CDN for all images: `hub-apac-1.lobeobjects.space`
|
|
48
|
+
|
|
49
|
+
## Step 2: Update Environment Variables Documentation
|
|
50
|
+
|
|
51
|
+
Add the new provider's environment variables to the self-hosting documentation.
|
|
52
|
+
|
|
53
|
+
### Files to Update
|
|
54
|
+
|
|
55
|
+
- `docs/self-hosting/environment-variables/model-provider.mdx` (English)
|
|
56
|
+
- `docs/self-hosting/environment-variables/model-provider.zh-CN.mdx` (Chinese)
|
|
57
|
+
|
|
58
|
+
### Content to Add
|
|
59
|
+
|
|
60
|
+
Add two sections for each provider:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
### `{PROVIDER}_API_KEY`
|
|
64
|
+
|
|
65
|
+
- Type: Required
|
|
66
|
+
- Description: This is the API key you applied for in the {Provider Name} service.
|
|
67
|
+
- Default: -
|
|
68
|
+
- Example: `{api-key-format-example}`
|
|
69
|
+
|
|
70
|
+
### `{PROVIDER}_MODEL_LIST`
|
|
71
|
+
|
|
72
|
+
- Type: Optional
|
|
73
|
+
- Description: Used to control the {Provider Name} model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model. Separate multiple entries with commas. The definition syntax follows the same rules as other providers' model lists.
|
|
74
|
+
- Default: `-`
|
|
75
|
+
- Example: `-all,+{model-id-1},+{model-id-2}={display-name}`
|
|
76
|
+
|
|
77
|
+
The above example disables all models first, then enables `{model-id-1}` and `{model-id-2}` (displayed as `{display-name}`).
|
|
78
|
+
|
|
79
|
+
[model-list]: /docs/self-hosting/advanced/model-list
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Important Notes
|
|
83
|
+
|
|
84
|
+
- **API Key Format**: Use proper UUID format for examples (e.g., `12345678-1234-1234-1234-123456789abc`)
|
|
85
|
+
- **Real Model IDs**: Use actual model IDs from the codebase, not placeholders
|
|
86
|
+
- **Consistent Naming**: Follow the pattern `{PROVIDER}_API_KEY` and `{PROVIDER}_MODEL_LIST`
|
|
87
|
+
|
|
88
|
+
## Step 3: Update Docker Configuration Files
|
|
89
|
+
|
|
90
|
+
Add environment variables to all Docker configuration files to ensure the provider works in containerized deployments.
|
|
91
|
+
|
|
92
|
+
### Files to Update
|
|
93
|
+
|
|
94
|
+
All Dockerfile variants must be updated:
|
|
95
|
+
- `Dockerfile`
|
|
96
|
+
- `Dockerfile.database`
|
|
97
|
+
- `Dockerfile.pglite`
|
|
98
|
+
|
|
99
|
+
### Changes Required
|
|
100
|
+
|
|
101
|
+
Add the new provider's environment variables at the **end** of the ENV section, just before the final line:
|
|
102
|
+
|
|
103
|
+
```dockerfile
|
|
104
|
+
# Previous providers...
|
|
105
|
+
# 302.AI
|
|
106
|
+
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
107
|
+
# {New Provider 1}
|
|
108
|
+
{PROVIDER1}_API_KEY="" {PROVIDER1}_MODEL_LIST="" \
|
|
109
|
+
# {New Provider 2}
|
|
110
|
+
{PROVIDER2}_API_KEY="" {PROVIDER2}_MODEL_LIST=""
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Important Rules
|
|
114
|
+
|
|
115
|
+
- **Position**: Add new providers at the **end** of the list
|
|
116
|
+
- **Ordering**: When adding multiple providers, use alphabetical order (e.g., FAL before BFL)
|
|
117
|
+
- **Consistency**: Maintain identical ordering across all Dockerfile variants
|
|
118
|
+
- **Format**: Follow the pattern `{PROVIDER}_API_KEY="" {PROVIDER}_MODEL_LIST="" \`
|
|
119
|
+
|
|
120
|
+
## Step 4: Update .env.example File
|
|
121
|
+
|
|
122
|
+
Add example configuration entries to help users understand how to configure the provider locally.
|
|
123
|
+
|
|
124
|
+
### File to Update
|
|
125
|
+
|
|
126
|
+
- `.env.example`
|
|
127
|
+
|
|
128
|
+
### Content to Add
|
|
129
|
+
|
|
130
|
+
Add new sections before the "Market Service" section:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
### {Provider Name} ###
|
|
134
|
+
|
|
135
|
+
# {PROVIDER}_API_KEY={provider-prefix}-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Format Guidelines
|
|
139
|
+
|
|
140
|
+
- **Section Header**: Use `### {Provider Name} ###` format
|
|
141
|
+
- **Commented Example**: Use `#` to comment out the example
|
|
142
|
+
- **Key Format**: Use appropriate prefix for the provider (e.g., `bfl-`, `fal-`, `sk-`)
|
|
143
|
+
- **Position**: Add before the Market Service section
|
|
144
|
+
- **Spacing**: Maintain consistent spacing with existing entries
|
|
145
|
+
|
|
146
|
+
## Step 5: Image Resources
|
|
147
|
+
|
|
148
|
+
Prepare all necessary image resources for the documentation.
|
|
149
|
+
|
|
150
|
+
### Required Images
|
|
151
|
+
|
|
152
|
+
1. **Cover Image**: Provider logo or branded image
|
|
153
|
+
2. **API Dashboard Screenshots**: 3-4 screenshots showing API key creation process
|
|
154
|
+
3. **LobeChat Configuration Screenshots**: 2-3 screenshots showing provider setup in LobeChat
|
|
155
|
+
|
|
156
|
+
### Image Guidelines
|
|
157
|
+
|
|
158
|
+
- **Quality**: Use high-resolution screenshots
|
|
159
|
+
- **Consistency**: Maintain consistent styling across all screenshots
|
|
160
|
+
- **Privacy**: Remove or blur any sensitive information
|
|
161
|
+
- **Format**: Use PNG format for screenshots
|
|
162
|
+
- **Hosting**: Use LobeHub's CDN (`hub-apac-1.lobeobjects.space`) for all images
|
|
163
|
+
|
|
164
|
+
## Checklist
|
|
165
|
+
|
|
166
|
+
Before submitting your provider documentation:
|
|
167
|
+
|
|
168
|
+
- [ ] Created both English and Chinese usage documentation
|
|
169
|
+
- [ ] Added environment variable documentation (EN + CN)
|
|
170
|
+
- [ ] Updated all 3 Dockerfile variants with consistent ordering
|
|
171
|
+
- [ ] Updated .env.example with proper key format
|
|
172
|
+
- [ ] Prepared all required screenshots and images
|
|
173
|
+
- [ ] Used actual model IDs from the codebase
|
|
174
|
+
- [ ] Verified no real API keys are included in documentation
|
|
175
|
+
- [ ] Used LobeHub CDN for all image hosting
|
|
176
|
+
- [ ] Tested the documentation for clarity and accuracy
|
|
177
|
+
|
|
178
|
+
## Reference
|
|
179
|
+
|
|
180
|
+
This guide was created based on the implementation of BFL (Black Forest Labs) provider documentation. For a complete example, refer to:
|
|
181
|
+
- Commits: `d2da03e1a` (documentation) and `6a2e95868` (environment variables)
|
|
182
|
+
- Files: `docs/usage/providers/bfl.mdx`, `docs/usage/providers/bfl.zh-CN.mdx`
|
|
183
|
+
- PR: Current branch `tj/feat/bfl-docs`
|
package/.env.example
CHANGED
|
@@ -153,6 +153,14 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
|
|
153
153
|
|
|
154
154
|
# AIHUBMIX_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
155
155
|
|
|
156
|
+
### BFL ###
|
|
157
|
+
|
|
158
|
+
# BFL_API_KEY=bfl-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
159
|
+
|
|
160
|
+
### FAL ###
|
|
161
|
+
|
|
162
|
+
# FAL_API_KEY=fal-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
163
|
+
|
|
156
164
|
|
|
157
165
|
########################################
|
|
158
166
|
############ Market Service ############
|
|
@@ -16,6 +16,8 @@ jobs:
|
|
|
16
16
|
POSTGRES_PASSWORD: postgres
|
|
17
17
|
options: >-
|
|
18
18
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
19
|
+
|
|
20
|
+
|
|
19
21
|
ports:
|
|
20
22
|
- 5432:5432
|
|
21
23
|
|
|
@@ -38,10 +40,8 @@ jobs:
|
|
|
38
40
|
- name: Lint
|
|
39
41
|
run: bun run lint
|
|
40
42
|
|
|
41
|
-
- uses: pnpm/action-setup@v4
|
|
42
|
-
|
|
43
43
|
- name: Test Database Coverage
|
|
44
|
-
run:
|
|
44
|
+
run: bun run --filter @lobechat/database test
|
|
45
45
|
env:
|
|
46
46
|
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
|
47
47
|
DATABASE_DRIVER: node
|
|
@@ -23,8 +23,6 @@ jobs:
|
|
|
23
23
|
with:
|
|
24
24
|
node-version: 22
|
|
25
25
|
|
|
26
|
-
- uses: pnpm/action-setup@v4
|
|
27
|
-
|
|
28
26
|
- name: Install bun
|
|
29
27
|
uses: oven-sh/setup-bun@v1
|
|
30
28
|
with:
|
|
@@ -34,7 +32,7 @@ jobs:
|
|
|
34
32
|
run: bun i
|
|
35
33
|
|
|
36
34
|
- name: Test ${{ matrix.package }} package with coverage
|
|
37
|
-
run:
|
|
35
|
+
run: bun run --filter @lobechat/${{ matrix.package }} test:coverage
|
|
38
36
|
|
|
39
37
|
- name: Upload ${{ matrix.package }} coverage to Codecov
|
|
40
38
|
uses: codecov/codecov-action@v4
|
|
@@ -111,17 +109,15 @@ jobs:
|
|
|
111
109
|
- name: Lint
|
|
112
110
|
run: bun run lint
|
|
113
111
|
|
|
114
|
-
- uses: pnpm/action-setup@v4
|
|
115
|
-
|
|
116
112
|
- name: Test Client DB
|
|
117
|
-
run:
|
|
113
|
+
run: bun run --filter @lobechat/database test:client-db
|
|
118
114
|
env:
|
|
119
115
|
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
|
|
120
116
|
S3_PUBLIC_DOMAIN: https://example.com
|
|
121
117
|
APP_URL: https://home.com
|
|
122
118
|
|
|
123
119
|
- name: Test Coverage
|
|
124
|
-
run:
|
|
120
|
+
run: bun run --filter @lobechat/database test:coverage
|
|
125
121
|
env:
|
|
126
122
|
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
|
127
123
|
DATABASE_DRIVER: node
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 1.116.0](https://github.com/lobehub/lobe-chat/compare/v1.115.0...v1.116.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2025-08-27**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **misc**: Add gemini 2.5 flash image for vertex ai.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **misc**: Add gemini 2.5 flash image for vertex ai, closes [#8943](https://github.com/lobehub/lobe-chat/issues/8943) ([74d9bb5](https://github.com/lobehub/lobe-chat/commit/74d9bb5))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 1.115.0](https://github.com/lobehub/lobe-chat/compare/v1.114.6...v1.115.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2025-08-26**</sup>
|
package/CLAUDE.md
CHANGED
|
@@ -21,7 +21,11 @@ read @.cursor/rules/project-structure.mdc
|
|
|
21
21
|
|
|
22
22
|
### Package Management
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
This repository adopts a monorepo structure.
|
|
25
|
+
|
|
26
|
+
- Use `pnpm` as the primary package manager for dependency management
|
|
27
|
+
- Use `bun` to run npm scripts at the root level
|
|
28
|
+
- Use `bunx` to run executable npm packages
|
|
25
29
|
|
|
26
30
|
### TypeScript Code Style Guide
|
|
27
31
|
|
|
@@ -75,6 +79,7 @@ Some useful rules of this project. Read them when needed.
|
|
|
75
79
|
- `react-component.mdc` - antd-style, Lobe UI usage
|
|
76
80
|
- `drizzle-schema-style-guide.mdc` - Schema naming, patterns
|
|
77
81
|
- `define-database-model.mdc` - Model templates, CRUD patterns
|
|
82
|
+
- `i18n.mdc` - Internationalization workflow
|
|
78
83
|
|
|
79
84
|
**State & UI**
|
|
80
85
|
|
|
@@ -94,8 +99,3 @@ Some useful rules of this project. Read them when needed.
|
|
|
94
99
|
- `desktop-menu-configuration.mdc` - App menu, context menu, tray menu
|
|
95
100
|
- `desktop-window-management.mdc` - Window creation, state management, multi-window
|
|
96
101
|
- `desktop-controller-tests.mdc` - Controller unit testing guide
|
|
97
|
-
|
|
98
|
-
**Development Tools**
|
|
99
|
-
|
|
100
|
-
- `i18n.mdc` - Internationalization workflow
|
|
101
|
-
- `debug.mdc` - Debugging strategies
|
package/Dockerfile
CHANGED
|
@@ -249,7 +249,11 @@ ENV \
|
|
|
249
249
|
# Infini-AI
|
|
250
250
|
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST="" \
|
|
251
251
|
# 302.AI
|
|
252
|
-
AI302_API_KEY="" AI302_MODEL_LIST=""
|
|
252
|
+
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
253
|
+
# FAL
|
|
254
|
+
FAL_API_KEY="" FAL_MODEL_LIST="" \
|
|
255
|
+
# BFL
|
|
256
|
+
BFL_API_KEY="" BFL_MODEL_LIST=""
|
|
253
257
|
|
|
254
258
|
USER nextjs
|
|
255
259
|
|
package/Dockerfile.database
CHANGED
|
@@ -291,7 +291,11 @@ ENV \
|
|
|
291
291
|
# Infini-AI
|
|
292
292
|
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST="" \
|
|
293
293
|
# 302.AI
|
|
294
|
-
AI302_API_KEY="" AI302_MODEL_LIST=""
|
|
294
|
+
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
295
|
+
# FAL
|
|
296
|
+
FAL_API_KEY="" FAL_MODEL_LIST="" \
|
|
297
|
+
# BFL
|
|
298
|
+
BFL_API_KEY="" BFL_MODEL_LIST=""
|
|
295
299
|
|
|
296
300
|
USER nextjs
|
|
297
301
|
|
package/Dockerfile.pglite
CHANGED
|
@@ -247,7 +247,11 @@ ENV \
|
|
|
247
247
|
# Infini-AI
|
|
248
248
|
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST="" \
|
|
249
249
|
# 302.AI
|
|
250
|
-
AI302_API_KEY="" AI302_MODEL_LIST=""
|
|
250
|
+
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
251
|
+
# FAL
|
|
252
|
+
FAL_API_KEY="" FAL_MODEL_LIST="" \
|
|
253
|
+
# BFL
|
|
254
|
+
BFL_API_KEY="" BFL_MODEL_LIST=""
|
|
251
255
|
|
|
252
256
|
USER nextjs
|
|
253
257
|
|
package/changelog/v1.json
CHANGED
|
@@ -17,10 +17,14 @@ Before starting development on LobeChat, you need to install and configure some
|
|
|
17
17
|
First, you need to install the following software:
|
|
18
18
|
|
|
19
19
|
- Node.js: LobeChat is built on Node.js, so you need to install Node.js. We recommend installing the latest stable version.
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- PNPM: We use PNPM as the preferred package manager. You can download and install it from the [PNPM official website](https://pnpm.io/installation).
|
|
21
|
+
- Bun: We use Bun as the npm scripts runner. You can download and install it from the [Bun official website](https://bun.com/docs/installation).
|
|
22
22
|
- Git: We use Git for version control. You can download and install it from the Git official website.
|
|
23
|
-
- IDE: You can choose your preferred integrated development environment (IDE). We recommend using WebStorm
|
|
23
|
+
- IDE: You can choose your preferred integrated development environment (IDE). We recommend using WebStorm/VSCode.
|
|
24
|
+
|
|
25
|
+
### VSCode Users
|
|
26
|
+
|
|
27
|
+
We recommend installing the extensions listed in [.vscode/extensions.json](https://github.com/lobehub/lobe-chat/blob/main/.vscode/extensions.json) for the best development experience.
|
|
24
28
|
|
|
25
29
|
### Project Setup
|
|
26
30
|
|
|
@@ -32,24 +36,17 @@ After installing the above software, you can start setting up the LobeChat proje
|
|
|
32
36
|
git clone https://github.com/lobehub/lobe-chat.git
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
2. **Install dependencies**: Then, navigate to the project directory and use
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
cd lobe-chat
|
|
39
|
-
yarn install
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
If you are using PNPM, you can execute:
|
|
39
|
+
2. **Install dependencies**: Then, navigate to the project directory and use PNPM to install the project's dependencies:
|
|
43
40
|
|
|
44
41
|
```bash
|
|
45
42
|
cd lobe-chat
|
|
46
|
-
pnpm
|
|
43
|
+
pnpm i
|
|
47
44
|
```
|
|
48
45
|
|
|
49
46
|
3. **Start the development server**: After installing the dependencies, you can start the development server:
|
|
50
47
|
|
|
51
48
|
```bash
|
|
52
|
-
|
|
49
|
+
bun run dev
|
|
53
50
|
```
|
|
54
51
|
|
|
55
52
|
Now, you can open `http://localhost:3010` in your browser, and you should see the welcome page of LobeChat. This indicates that you have successfully set up the development environment.
|
|
@@ -17,10 +17,14 @@
|
|
|
17
17
|
首先,你需要安装以下软件:
|
|
18
18
|
|
|
19
19
|
- Node.js:LobeChat 是基于 Node.js 构建的,因此你需要安装 Node.js。我们建议安装最新的稳定版。
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- PNPM:我们使用 PNPM 作为管理器。你可以从 [pnpm 的官方网站](https://pnpm.io/installation) 上下载并安装。
|
|
21
|
+
- Bun:我们使用 Bun 作为 npm scripts runner, 你可以从 [Bun 的官方网站](https://bun.com/docs/installation) 上下载并安装。
|
|
22
22
|
- Git:我们使用 Git 进行版本控制。你可以从 Git 的官方网站上下载并安装。
|
|
23
|
-
- IDE:你可以选择你喜欢的集成开发环境(IDE
|
|
23
|
+
- IDE:你可以选择你喜欢的集成开发环境(IDE),我们推荐使用 WebStorm/VSCode。
|
|
24
|
+
|
|
25
|
+
### VSCode 用户
|
|
26
|
+
|
|
27
|
+
推荐安装 [.vscode/extensions.json](https://github.com/lobehub/lobe-chat/blob/main/.vscode/extensions.json) 中推荐安装的扩展获得最佳开发体验。
|
|
24
28
|
|
|
25
29
|
### 项目设置
|
|
26
30
|
|
|
@@ -32,14 +36,7 @@
|
|
|
32
36
|
git clone https://github.com/lobehub/lobe-chat.git
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
2. **安装依赖**:然后,进入项目目录,并使用
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
cd lobe-chat
|
|
39
|
-
bun i
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
如果你使用 pnpm ,可以执行:
|
|
39
|
+
2. **安装依赖**:然后,进入项目目录,并使用 `pnpm` 安装项目的依赖包:
|
|
43
40
|
|
|
44
41
|
```bash
|
|
45
42
|
cd lobe-chat
|
|
@@ -54,7 +51,7 @@ bun run dev
|
|
|
54
51
|
|
|
55
52
|
现在,你可以在浏览器中打开 `http://localhost:3010`,你应该能看到 LobeChat 的欢迎页面。这表明你已经成功地设置了开发环境。
|
|
56
53
|
|
|
57
|
-

|
|
58
55
|
|
|
59
56
|
在开发过程中,如果你在环境设置上遇到任何问题,或者有任何关于 LobeChat 开发的问题,欢迎随时向我们提问。我们期待看到你的贡献!
|
|
60
57
|
|
|
@@ -646,8 +646,33 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
|
|
646
646
|
- Type: Optional
|
|
647
647
|
- Description: Used to control the FAL model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model. Separate multiple entries with commas. The definition syntax follows the same rules as other providers' model lists.
|
|
648
648
|
- Default: `-`
|
|
649
|
-
- Example: `-all,+
|
|
649
|
+
- Example: `-all,+flux/schnell,+flux-pro/kontext=FLUX.1 Kontext [pro]`
|
|
650
650
|
|
|
651
|
-
The above example disables all models first, then enables `
|
|
651
|
+
The above example disables all models first, then enables `flux/schnell` and `flux-pro/kontext` (displayed as `FLUX.1 Kontext [pro]`).
|
|
652
|
+
|
|
653
|
+
## BFL
|
|
654
|
+
|
|
655
|
+
### `ENABLED_BFL`
|
|
656
|
+
|
|
657
|
+
- Type: Optional
|
|
658
|
+
- Description: Enables BFL as a model provider by default. Set to `0` to disable the BFL service.
|
|
659
|
+
- Default: `1`
|
|
660
|
+
- Example: `0`
|
|
661
|
+
|
|
662
|
+
### `BFL_API_KEY`
|
|
663
|
+
|
|
664
|
+
- Type: Required
|
|
665
|
+
- Description: This is the API key you applied for in the BFL service.
|
|
666
|
+
- Default: -
|
|
667
|
+
- Example: `12345678-1234-1234-1234-123456789abc`
|
|
668
|
+
|
|
669
|
+
### `BFL_MODEL_LIST`
|
|
670
|
+
|
|
671
|
+
- Type: Optional
|
|
672
|
+
- Description: Used to control the BFL model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model. Separate multiple entries with commas. The definition syntax follows the same rules as other providers' model lists.
|
|
673
|
+
- Default: `-`
|
|
674
|
+
- Example: `-all,+flux-pro-1.1,+flux-kontext-pro=FLUX.1 Kontext [pro]`
|
|
675
|
+
|
|
676
|
+
The above example disables all models first, then enables `flux-pro-1.1` and `flux-kontext-pro` (displayed as `FLUX.1 Kontext [pro]`).
|
|
652
677
|
|
|
653
678
|
[model-list]: /docs/self-hosting/advanced/model-list
|
|
@@ -645,8 +645,33 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
|
|
645
645
|
- 类型:可选
|
|
646
646
|
- 描述:用来控制 FAL 模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则与其他 provider 保持一致。
|
|
647
647
|
- 默认值:`-`
|
|
648
|
-
- 示例:`-all,+
|
|
648
|
+
- 示例:`-all,+flux/schnell,+flux-pro/kontext=FLUX.1 Kontext [pro]`
|
|
649
649
|
|
|
650
|
-
上述示例表示先禁用所有模型,再启用 `
|
|
650
|
+
上述示例表示先禁用所有模型,再启用 `flux/schnell` 和 `flux-pro/kontext`(显示名为 `FLUX.1 Kontext [pro]`)。
|
|
651
|
+
|
|
652
|
+
## BFL
|
|
653
|
+
|
|
654
|
+
### `ENABLED_BFL`
|
|
655
|
+
|
|
656
|
+
- 类型:可选
|
|
657
|
+
- 描述:默认启用 BFL 作为模型供应商,当设为 0 时关闭 BFL 服务
|
|
658
|
+
- 默认值:`1`
|
|
659
|
+
- 示例:`0`
|
|
660
|
+
|
|
661
|
+
### `BFL_API_KEY`
|
|
662
|
+
|
|
663
|
+
- 类型:必选
|
|
664
|
+
- 描述:这是你在 BFL 服务中申请的 API 密钥
|
|
665
|
+
- 默认值:-
|
|
666
|
+
- 示例:`12345678-1234-1234-1234-123456789abc`
|
|
667
|
+
|
|
668
|
+
### `BFL_MODEL_LIST`
|
|
669
|
+
|
|
670
|
+
- 类型:可选
|
|
671
|
+
- 描述:用来控制 BFL 模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则与其他 provider 保持一致。
|
|
672
|
+
- 默认值:`-`
|
|
673
|
+
- 示例:`-all,+flux-pro-1.1,+flux-kontext-pro=FLUX.1 Kontext [pro]`
|
|
674
|
+
|
|
675
|
+
上述示例表示先禁用所有模型,再启用 `flux-pro-1.1` 和 `flux-kontext-pro`(显示名为 `FLUX.1 Kontext [pro]`)。
|
|
651
676
|
|
|
652
677
|
[model-list]: /zh/docs/self-hosting/advanced/model-list
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Using Black Forest Labs API Key in LobeChat
|
|
3
|
+
description: >-
|
|
4
|
+
Learn how to integrate Black Forest Labs API Key in LobeChat for AI image generation using advanced models and high-quality output.
|
|
5
|
+
|
|
6
|
+
tags:
|
|
7
|
+
- Black Forest Labs
|
|
8
|
+
- Image Generation
|
|
9
|
+
- API Key
|
|
10
|
+
- Web UI
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Using Black Forest Labs in LobeChat
|
|
14
|
+
|
|
15
|
+
<Image alt={'Using Black Forest Labs in LobeChat'} cover src={'https://hub-apac-1.lobeobjects.space/docs/bfl-cover-image.png'} />
|
|
16
|
+
|
|
17
|
+
[Black Forest Labs](https://bfl.ai/) is currently the world's top-tier AI image generation research lab, having developed the FLUX series of high-quality image generation models and the FLUX Kontext series of image editing models. This document will guide you on how to use Black Forest Labs in LobeChat:
|
|
18
|
+
|
|
19
|
+
<Steps>
|
|
20
|
+
### Step 1: Obtain Black Forest Labs API Key
|
|
21
|
+
|
|
22
|
+
- Register for a [Black Forest Labs account](https://auth.bfl.ai/).
|
|
23
|
+
- Navigate to the [API Keys dashboard](https://dashboard.bfl.ai/api/keys) and click **Add Key** to generate a new API key.
|
|
24
|
+
- Copy the generated API key and keep it secure; it will only be shown once.
|
|
25
|
+
|
|
26
|
+
<Image
|
|
27
|
+
alt={'Open the API dashboard'}
|
|
28
|
+
inStep
|
|
29
|
+
src={
|
|
30
|
+
'https://hub-apac-1.lobeobjects.space/docs/36331f581e36a72ba91fb6c1dacbedd4.png'
|
|
31
|
+
}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<Image
|
|
35
|
+
alt={'Create API Key'}
|
|
36
|
+
inStep
|
|
37
|
+
src={
|
|
38
|
+
'https://hub-apac-1.lobeobjects.space/docs/3049ad79746bf913d1b2736cfe1d38fa.png'
|
|
39
|
+
}
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<Image
|
|
43
|
+
alt={'Retrieve API Key'}
|
|
44
|
+
inStep
|
|
45
|
+
src={
|
|
46
|
+
'https://hub-apac-1.lobeobjects.space/docs/33143deb04f2a0cdb2fd543ff8161633.png'
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
### Step 2: Configure Black Forest Labs in LobeChat
|
|
51
|
+
|
|
52
|
+
- Visit the `Settings` page in LobeChat.
|
|
53
|
+
- Under **AI Service Provider**, locate the **Black Forest Labs** configuration section.
|
|
54
|
+
|
|
55
|
+
<Image alt={'Enter API Key'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/4fe1993d94fad72829612d22527a2ecd.png'} />
|
|
56
|
+
|
|
57
|
+
- Paste the API key you obtained.
|
|
58
|
+
- Choose a Black Forest Labs model for image generation.
|
|
59
|
+
|
|
60
|
+
<Image alt={'Select Black Forest Labs model for image generation'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/7a6dfdb1a1bdd5443104a6d2cb3a8bf4.png'} />
|
|
61
|
+
|
|
62
|
+
<Callout type={'warning'}>
|
|
63
|
+
During usage, you may incur charges according to Black Forest Labs's pricing policy. Please review Black Forest Labs's
|
|
64
|
+
official pricing before heavy usage.
|
|
65
|
+
</Callout>
|
|
66
|
+
</Steps>
|
|
67
|
+
|
|
68
|
+
You can now use Black Forest Labs's advanced image generation models directly within LobeChat to create stunning visual content.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在 LobeChat 中使用 Black Forest Labs API Key
|
|
3
|
+
description: >-
|
|
4
|
+
学习如何在 LobeChat 中配置和使用 Black Forest Labs API Key,使用先进模型进行高质量 AI 图像生成。
|
|
5
|
+
|
|
6
|
+
tags:
|
|
7
|
+
- Black Forest Labs
|
|
8
|
+
- 图像生成
|
|
9
|
+
- API Key
|
|
10
|
+
- Web UI
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# 在 LobeChat 中使用 Black Forest Labs
|
|
14
|
+
|
|
15
|
+
<Image alt={'在 LobeChat 中使用 Black Forest Labs'} cover src={'https://hub-apac-1.lobeobjects.space/docs/bfl-cover-image.png'} />
|
|
16
|
+
|
|
17
|
+
[Black Forest Labs](https://bfl.ai/) 是当前世界最顶级的 AI 图像生成实验室团队,研发了 FLUX 系列高质量图像生成模型,FLUX Kontext 系列图像编辑模型。本文将指导你如何在 LobeChat 中使用 Black Forest Labs:
|
|
18
|
+
|
|
19
|
+
<Steps>
|
|
20
|
+
### 步骤一:获取 Black Forest Labs API Key
|
|
21
|
+
|
|
22
|
+
- 注册 [Black Forest Labs](https://auth.bfl.ai/) 账户;
|
|
23
|
+
- 前往 [API Keys 控制台](https://dashboard.bfl.ai/api/keys),点击 **Add Key** 创建新的 API 密钥;
|
|
24
|
+
- 复制生成的 API Key 并妥善保存,它只会显示一次。
|
|
25
|
+
|
|
26
|
+
<Image
|
|
27
|
+
alt={'打开 API 控制台'}
|
|
28
|
+
inStep
|
|
29
|
+
src={
|
|
30
|
+
'https://hub-apac-1.lobeobjects.space/docs/36331f581e36a72ba91fb6c1dacbedd4.png'
|
|
31
|
+
}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<Image
|
|
35
|
+
alt={'创建 API Key'}
|
|
36
|
+
inStep
|
|
37
|
+
src={
|
|
38
|
+
'https://hub-apac-1.lobeobjects.space/docs/3049ad79746bf913d1b2736cfe1d38fa.png'
|
|
39
|
+
}
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<Image
|
|
43
|
+
alt={'获取 API Key'}
|
|
44
|
+
inStep
|
|
45
|
+
src={
|
|
46
|
+
'https://hub-apac-1.lobeobjects.space/docs/33143deb04f2a0cdb2fd543ff8161633.png'
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
### 步骤二:在 LobeChat 中配置 Black Forest Labs
|
|
51
|
+
|
|
52
|
+
- 访问 LobeChat 的 `设置` 页面;
|
|
53
|
+
- 在 `AI服务商` 下找到 `Black Forest Labs` 的设置项;
|
|
54
|
+
|
|
55
|
+
<Image alt={'填入 API 密钥'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/4fe1993d94fad72829612d22527a2ecd.png'} />
|
|
56
|
+
|
|
57
|
+
- 粘贴获取到的 API Key;
|
|
58
|
+
- 选择一个 Black Forest Labs 模型用于图像生成。
|
|
59
|
+
|
|
60
|
+
<Image alt={'选择 Black Forest Labs 模型进行图像生成'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/7a6dfdb1a1bdd5443104a6d2cb3a8bf4.png'} />
|
|
61
|
+
|
|
62
|
+
<Callout type={'warning'}>
|
|
63
|
+
在使用过程中,你可能需要向 Black Forest Labs 支付相应费用,请在大量调用前查阅 Black Forest Labs 的官方计费政策。
|
|
64
|
+
</Callout>
|
|
65
|
+
</Steps>
|
|
66
|
+
|
|
67
|
+
至此,你已经可以在 LobeChat 中使用 Black Forest Labs 提供的先进图像生成模型来创作精美的视觉内容了。
|