docs: update english docs
docs: update readme
119
README.en.md
@ -2,96 +2,105 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
[中文版](README.md)
|
||||||
|
|
||||||
A Open Database-GPT Experiment, interact your data and environment using the local GPT, no data leaks, 100% privately, 100% security.
|
A Open Database-GPT Experiment, interact your data and environment using the local GPT, no data leaks, 100% privately, 100% security.
|
||||||
|
|
||||||

|
## Features
|
||||||
|
|
||||||
一个数据库相关的GPT实验项目, 模型与数据全部本地化部署, 绝对保障数据的隐私安全。 同时此GPT项目可以直接本地部署连接到私有数据库, 进行私有数据处理。
|
- SQL Project
|
||||||
|
- SQL Generate
|
||||||
|
- SQL-diagnosis
|
||||||
|
- Database-QA Based Knowledge
|
||||||
|
|
||||||
[DB-GPT](https://github.com/csunny/DB-GPT) 是一个实验性的开源应用,它基于[FastChat](https://github.com/lm-sys/FastChat),并使用[vicuna-13b](https://huggingface.co/Tribbiani/vicuna-13b)作为基础模型。此外,此程序结合了[langchain](https://github.com/hwchase17/langchain)和[llama-index](https://github.com/jerryjliu/llama_index)基于现有知识库进行[In-Context Learning](https://arxiv.org/abs/2301.00234)来对其进行数据库相关知识的增强。它可以进行SQL生成、SQL诊断、数据库知识问答、数据处理等一系列的工作。
|
## Architecture Design
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
## 项目方案
|
<img src="./assets/DB-GPT.png" width="600px" />
|
||||||
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/DB-GPT.png" width="600" margin-left="auto" margin-right="auto" >
|
</p>
|
||||||
|
|
||||||
[DB-GPT](https://github.com/csunny/DB-GPT) is an experimental open-source application that builds upon the [FastChat](https://github.com/lm-sys/FastChat) model and uses vicuna as its base model. Additionally, it looks like this application incorporates langchain and llama-index embedding knowledge to improve Database-QA capabilities.
|
[DB-GPT](https://github.com/csunny/DB-GPT) is an experimental open-source application that builds upon the [FastChat](https://github.com/lm-sys/FastChat) model and uses vicuna as its base model. Additionally, it looks like this application incorporates langchain and llama-index embedding knowledge to improve Database-QA capabilities.
|
||||||
|
|
||||||
Overall, it appears to be a sophisticated and innovative tool for working with databases. If you have any specific questions about how to use or implement DB-GPT in your work, please let me know and I'll do my best to assist you.
|
Overall, it appears to be a sophisticated and innovative tool for working with databases. If you have any specific questions about how to use or implement DB-GPT in your work, please let me know and I'll do my best to assist you.
|
||||||
|
|
||||||
|
## Demo
|
||||||
|
|
||||||
## 运行效果演示
|
|
||||||
Run on an RTX 4090 GPU (The origin mov not sped up!, [YouTube地址](https://www.youtube.com/watch?v=1PWI6F89LPo))
|
Run on an RTX 4090 GPU (The origin mov not sped up!, [YouTube地址](https://www.youtube.com/watch?v=1PWI6F89LPo))
|
||||||
- 运行演示
|
|
||||||
|
|
||||||

|
### Run
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="./assets/演示.gif" width="600px" />
|
||||||
|
</p>
|
||||||
|
|
||||||
- SQL生成示例
|
### SQL Generate
|
||||||
首先选择对应的数据库, 然后模型即可根据对应的数据库Schema信息生成SQL
|
|
||||||
|
|
||||||
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/SQLGEN.png" width="600" margin-left="auto" margin-right="auto" >
|
First, select the DataBase, you can use Schema to generate the SQL.。
|
||||||
|
|
||||||
The Generated SQL is runable.
|
<p align="center">
|
||||||
|
<img src="./assets/SQLGEN.png" width="600px" />
|
||||||
|
</p>
|
||||||
|
|
||||||
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/exeable.png" width="600" margin-left="auto" margin-right="auto" >
|
<p align="center">
|
||||||
|
<img src="./assets/exeable.png" width="600px" />
|
||||||
|
</p>
|
||||||
|
|
||||||
- 数据库QA示例
|
### Database-QA
|
||||||
|
|
||||||
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/DB_QA.png" margin-left="auto" margin-right="auto" width="600">
|
<p align="center">
|
||||||
|
<img src="./assets/DB_QA.png" width="600px" />
|
||||||
|
</p>
|
||||||
|
|
||||||
基于默认内置知识库QA
|
<p align="center">
|
||||||
|
<img src="./assets/VectorDBQA.png" width="600px" />
|
||||||
|
</p>
|
||||||
|
|
||||||
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/VectorDBQA.png" width="600" margin-left="auto" margin-right="auto" >
|
## Deployment
|
||||||
|
|
||||||
# Dependencies
|
### 1. Python Requirement
|
||||||
1. First you need to install python requirements.
|
|
||||||
```
|
```bash
|
||||||
python>=3.9
|
$ python>=3.9
|
||||||
pip install -r requirements.txt
|
$ pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
or if you use conda envirenment, you can use this command
|
or if you use conda envirenment, you can use this command
|
||||||
```
|
|
||||||
cd DB-GPT
|
```bash
|
||||||
conda env create -f environment.yml
|
$ conda env create -f environment.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
2. MySQL Install
|
### 2. MySQL
|
||||||
|
|
||||||
In this project examples, we connect mysql and run SQL-Generate. so you need install mysql local for test. recommand docker
|
In this project examples, we connect mysql and run SQL-Generate. so you need install mysql local for test. recommand docker
|
||||||
```
|
|
||||||
docker run --name=mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=aa12345678 -dit mysql:latest
|
|
||||||
```
|
|
||||||
The password just for test, you can change this if necessary
|
|
||||||
|
|
||||||
# Install
|
```bash
|
||||||
1. 基础模型下载
|
$ docker run --name=mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=aa12345678 -dit mysql:latest
|
||||||
关于基础模型, 可以根据[vicuna](https://github.com/lm-sys/FastChat/blob/main/README.md#model-weights)合成教程进行合成。
|
|
||||||
如果此步有困难的同学,也可以直接使用[Hugging Face](https://huggingface.co/)上的模型进行替代. [替代模型](https://huggingface.co/Tribbiani/vicuna-7b)
|
|
||||||
|
|
||||||
2. Run model server
|
|
||||||
```
|
|
||||||
cd pilot/server
|
|
||||||
python vicuna_server.py
|
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Run gradio webui
|
### 3. LLM
|
||||||
```
|
|
||||||
python webserver.py
|
- [vicuna](https://github.com/lm-sys/FastChat/blob/main/README.md#model-weights)
|
||||||
|
- [Hugging Face](https://huggingface.co/Tribbiani/vicuna-7b)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cd pilot/server
|
||||||
|
$ python vicuna_server.py
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 基于阿里云部署指南
|
Run gradio webui
|
||||||
[阿里云部署指南](https://open.oceanbase.com/blog/3278046208)
|
|
||||||
|
|
||||||
# Featurs
|
```bash
|
||||||
- SQL-Generate
|
$ python webserver.py
|
||||||
- Database-QA Based Knowledge
|
```
|
||||||
- SQL-diagnosis
|
|
||||||
|
|
||||||
总的来说,它是一个用于数据库的复杂且创新的AI工具。如果您对如何在工作中使用或实施DB-GPT有任何具体问题,请联系我, 我会尽力提供帮助, 同时也欢迎大家参与到项目建设中, 做一些有趣的事情。
|
## Thanks
|
||||||
|
|
||||||
<img src="https://github.com/csunny/DB-GPT/blob/main/asserts/wechat.jpg" width="400" margin-left="auto" margin-right="auto" >
|
- [FastChat](https://github.com/lm-sys/FastChat)
|
||||||
|
- [vicuna-13b](https://huggingface.co/Tribbiani/vicuna-13b)
|
||||||
|
- [langchain](https://github.com/hwchase17/langchain)
|
||||||
|
- [llama-index](https://github.com/jerryjliu/llama_index) and [In-Context Learning](https://arxiv.org/abs/2301.00234)
|
||||||
|
|
||||||
# Contribute
|
## Licence
|
||||||
[Contribute](https://github.com/csunny/DB-GPT/blob/main/CONTRIBUTING)
|
|
||||||
# Licence
|
The MIT License (MIT)
|
||||||
[MIT](https://github.com/csunny/DB-GPT/blob/main/LICENSE)
|
|
||||||
|
25
README.md
@ -18,7 +18,7 @@
|
|||||||
## 架构方案
|
## 架构方案
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="./asserts/DB-GPT.png" width="740px" />
|
<img src="./assets/DB-GPT.png" width="600px" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
DB-GPT 基于[FastChat](https://github.com/lm-sys/FastChat) 构建大模型运行环境,并提供 vicuna 作为基础的大语言模型。此外,我们通过 langchain 和 llama-index 提供私域知识库问答能力。
|
DB-GPT 基于[FastChat](https://github.com/lm-sys/FastChat) 构建大模型运行环境,并提供 vicuna 作为基础的大语言模型。此外,我们通过 langchain 和 llama-index 提供私域知识库问答能力。
|
||||||
@ -29,7 +29,7 @@ DB-GPT 基于[FastChat](https://github.com/lm-sys/FastChat) 构建大模型运
|
|||||||
### 运行环境演示
|
### 运行环境演示
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="./asserts/演示.gif" width="680px" />
|
<img src="./assets/演示.gif" width="600px" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
### SQL 生成
|
### SQL 生成
|
||||||
@ -37,30 +37,30 @@ DB-GPT 基于[FastChat](https://github.com/lm-sys/FastChat) 构建大模型运
|
|||||||
首先选择对应的数据库, 然后模型即可根据对应的数据库 Schema 信息生成 SQL。
|
首先选择对应的数据库, 然后模型即可根据对应的数据库 Schema 信息生成 SQL。
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="./asserts/SQLGEN.png" width="680px" />
|
<img src="./assets/SQLGEN.png" width="600px" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
运行成功的效果如下面的演示:
|
运行成功的效果如下面的演示:
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="./asserts/exeable.png" width="680px" />
|
<img src="./assets/exeable.png" width="600px" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
### 数据库问答
|
### 数据库问答
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="./asserts/DB_QA.png" width="680px" />
|
<img src="./assets/DB_QA.png" width="600px" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
基于默认内置知识库。
|
基于默认内置知识库。
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="./asserts/VectorDBQA.png" width="680px" />
|
<img src="./assets/VectorDBQA.png" width="600px" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## 部署
|
## 部署
|
||||||
|
|
||||||
### 1. 安装 Python 依赖的模块。
|
### 1. 安装 Python
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ python>=3.9
|
$ python>=3.9
|
||||||
@ -109,16 +109,23 @@ $ python webserver.py
|
|||||||
- [llama-index](https://github.com/jerryjliu/llama_index) 基于现有知识库进行[In-Context Learning](https://arxiv.org/abs/2301.00234)来对其进行数据库相关知识的增强。
|
- [llama-index](https://github.com/jerryjliu/llama_index) 基于现有知识库进行[In-Context Learning](https://arxiv.org/abs/2301.00234)来对其进行数据库相关知识的增强。
|
||||||
|
|
||||||
<!-- GITCONTRIBUTOR_START -->
|
<!-- GITCONTRIBUTOR_START -->
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
|[<img src="https://avatars.githubusercontent.com/u/17919400?v=4" width="100px;"/><br/><sub><b>csunny</b></sub>](https://github.com/csunny)<br/>|
|
|[<img src="https://avatars.githubusercontent.com/u/17919400?v=4" width="100px;"/><br/><sub><b>csunny</b></sub>](https://github.com/csunny)<br/>|[<img src="https://avatars.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|
|
||||||
| :---: | :---: |
|
| :---: | :---: |
|
||||||
|
|
||||||
|
|
||||||
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sun May 14 2023 22:37:46 GMT+0800`.
|
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sun May 14 2023 23:02:43 GMT+0800`.
|
||||||
|
|
||||||
<!-- GITCONTRIBUTOR_END -->
|
<!-- GITCONTRIBUTOR_END -->
|
||||||
|
|
||||||
|
这是一个用于数据库的复杂且创新的工具,如有任何具体问题,请联系如下微信,我会尽力提供帮助,同时也欢迎参与到项目建设中。
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="./assets/wechat.jpg" width="320px" />
|
||||||
|
</p>
|
||||||
|
|
||||||
## Licence
|
## Licence
|
||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 243 KiB |
Before Width: | Height: | Size: 297 KiB |
Before Width: | Height: | Size: 560 KiB |
Before Width: | Height: | Size: 277 KiB |
Before Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 164 KiB |
Before Width: | Height: | Size: 323 KiB |
BIN
asserts/演示.gif
Before Width: | Height: | Size: 3.0 MiB |