-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'labring:main' into aio
- Loading branch information
Showing
195 changed files
with
6,928 additions
and
9,441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,134 +4,16 @@ sidebar_position: 1 | |
|
||
# Quick Installation of FastGpt AI Knowledge Base | ||
|
||
FastGpt is recommended to deploy with Docker on Git, so it is also easy to deploy on Sealos conveniently. FastGpt relies on MongoDB and PostgreSQL. The following tutorial only describes how to deploy these two databases and the FastGpt image on Sealos. The environment variables and usage instructions of FastGpt will not be explained in details. For details, please refer to [FastGpt Git](https://github.com/c121914yu/FastGPT). | ||
No server, no magic, no domain name, click to deploy 👇 | ||
|
||
## 1. Create Two Databases | ||
[](https://cloud.sealos.io/?openapp=system-fastdeploy%3FtemplateName%3Dfastgpt) | ||
|
||
Sealos provides a **database** tool that allows for visual deployment of databases. | ||
The database needs to be deployed. After the deployment, you need to wait 2 to 4 minutes to access the database. The minimum configuration is used by default, and the first access is a little slow. | ||
|
||
### 1.1 Open the Database App in the [Sealos](https://cloud.sealos.io) desktop environment | ||
 | ||
|
||
 | ||
## Run | ||
|
||
### 1.2 Create MongoDB database | ||
Click on the [external address] provided by sealos to use it. The login user name is root, and the password is the newly set environment variable (1234 in the figure above) | ||
|
||
 | ||
|
||
Choose from three types of databases, and create a MongoDB first. It is recommended to choose a specification of 0.5C 512Mi or higher. | ||
|
||
 | ||
|
||
### 1.3 Create PostgreSQL database | ||
|
||
 | ||
|
||
Due to the need to store vector data in PostgreSQL, the required capacity is relatively large, and the initial capacity can be set to a larger size. | ||
|
||
 | ||
|
||
### 1.4 Check database connection parameters | ||
|
||
Click the database details and check the connection parameters of each database, including host, port, username, password and connectionUrl. | ||
|
||
 | ||
 | ||
|
||
## 2. Initialize PostgreSQL Database | ||
|
||
### 2.1 Connect to PostgreSQL database | ||
|
||
Connect to the database with one click in the PostgreSQL database details. | ||
|
||
 | ||
|
||
### 2.2 Execute init.sql | ||
|
||
Copy and paste the following SQL into Terminal for execution. Paste using ctrl+shift+v. If there is an error with one-time paste, each SQL statement can be executed separately. | ||
|
||
```sql | ||
CREATE EXTENSION IF NOT EXISTS vector; | ||
CREATE TABLE IF NOT EXISTS modelData ( | ||
id BIGSERIAL PRIMARY KEY, | ||
vector VECTOR(1536) NOT NULL, | ||
user_id VARCHAR(50) NOT NULL, | ||
kb_id VARCHAR(50) NOT NULL, | ||
source VARCHAR(100), | ||
q TEXT NOT NULL, | ||
a TEXT NOT NULL | ||
); | ||
CREATE INDEX IF NOT EXISTS modelData_userId_index ON modelData USING HASH (user_id); | ||
CREATE INDEX IF NOT EXISTS modelData_kbId_index ON modelData USING HASH (kb_id); | ||
CREATE INDEX IF NOT EXISTS idx_model_data_md5_q_a_user_id_kb_id ON modelData (md5(q), md5(a), user_id, kb_id); | ||
CREATE INDEX IF NOT EXISTS vector_index ON modeldata USING ivfflat (vector vector_ip_ops) WITH (lists = 100); | ||
SET ivfflat.probes = 10; | ||
``` | ||
|
||
 | ||
|
||
### 2.3 Verify initialization | ||
|
||
Execute `\d modeldata` to check the details of the table to see if it is as expected. | ||
|
||
 | ||
|
||
## 3. Deploy FastGpt | ||
|
||
Sealos provides **App Launchpad** that can quickly deploy single image services. | ||
|
||
### 3.1 Open App Launchpad from Desktop | ||
|
||
 | ||
|
||
### 3.2 Click Create Application | ||
|
||
 | ||
|
||
### 3.3 Fill in the relevant parameters | ||
|
||
 | ||
 | ||
|
||
| variable names | description | | ||
| :----------------------- | ------------------------------------------------------------ | | ||
| Application Name | such as: fastgpt | | ||
| Image Name | Official image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:latest | | ||
| CPU and Memory | Depends on user's demand | | ||
| container exposed port | 3000 | | ||
| Accessible to the Public | Open「Accessible to the Public」and the domain name is automatically assigned and can be used directly or customized. | | ||
| Environment | Refer to [FastGpt docker-compose.yaml](https://github.com/c121914yu/FastGPT/blob/main/docs/deploy/fastgpt/docker-compose.yml) For some variables in the database, directly copy the content in [1.4]. | | ||
|
||
The following is an environment variable without annotations, which can be directly copied, modified, and used. | ||
|
||
``` | ||
QA_MAX_PROCESS=20 | ||
VECTOR_MAX_PROCESS=20 | ||
[email protected] | ||
MAILE_CODE=mailcode | ||
aliAccessKeyId=keyid | ||
aliAccessKeySecret=secret | ||
aliSignName=signname | ||
aliTemplateCode=SMS_111 | ||
TOKEN_KEY=tokenkey | ||
ROOT_KEY=rootkey | ||
SENSITIVE_CHECK=1 | ||
MONGODB_URI=mongodb://root:[email protected]:27017 | ||
MONGODB_NAME=fastgpt | ||
PG_USER=postgres | ||
PG_PASSWORD=m8tkt57w | ||
PG_HOST=fastgpt-pg-postgresql.ns-hti44k5d.svc | ||
PG_PORT=5432 | ||
PG_DB_NAME=postgres | ||
OPENAIKEY=sk-xxx | ||
OPENAI_TRAINING_KEY=sk-xxx | ||
GPT4KEY=sk-xxx | ||
``` | ||
|
||
 | ||
|
||
### 3.3 Access FastGpt | ||
|
||
Access FastGpt through the external address or custom domain name provided by **App Launchpad**. | ||
|
||
 | ||
 | ||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed
BIN
-5.73 MB
docs/4.0/i18n/zh-Hans/examples/ai-applications/images/open-dbprovider.png
Diff not rendered.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.