mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-05 19:11:52 +00:00
doc:refactor install document and application document
This commit is contained in:
20
docs/getting_started/application.rst
Normal file
20
docs/getting_started/application.rst
Normal file
@@ -0,0 +1,20 @@
|
||||
Applications
|
||||
==================================
|
||||
DB-GPT product is a Web application that you can chat database, chat knowledge, text2dashboard.
|
||||
|
||||
.. image:: ./assets/DB-GPT-Product.jpg
|
||||
|
||||
|
||||
- Chat DB
|
||||
- Chat Knowledge
|
||||
- Dashboard
|
||||
- Plugins
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Application
|
||||
:name: chatdb
|
||||
:hidden:
|
||||
|
||||
./application/chatdb/chatdb.md
|
||||
./application/kbqa/kbqa.md
|
19
docs/getting_started/application/chatdb/chatdb.md
Normal file
19
docs/getting_started/application/chatdb/chatdb.md
Normal file
@@ -0,0 +1,19 @@
|
||||
ChatData & ChatDB
|
||||
==================================
|
||||
ChatData generates SQL from natural language and executes it. ChatDB involves conversing with metadata from the Database, including metadata about databases, tables, and fields.
|
||||
### 1.Choose Datasource
|
||||
If you are using DB-GPT for the first time, you need to add a data source and set the relevant connection information for the data source.
|
||||
#### 1.1 Datasource management
|
||||

|
||||
#### 1.2 Connection management
|
||||

|
||||
#### 1.3 Add Datasource
|
||||

|
||||
### 2.ChatData
|
||||
After successfully setting up the data source, you can start conversing with the database. You can ask it to generate SQL for you or inquire about relevant information on the database's metadata.
|
||||

|
||||
|
||||
### 3.ChatDB
|
||||

|
||||
|
||||
|
80
docs/getting_started/application/kbqa/kbqa.md
Normal file
80
docs/getting_started/application/kbqa/kbqa.md
Normal file
@@ -0,0 +1,80 @@
|
||||
KBQA
|
||||
==================================
|
||||
DB-GPT supports a knowledge question-answering module, which aims to create an intelligent expert in the field of databases and provide professional knowledge-based answers to database practitioners.
|
||||
|
||||

|
||||
|
||||
## KBQA abilities
|
||||
|
||||
|
||||
```{admonition} KBQA abilities
|
||||
* Knowledge Space.
|
||||
* Multi Source Knowledge Source Embedding.
|
||||
* Embedding Argument Adjust
|
||||
* Chat Knowledge
|
||||
* Multi Vector DB
|
||||
```
|
||||
|
||||
|
||||
## Steps to KBQA In DB-GPT
|
||||
|
||||
#### 1.Create Knowledge Space
|
||||
If you are using Knowledge Space for the first time, you need to create a Knowledge Space and set your name, owner, description.
|
||||

|
||||
|
||||
|
||||
|
||||
#### 2.Create Knowledge Document
|
||||
DB-GPT now support Multi Knowledge Source, including Text, WebUrl, and Document(PDF, Markdown, Word, PPT, HTML and CSV).
|
||||
After successfully uploading a document for translation, the backend system will automatically read and split and chunk the document, and then import it into the vector database. Alternatively, you can manually synchronize the document. You can also click on details to view the specific document slicing content.
|
||||
##### 2.1 Choose Knowledge Type:
|
||||

|
||||
|
||||
##### 2.2 Upload Document:
|
||||

|
||||
|
||||
|
||||
#### 3.Chat With Knowledge
|
||||

|
||||
|
||||
#### 4.Adjust Space arguments
|
||||
Each knowledge space supports argument customization, including the relevant arguments for vector retrieval and the arguments for knowledge question-answering prompts.
|
||||
##### 4.1 Embedding
|
||||
Embedding Argument
|
||||

|
||||
|
||||
```{tip} Embedding arguments
|
||||
* topk:the top k vectors based on similarity score.
|
||||
* recall_score:set a threshold score for the retrieval of similar vectors.
|
||||
* recall_type:recall type.
|
||||
* model:A model used to create vector representations of text or other data.
|
||||
* chunk_size:The size of the data chunks used in processing.
|
||||
* chunk_overlap:The amount of overlap between adjacent data chunks.
|
||||
```
|
||||
|
||||
##### 4.2 Prompt
|
||||
Prompt Argument
|
||||

|
||||
|
||||
```{tip} Prompt arguments
|
||||
* scene:A contextual parameter used to define the setting or environment in which the prompt is being used.
|
||||
* template:A pre-defined structure or format for the prompt, which can help ensure that the AI system generates responses that are consistent with the desired style or tone.
|
||||
* max_token:The maximum number of tokens or words allowed in a prompt.
|
||||
```
|
||||
|
||||
#### 5.Change Vector Database
|
||||
|
||||
```{admonition} Vector Store SETTINGS
|
||||
#### Chroma
|
||||
* VECTOR_STORE_TYPE=Chroma
|
||||
#### MILVUS
|
||||
* VECTOR_STORE_TYPE=Milvus
|
||||
* MILVUS_URL=127.0.0.1
|
||||
* MILVUS_PORT=19530
|
||||
* MILVUS_USERNAME
|
||||
* MILVUS_PASSWORD
|
||||
* MILVUS_SECURE=
|
||||
|
||||
#### WEAVIATE
|
||||
* WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
|
||||
```
|
22
docs/getting_started/faq.rst
Normal file
22
docs/getting_started/faq.rst
Normal file
@@ -0,0 +1,22 @@
|
||||
FAQ
|
||||
==================================
|
||||
DB-GPT product is a Web application that you can chat database, chat knowledge, text2dashboard.
|
||||
|
||||
.. image:: ./assets/DB-GPT-Product.jpg
|
||||
|
||||
|
||||
- deploy
|
||||
- llm
|
||||
- chatdb
|
||||
- kbqa
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Deloy
|
||||
:name: deploy
|
||||
:hidden:
|
||||
|
||||
./faq/deploy/deploy_faq.md
|
||||
./faq/llm/llm_faq.md
|
||||
./faq/chatdb/chatdb_faq.md
|
||||
./faq/kbqa/kbqa_faq.md
|
10
docs/getting_started/faq/chatdb/chatdb_faq.md
Normal file
10
docs/getting_started/faq/chatdb/chatdb_faq.md
Normal file
@@ -0,0 +1,10 @@
|
||||
Chat DB FAQ
|
||||
==================================
|
||||
##### Q1: What difference between ChatData and ChatDB
|
||||
ChatData generates SQL from natural language and executes it. ChatDB involves conversing with metadata from the Database, including metadata about databases, tables, and fields.
|
||||
|
||||
##### Q2: The suitable llm model currently supported for text-to-SQL is?
|
||||
Now vicunna-13b-1.5 and llama2-70b is more suitable for text-to-SQL.
|
||||
|
||||
##### Q3: How to fine-tune Text-to-SQL in DB-GPT
|
||||
there is another github project for Text-to-SQL fine-tune (https://github.com/eosphoros-ai/DB-GPT-Hub)
|
33
docs/getting_started/faq/deploy/deploy_faq.md
Normal file
33
docs/getting_started/faq/deploy/deploy_faq.md
Normal file
@@ -0,0 +1,33 @@
|
||||
Installation FAQ
|
||||
==================================
|
||||
|
||||
|
||||
##### Q1: execute `pip install -r requirements.txt` error, found some package cannot find correct version.
|
||||
change the pip source.
|
||||
|
||||
```bash
|
||||
# pypi
|
||||
$ pip install -r requirements.txt -i https://pypi.python.org/simple
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
# tsinghua
|
||||
$ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
# aliyun
|
||||
$ pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/
|
||||
```
|
||||
|
||||
##### Q2: sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
|
||||
|
||||
make sure you pull latest code or create directory with mkdir pilot/data
|
||||
|
||||
##### Q3: The model keeps getting killed.
|
||||
your GPU VRAM size is not enough, try replace your hardware or replace other llms.
|
||||
|
58
docs/getting_started/faq/kbqa/kbqa_faq.md
Normal file
58
docs/getting_started/faq/kbqa/kbqa_faq.md
Normal file
@@ -0,0 +1,58 @@
|
||||
KBQA FAQ
|
||||
==================================
|
||||
|
||||
##### Q1: text2vec-large-chinese not found
|
||||
|
||||
make sure you have download text2vec-large-chinese embedding model in right way
|
||||
|
||||
```tip
|
||||
centos:yum install git-lfs
|
||||
ubuntu:apt-get install git-lfs -y
|
||||
macos:brew install git-lfs
|
||||
```
|
||||
```bash
|
||||
cd models
|
||||
git lfs clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
|
||||
```
|
||||
|
||||
##### Q2:How to change Vector DB Type in DB-GPT.
|
||||
|
||||
Update .env file and set VECTOR_STORE_TYPE.
|
||||
|
||||
DB-GPT currently support Chroma(Default), Milvus(>2.1), Weaviate vector database.
|
||||
If you want to change vector db, Update your .env, set your vector store type, VECTOR_STORE_TYPE=Chroma (now only support Chroma and Milvus(>2.1), if you set Milvus, please set MILVUS_URL and MILVUS_PORT)
|
||||
If you want to support more vector db, you can integrate yourself.[how to integrate](https://db-gpt.readthedocs.io/en/latest/modules/vector.html)
|
||||
```commandline
|
||||
#*******************************************************************#
|
||||
#** VECTOR STORE SETTINGS **#
|
||||
#*******************************************************************#
|
||||
VECTOR_STORE_TYPE=Chroma
|
||||
#MILVUS_URL=127.0.0.1
|
||||
#MILVUS_PORT=19530
|
||||
#MILVUS_USERNAME
|
||||
#MILVUS_PASSWORD
|
||||
#MILVUS_SECURE=
|
||||
|
||||
#WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
|
||||
```
|
||||
##### Q3:When I use vicuna-13b, found some illegal character like this.
|
||||
<p align="left">
|
||||
<img src="../../assets/faq/illegal_character.png" width="800px" />
|
||||
</p>
|
||||
|
||||
Set KNOWLEDGE_SEARCH_TOP_SIZE smaller or set KNOWLEDGE_CHUNK_SIZE smaller, and reboot server.
|
||||
|
||||
##### Q4:space add error (pymysql.err.OperationalError) (1054, "Unknown column 'knowledge_space.context' in 'field list'")
|
||||
|
||||
1.shutdown dbgpt_server(ctrl c)
|
||||
|
||||
2.add column context for table knowledge_space
|
||||
```commandline
|
||||
mysql -h127.0.0.1 -uroot -paa12345678
|
||||
```
|
||||
3.execute sql ddl
|
||||
```commandline
|
||||
mysql> use knowledge_management;
|
||||
mysql> ALTER TABLE knowledge_space ADD COLUMN context TEXT COMMENT "arguments context";
|
||||
```
|
||||
4.restart dbgpt serve
|
40
docs/getting_started/faq/llm/llm_faq.md
Normal file
40
docs/getting_started/faq/llm/llm_faq.md
Normal file
@@ -0,0 +1,40 @@
|
||||
LLM USE FAQ
|
||||
==================================
|
||||
##### Q1:how to use openai chatgpt service
|
||||
change your LLM_MODEL
|
||||
````shell
|
||||
LLM_MODEL=proxyllm
|
||||
````
|
||||
|
||||
set your OPENAPI KEY
|
||||
````shell
|
||||
PROXY_API_KEY={your-openai-sk}
|
||||
PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions
|
||||
````
|
||||
|
||||
make sure your openapi API_KEY is available
|
||||
|
||||
##### Q2 how to use MultiGPUs
|
||||
DB-GPT will use all available gpu by default. And you can modify the setting `CUDA_VISIBLE_DEVICES=0,1` in `.env` file to use the specific gpu IDs.
|
||||
|
||||
Optionally, you can also specify the gpu ID to use before the starting command, as shown below:
|
||||
|
||||
````shell
|
||||
# Specify 1 gpu
|
||||
CUDA_VISIBLE_DEVICES=0 python3 pilot/server/dbgpt_server.py
|
||||
|
||||
# Specify 4 gpus
|
||||
CUDA_VISIBLE_DEVICES=3,4,5,6 python3 pilot/server/dbgpt_server.py
|
||||
````
|
||||
|
||||
You can modify the setting `MAX_GPU_MEMORY=xxGib` in `.env` file to configure the maximum memory used by each GPU.
|
||||
|
||||
##### Q3 Not Enough Memory
|
||||
|
||||
DB-GPT supported 8-bit quantization and 4-bit quantization.
|
||||
|
||||
You can modify the setting `QUANTIZE_8bit=True` or `QUANTIZE_4bit=True` in `.env` file to use quantization(8-bit quantization is enabled by default).
|
||||
|
||||
Llama-2-70b with 8-bit quantization can run with 80 GB of VRAM, and 4-bit quantization can run with 48 GB of VRAM.
|
||||
|
||||
Note: you need to install the latest dependencies according to [requirements.txt](https://github.com/eosphoros-ai/DB-GPT/blob/main/requirements.txt).
|
24
docs/getting_started/install.rst
Normal file
24
docs/getting_started/install.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
Install
|
||||
==================================
|
||||
DB-GPT product is a Web application that you can chat database, chat knowledge, text2dashboard.
|
||||
|
||||
.. image:: ./assets/DB-GPT-Product.jpg
|
||||
|
||||
|
||||
- deploy
|
||||
- docker
|
||||
- docker_compose
|
||||
- environment
|
||||
- deploy_faq
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Install
|
||||
:name: deploy
|
||||
:hidden:
|
||||
|
||||
./install/deploy/deploy.md
|
||||
./install/docker/docker.md
|
||||
./install/docker_compose/docker_compose.md
|
||||
./install/environment/environment.md
|
||||
./install/faq/deploy_faq.md
|
144
docs/getting_started/install/deploy/deploy.md
Normal file
144
docs/getting_started/install/deploy/deploy.md
Normal file
@@ -0,0 +1,144 @@
|
||||
# Installation From Source
|
||||
|
||||
This tutorial gives you a quick walkthrough about use DB-GPT with you environment and data.
|
||||
|
||||
## Installation
|
||||
|
||||
To get started, install DB-GPT with the following steps.
|
||||
|
||||
### 1. Hardware Requirements
|
||||
As our project has the ability to achieve ChatGPT performance of over 85%, there are certain hardware requirements. However, overall, the project can be deployed and used on consumer-grade graphics cards. The specific hardware requirements for deployment are as follows:
|
||||
|
||||
| GPU | VRAM Size | Performance |
|
||||
|----------|-----------| ------------------------------------------- |
|
||||
| RTX 4090 | 24 GB | Smooth conversation inference |
|
||||
| RTX 3090 | 24 GB | Smooth conversation inference, better than V100 |
|
||||
| V100 | 16 GB | Conversation inference possible, noticeable stutter |
|
||||
| T4 | 16 GB | Conversation inference possible, noticeable stutter |
|
||||
|
||||
if your VRAM Size is not enough, DB-GPT supported 8-bit quantization and 4-bit quantization.
|
||||
|
||||
Here are some of the VRAM size usage of the models we tested in some common scenarios.
|
||||
|
||||
| Model | Quantize | VRAM Size |
|
||||
| --------- | --------- | --------- |
|
||||
| vicuna-7b-v1.5 | 4-bit | 8 GB |
|
||||
| vicuna-7b-v1.5 | 8-bit | 12 GB |
|
||||
| vicuna-13b-v1.5 | 4-bit | 12 GB |
|
||||
| vicuna-13b-v1.5 | 8-bit | 20 GB |
|
||||
| llama-2-7b | 4-bit | 8 GB |
|
||||
| llama-2-7b | 8-bit | 12 GB |
|
||||
| llama-2-13b | 4-bit | 12 GB |
|
||||
| llama-2-13b | 8-bit | 20 GB |
|
||||
| llama-2-70b | 4-bit | 48 GB |
|
||||
| llama-2-70b | 8-bit | 80 GB |
|
||||
| baichuan-7b | 4-bit | 8 GB |
|
||||
| baichuan-7b | 8-bit | 12 GB |
|
||||
| baichuan-13b | 4-bit | 12 GB |
|
||||
| baichuan-13b | 8-bit | 20 GB |
|
||||
|
||||
### 2. Install
|
||||
```bash
|
||||
git clone https://github.com/eosphoros-ai/DB-GPT.git
|
||||
```
|
||||
|
||||
We use Sqlite as default database, so there is no need for database installation. If you choose to connect to other databases, you can follow our tutorial for installation and configuration.
|
||||
For the entire installation process of DB-GPT, we use the miniconda3 virtual environment. Create a virtual environment and install the Python dependencies.
|
||||
[How to install Miniconda](https://docs.conda.io/en/latest/miniconda.html)
|
||||
```bash
|
||||
python>=3.10
|
||||
conda create -n dbgpt_env python=3.10
|
||||
conda activate dbgpt_env
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
Before use DB-GPT Knowledge
|
||||
```bash
|
||||
python -m spacy download zh_core_web_sm
|
||||
|
||||
```
|
||||
|
||||
Once the environment is installed, we have to create a new folder "models" in the DB-GPT project, and then we can put all the models downloaded from huggingface in this directory
|
||||
|
||||
```{tip}
|
||||
Notice make sure you have install git-lfs
|
||||
centos:yum install git-lfs
|
||||
ubuntu:app-get install git-lfs
|
||||
macos:brew install git-lfs
|
||||
```
|
||||
|
||||
```bash
|
||||
cd DB-GPT
|
||||
mkdir models and cd models
|
||||
#### llm model
|
||||
git clone https://huggingface.co/lmsys/vicuna-13b-v1.5
|
||||
or
|
||||
git clone https://huggingface.co/THUDM/chatglm2-6b
|
||||
|
||||
#### embedding model
|
||||
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
|
||||
or
|
||||
git clone https://huggingface.co/moka-ai/m3e-large
|
||||
```
|
||||
|
||||
The model files are large and will take a long time to download. During the download, let's configure the .env file, which needs to be copied and created from the .env.template
|
||||
|
||||
if you want to use openai llm service, see [LLM Use FAQ](https://db-gpt.readthedocs.io/en/latest/getting_started/faq/llm/llm_faq.html)
|
||||
|
||||
```{tip}
|
||||
cp .env.template .env
|
||||
```
|
||||
|
||||
You can configure basic parameters in the .env file, for example setting LLM_MODEL to the model to be used
|
||||
|
||||
([Vicuna-v1.5](https://huggingface.co/lmsys/vicuna-13b-v1.5) based on llama-2 has been released, we recommend you set `LLM_MODEL=vicuna-13b-v1.5` to try this model)
|
||||
|
||||
### 3. Run
|
||||
You can refer to this document to obtain the Vicuna weights: [Vicuna](https://github.com/lm-sys/FastChat/blob/main/README.md#model-weights) .
|
||||
|
||||
If you have difficulty with this step, you can also directly use the model from [this link](https://huggingface.co/Tribbiani/vicuna-7b) as a replacement.
|
||||
|
||||
set .env configuration set your vector store type, eg:VECTOR_STORE_TYPE=Chroma, now we support Chroma and Milvus(version > 2.1)
|
||||
|
||||
|
||||
1.Run db-gpt server
|
||||
|
||||
```bash
|
||||
$ python pilot/server/dbgpt_server.py
|
||||
```
|
||||
Open http://localhost:5000 with your browser to see the product.
|
||||
|
||||
If you want to access an external LLM service, you need to 1.set the variables LLM_MODEL=YOUR_MODEL_NAME MODEL_SERVER=YOUR_MODEL_SERVER(eg:http://localhost:5000) in the .env file.
|
||||
2.execute dbgpt_server.py in light mode
|
||||
|
||||
If you want to learn about dbgpt-webui, read https://github./csunny/DB-GPT/tree/new-page-framework/datacenter
|
||||
|
||||
```bash
|
||||
$ python pilot/server/dbgpt_server.py --light
|
||||
```
|
||||
|
||||
|
||||
### 4. Multiple GPUs
|
||||
|
||||
DB-GPT will use all available gpu by default. And you can modify the setting `CUDA_VISIBLE_DEVICES=0,1` in `.env` file to use the specific gpu IDs.
|
||||
|
||||
Optionally, you can also specify the gpu ID to use before the starting command, as shown below:
|
||||
|
||||
````shell
|
||||
# Specify 1 gpu
|
||||
CUDA_VISIBLE_DEVICES=0 python3 pilot/server/dbgpt_server.py
|
||||
|
||||
# Specify 4 gpus
|
||||
CUDA_VISIBLE_DEVICES=3,4,5,6 python3 pilot/server/dbgpt_server.py
|
||||
````
|
||||
|
||||
You can modify the setting `MAX_GPU_MEMORY=xxGib` in `.env` file to configure the maximum memory used by each GPU.
|
||||
|
||||
### 5. Not Enough Memory
|
||||
|
||||
DB-GPT supported 8-bit quantization and 4-bit quantization.
|
||||
|
||||
You can modify the setting `QUANTIZE_8bit=True` or `QUANTIZE_4bit=True` in `.env` file to use quantization(8-bit quantization is enabled by default).
|
||||
|
||||
Llama-2-70b with 8-bit quantization can run with 80 GB of VRAM, and 4-bit quantization can run with 48 GB of VRAM.
|
||||
|
||||
Note: you need to install the latest dependencies according to [requirements.txt](https://github.com/eosphoros-ai/DB-GPT/blob/main/requirements.txt).
|
87
docs/getting_started/install/docker/docker.md
Normal file
87
docs/getting_started/install/docker/docker.md
Normal file
@@ -0,0 +1,87 @@
|
||||
Docker Install
|
||||
==================================
|
||||
|
||||
### Docker (Experimental)
|
||||
|
||||
#### 1. Building Docker image
|
||||
|
||||
```bash
|
||||
$ bash docker/build_all_images.sh
|
||||
```
|
||||
|
||||
Review images by listing them:
|
||||
|
||||
```bash
|
||||
$ docker images|grep db-gpt
|
||||
```
|
||||
|
||||
Output should look something like the following:
|
||||
|
||||
```
|
||||
db-gpt-allinone latest e1ffd20b85ac 45 minutes ago 14.5GB
|
||||
db-gpt latest e36fb0cca5d9 3 hours ago 14GB
|
||||
```
|
||||
|
||||
You can pass some parameters to docker/build_all_images.sh.
|
||||
```bash
|
||||
$ bash docker/build_all_images.sh \
|
||||
--base-image nvidia/cuda:11.8.0-devel-ubuntu22.04 \
|
||||
--pip-index-url https://pypi.tuna.tsinghua.edu.cn/simple \
|
||||
--language zh
|
||||
```
|
||||
|
||||
You can execute the command `bash docker/build_all_images.sh --help` to see more usage.
|
||||
|
||||
#### 2. Run all in one docker container
|
||||
|
||||
**Run with local model**
|
||||
|
||||
```bash
|
||||
$ docker run --gpus "device=0" -d -p 3306:3306 \
|
||||
-p 5000:5000 \
|
||||
-e LOCAL_DB_HOST=127.0.0.1 \
|
||||
-e LOCAL_DB_PASSWORD=aa123456 \
|
||||
-e MYSQL_ROOT_PASSWORD=aa123456 \
|
||||
-e LLM_MODEL=vicuna-13b \
|
||||
-e LANGUAGE=zh \
|
||||
-v /data/models:/app/models \
|
||||
--name db-gpt-allinone \
|
||||
db-gpt-allinone
|
||||
```
|
||||
|
||||
Open http://localhost:5000 with your browser to see the product.
|
||||
|
||||
|
||||
- `-e LLM_MODEL=vicuna-13b`, means we use vicuna-13b as llm model, see /pilot/configs/model_config.LLM_MODEL_CONFIG
|
||||
- `-v /data/models:/app/models`, means we mount the local model file directory `/data/models` to the docker container directory `/app/models`, please replace it with your model file directory.
|
||||
|
||||
You can see log with command:
|
||||
|
||||
```bash
|
||||
$ docker logs db-gpt-allinone -f
|
||||
```
|
||||
|
||||
**Run with openai interface**
|
||||
|
||||
```bash
|
||||
$ PROXY_API_KEY="You api key"
|
||||
$ PROXY_SERVER_URL="https://api.openai.com/v1/chat/completions"
|
||||
$ docker run --gpus "device=0" -d -p 3306:3306 \
|
||||
-p 5000:5000 \
|
||||
-e LOCAL_DB_HOST=127.0.0.1 \
|
||||
-e LOCAL_DB_PASSWORD=aa123456 \
|
||||
-e MYSQL_ROOT_PASSWORD=aa123456 \
|
||||
-e LLM_MODEL=proxyllm \
|
||||
-e PROXY_API_KEY=$PROXY_API_KEY \
|
||||
-e PROXY_SERVER_URL=$PROXY_SERVER_URL \
|
||||
-e LANGUAGE=zh \
|
||||
-v /data/models/text2vec-large-chinese:/app/models/text2vec-large-chinese \
|
||||
--name db-gpt-allinone \
|
||||
db-gpt-allinone
|
||||
```
|
||||
|
||||
- `-e LLM_MODEL=proxyllm`, means we use proxy llm(openai interface, fastchat interface...)
|
||||
- `-v /data/models/text2vec-large-chinese:/app/models/text2vec-large-chinese`, means we mount the local text2vec model to the docker container.
|
||||
|
||||
|
||||
Open http://localhost:5000 with your browser to see the product.
|
@@ -0,0 +1,26 @@
|
||||
Docker Compose
|
||||
==================================
|
||||
|
||||
#### Run with docker compose
|
||||
|
||||
```bash
|
||||
$ docker compose up -d
|
||||
```
|
||||
|
||||
Output should look something like the following:
|
||||
```
|
||||
[+] Building 0.0s (0/0)
|
||||
[+] Running 2/2
|
||||
✔ Container db-gpt-db-1 Started 0.4s
|
||||
✔ Container db-gpt-webserver-1 Started
|
||||
```
|
||||
|
||||
You can see log with command:
|
||||
|
||||
```bash
|
||||
$ docker logs db-gpt-webserver-1 -f
|
||||
```
|
||||
|
||||
Open http://localhost:5000 with your browser to see the product.
|
||||
|
||||
You can open docker-compose.yml in the project root directory to see more details.
|
122
docs/getting_started/install/environment/environment.md
Normal file
122
docs/getting_started/install/environment/environment.md
Normal file
@@ -0,0 +1,122 @@
|
||||
Env Parameter
|
||||
==================================
|
||||
|
||||
```{admonition} LLM MODEL Config
|
||||
LLM Model Name, see /pilot/configs/model_config.LLM_MODEL_CONFIG
|
||||
* LLM_MODEL=vicuna-13b
|
||||
|
||||
MODEL_SERVER_ADDRESS
|
||||
* MODEL_SERVER=http://127.0.0.1:8000
|
||||
LIMIT_MODEL_CONCURRENCY
|
||||
|
||||
* LIMIT_MODEL_CONCURRENCY=5
|
||||
|
||||
MAX_POSITION_EMBEDDINGS
|
||||
|
||||
* MAX_POSITION_EMBEDDINGS=4096
|
||||
|
||||
QUANTIZE_QLORA
|
||||
|
||||
* QUANTIZE_QLORA=True
|
||||
|
||||
QUANTIZE_8bit
|
||||
|
||||
* QUANTIZE_8bit=True
|
||||
```
|
||||
|
||||
```{admonition} LLM PROXY Settings
|
||||
OPENAI Key
|
||||
|
||||
* PROXY_API_KEY={your-openai-sk}
|
||||
* PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions
|
||||
|
||||
from https://bard.google.com/ f12-> application-> __Secure-1PSID
|
||||
|
||||
* BARD_PROXY_API_KEY={your-bard-token}
|
||||
```
|
||||
|
||||
```{admonition} DATABASE SETTINGS
|
||||
### SQLite database (Current default database)
|
||||
* LOCAL_DB_PATH=data/default_sqlite.db
|
||||
* LOCAL_DB_TYPE=sqlite # Database Type default:sqlite
|
||||
|
||||
### MYSQL database
|
||||
* LOCAL_DB_TYPE=mysql
|
||||
* LOCAL_DB_USER=root
|
||||
* LOCAL_DB_PASSWORD=aa12345678
|
||||
* LOCAL_DB_HOST=127.0.0.1
|
||||
* LOCAL_DB_PORT=3306
|
||||
```
|
||||
|
||||
```{admonition} EMBEDDING SETTINGS
|
||||
EMBEDDING MODEL Name, see /pilot/configs/model_config.LLM_MODEL_CONFIG
|
||||
* EMBEDDING_MODEL=text2vec
|
||||
|
||||
Embedding Chunk size, default 500
|
||||
|
||||
* KNOWLEDGE_CHUNK_SIZE=500
|
||||
|
||||
Embedding Chunk Overlap, default 100
|
||||
* KNOWLEDGE_CHUNK_OVERLAP=100
|
||||
|
||||
embeding recall top k,5
|
||||
|
||||
* KNOWLEDGE_SEARCH_TOP_SIZE=5
|
||||
|
||||
embeding recall max token ,2000
|
||||
|
||||
* KNOWLEDGE_SEARCH_MAX_TOKEN=5
|
||||
```
|
||||
|
||||
```{admonition} Vector Store SETTINGS
|
||||
#### Chroma
|
||||
* VECTOR_STORE_TYPE=Chroma
|
||||
#### MILVUS
|
||||
* VECTOR_STORE_TYPE=Milvus
|
||||
* MILVUS_URL=127.0.0.1
|
||||
* MILVUS_PORT=19530
|
||||
* MILVUS_USERNAME
|
||||
* MILVUS_PASSWORD
|
||||
* MILVUS_SECURE=
|
||||
|
||||
#### WEAVIATE
|
||||
* VECTOR_STORE_TYPE=Weaviate
|
||||
* WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
|
||||
```
|
||||
|
||||
```{admonition} Vector Store SETTINGS
|
||||
#### Chroma
|
||||
* VECTOR_STORE_TYPE=Chroma
|
||||
#### MILVUS
|
||||
* VECTOR_STORE_TYPE=Milvus
|
||||
* MILVUS_URL=127.0.0.1
|
||||
* MILVUS_PORT=19530
|
||||
* MILVUS_USERNAME
|
||||
* MILVUS_PASSWORD
|
||||
* MILVUS_SECURE=
|
||||
|
||||
#### WEAVIATE
|
||||
* WEAVIATE_URL=https://kt-region-m8hcy0wc.weaviate.network
|
||||
```
|
||||
|
||||
```{admonition} Multi-GPU Setting
|
||||
See https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda_visible_devices/
|
||||
If CUDA_VISIBLE_DEVICES is not configured, all available gpus will be used
|
||||
|
||||
* CUDA_VISIBLE_DEVICES=0
|
||||
|
||||
Optionally, you can also specify the gpu ID to use before the starting command
|
||||
|
||||
* CUDA_VISIBLE_DEVICES=3,4,5,6
|
||||
|
||||
You can configure the maximum memory used by each GPU.
|
||||
|
||||
* MAX_GPU_MEMORY=16Gib
|
||||
```
|
||||
|
||||
```{admonition} Other Setting
|
||||
#### Language Settings(influence prompt language)
|
||||
* LANGUAGE=en
|
||||
* LANGUAGE=zh
|
||||
```
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# Installation
|
||||
# Python SDK
|
||||
DB-GPT provides a third-party Python API package that you can integrate into your own code.
|
||||
|
||||
### Installation from Pip
|
||||
|
@@ -6,19 +6,18 @@ This is a collection of DB-GPT tutorials on Medium.
|
||||
DB-GPT is divided into several functions, including chat with knowledge base, execute SQL, chat with database, and execute plugins.
|
||||
|
||||
### Introduction
|
||||
|
||||
#### youtube
|
||||
[What is DB-GPT](https://www.youtube.com/watch?v=QszhVJerc0I)
|
||||
|
||||
### Knowledge
|
||||
[How to deploy DB-GPT step by step](https://www.youtube.com/watch?v=OJGU4fQCqPs)
|
||||
|
||||
[How to Create your own knowledge repository](https://db-gpt.readthedocs.io/en/latest/modules/knownledge.html)
|
||||
|
||||

|
||||
#### bilibili
|
||||
[What is DB-GPT](https://www.bilibili.com/video/BV1SM4y1a7Nj/?spm_id_from=333.788&vd_source=7792e22c03b7da3c556a450eb42c8a0f)
|
||||
|
||||
[How to deploy DB-GPT step by step](https://www.bilibili.com/video/BV1mu411Y7ve/?spm_id_from=pageDriver&vd_source=7792e22c03b7da3c556a450eb42c8a0f)
|
||||
|
||||
|
||||
### SQL Generation
|
||||

|
||||
|
||||
### SQL Execute
|
||||

|
||||
|
||||
### Plugins
|
||||

|
Reference in New Issue
Block a user