Readme: update english version

This commit is contained in:
csunny 2023-05-16 20:12:03 +08:00
parent bd98a1eb83
commit ce2d312182

View File

@ -1,106 +1,99 @@
# DB-GPT # DB-GPT ![GitHub Repo stars](https://img.shields.io/github/stars/csunny/db-gpt?style=social)
--- ---
[中文版](README.md) [中文版](README.md)
A Open Database-GPT Experiment, interact your data and environment using the local GPT, no data leaks, 100% privately, 100% security. ## What is DB-GPT?
As large models are released and iterated upon, they are becoming increasingly intelligent. However, in the process of using large models, we face significant challenges in data security and privacy. We need to ensure that our sensitive data and environments remain completely controlled and avoid any data privacy leaks or security risks. Based on this, we have launched the DB-GPT project to build a complete private large model solution for all database-based scenarios. This solution supports local deployment, allowing it to be applied not only in independent private environments but also to be independently deployed and isolated according to business modules, ensuring that the ability of large models is absolutely private, secure, and controllable.
DB-GPT is an experimental open-source project that uses localized GPT large models to interact with your data and environment. With this solution, you can be assured that there is no risk of data leakage, and your data is 100% private and secure.
## Features ## Features
We have currently released various features, which are listed below to showcase the capabilities that have been released so far: Currently, we have released multiple key features, which are listed below to demonstrate our current capabilities:
- SQL language capabilities - SQL language capabilities
- SQL generation - SQL generation
- SQL diagnosis - SQL diagnosis
- Private domain Q&A and data processing - Private domain Q&A and data processing
- Database knowledge Q&A - Database knowledge Q&A
- Data processing - Data processing
- Plugin model - Plugins
- Supports custom plugins to perform tasks, with native support for Auto-GPT plugins. For example: - Support custom plugin execution tasks and natively support the Auto-GPT plugin, such as:
- Automatic SQL execution to obtain query results - Automatic execution of SQL and retrieval of query results
- Automatic crawling of learning knowledge - Automatic crawling and learning of knowledge
- Vector storage/indexing of knowledge base - Unified vector storage/indexing of knowledge base
- Support for unstructured data - Support for unstructured data such as PDF, Markdown, CSV, and WebURL
- PDF, Markdown, CSV, WebURL
## Demo ## Demo
Run on an RTX 4090 GPU. [YouTube](https://www.youtube.com/watch?v=1PWI6F89LPo) Run on an RTX 4090 GPU. [YouTube](https://www.youtube.com/watch?v=1PWI6F89LPo)
### Run ### Run
<p align="center"> <p align="center">
<img src="./assets/演示.gif" width="600px" /> <img src="./assets/demo_en.gif" width="600px" />
</p> </p>
### SQL Generation
1. Generate Create Table SQL
<p align="center"> <p align="center">
<img src="./assets/Auto-DB-GPT.gif" width="600px" /> <img src="./assets/SQL_Gen_CreateTable_en.png" width="600px" />
</p> </p>
### SQL Generate 2. Generating executable SQL:To generate executable SQL, first select the corresponding database and then the model can generate SQL based on the corresponding database schema information. The successful result of running it would be demonstrated as follows:
1. Generate SQL based on schema information.
<p align="center"> <p align="center">
<img src="./assets/SQL_Gen_CreateTable.png" width="600px" /> <img src="./assets/exeable_en.png" width="600px" />
</p>
2. Generate executable SQL.
First, select the corresponding database, and then the model can generate SQL based on the corresponding database schema information. The successful execution result is demonstrated below:
<p align="center">
<img src="./assets/exeable.png" width="600px" />
</p> </p>
### Q&A ### Q&A
<p align="center"> <p align="center">
<img src="./assets/DB_QA.png" width="600px" /> <img src="./assets/DB_QA_en.png" width="600px" />
</p> </p>
1. Based on the default built-in knowledge base, question and answer. 1. Based on the default built-in knowledge base, question and answer.
- TODO
<p align="center">
<img src="./assets/VectorDBQA.png" width="600px" />
</p>
2. Add your own knowledge base. 2. Add your own knowledge base.
<p align="center"> - TODO
<img src="./assets/new_knownledge.gif" width="600px" />
</p>
3. Learn by scraping data from the internet. 3. Learning from crawling data from the Internet
- TODO
- TODO
## Architecture Design ## Introduction
[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 creates a vast model operating system using [FastChat](https://github.com/lm-sys/FastChat) and offers a large language model powered by [Vicuna](https://huggingface.co/Tribbiani/vicuna-7b). In addition, we provide private domain knowledge base question-answering capability through LangChain. Furthermore, we also provide support for additional plugins, and our design natively supports the Auto-GPT plugin.
Is the architecture of the entire DB-GPT shown in the following figure:
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.
<p align="center"> <p align="center">
<img src="./assets/DB-GPT.png" width="600px" /> <img src="./assets/DB-GPT.png" width="600px" />
</p> </p>
The core capabilities mainly include the following parts: The core capabilities mainly consist of the following parts:
1. Knowledge base capability: Supports private domain knowledge base question-answering capability.
1. Knowledge base 2. Large-scale model management capability: Provides a large model operating environment based on FastChat.
2. LLMs management 3. Unified data vector storage and indexing: Provides a uniform way to store and index various data types.
3. Vector storage and indexing 4. Connection module: Used to connect different modules and data sources to achieve data flow and interaction.
4. Connections 5. Agent and plugins: Provides Agent and plugin mechanisms, allowing users to customize and enhance the system's behavior.
5. Agent and plugins 6. Prompt generation and optimization: Automatically generates high-quality prompts and optimizes them to improve system response efficiency.
6. Prompt generation and optimization 7. Multi-platform product interface: Supports various client products, such as web, mobile applications, and desktop applications.
7. Multi-end product interface
Below is a brief introduction to each module: Below is a brief introduction to each module:
### Knowledge Base ### Knowledge base capability
As the most important scenario for current user needs, we natively support the construction and processing of knowledge bases. At the same time, in this project, we also provide various knowledge base management strategies, such as: As the knowledge base is currently the most significant user demand scenario, we natively support the construction and processing of knowledge bases. At the same time, we also provide multiple knowledge base management strategies in this project, such as:
1. Default built-in knowledge base 1. Default built-in knowledge base
2. Customized new knowledge base 2. Custom addition of knowledge bases
3. Building knowledge bases through plug-in capabilities and other usage scenarios. 3. Various usage scenarios such as constructing knowledge bases through plugin capabilities and web crawling. Users only need to organize the knowledge documents, and they can use our existing capabilities to build the knowledge base required for the large model.
Users only need to organize their knowledge documents and use our existing capabilities to build the knowledge base required for large models.
### LLMs Management ### LLMs Management
@ -126,7 +119,7 @@ Prompt is a very important part of the interaction between the large model and t
TODO: In terms of terminal display, we will provide a multi-platform product interface, including PC, mobile phone, command line, Slack and other platforms. TODO: In terms of terminal display, we will provide a multi-platform product interface, including PC, mobile phone, command line, Slack and other platforms.
## Deployment ## Deployment
### 1. Hardware Requirements ### 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: 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:
@ -136,6 +129,7 @@ As our project has the ability to achieve ChatGPT performance of over 85%, there
| RTX 4090 | 24 GB | Smooth conversation inference | | RTX 4090 | 24 GB | Smooth conversation inference |
| RTX 3090 | 24 GB | Smooth conversation inference, better than V100 | | RTX 3090 | 24 GB | Smooth conversation inference, better than V100 |
| V100 | 16 GB | Conversation inference possible, noticeable stutter | | V100 | 16 GB | Conversation inference possible, noticeable stutter |
### 2. Install ### 2. Install
This project relies on a local MySQL database service, which you need to install locally. We recommend using Docker for installation. This project relies on a local MySQL database service, which you need to install locally. We recommend using Docker for installation.
@ -160,36 +154,41 @@ It is recommended to set the Python package path to avoid runtime errors due to
``` ```
echo "/root/workspace/DB-GPT" > /root/miniconda3/env/dbgpt_env/lib/python3.10/site-packages/dbgpt.pth echo "/root/workspace/DB-GPT" > /root/miniconda3/env/dbgpt_env/lib/python3.10/site-packages/dbgpt.pth
``` ```
Notice: You need replace the path to your owner.
### 3. Run ### 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) . 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. 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.
1. Run server
```bash ```bash
$ cd pilot/server $ python pilot/server/llmserver.py
$ python vicuna_server.py
``` ```
Run gradio webui Run gradio webui
```bash ```bash
$ python webserver.py $ python pilot/server/webserver.py
``` ```
Notice: the webserver need to connect llmserver, so you need change the pilot/configs/model_config.py file. change the VICUNA_MODEL_SERVER = "http://127.0.0.1:8000" to your address. It's very important.
## Usage Instructions ## Usage Instructions
We provide a user interface for Gradio, which allows you to use DB-GPT through our user interface. Additionally, we have prepared several reference articles (written in Chinese) that introduce the code and principles related to our project. We provide a user interface for Gradio, which allows you to use DB-GPT through our user interface. Additionally, we have prepared several reference articles (written in Chinese) that introduce the code and principles related to our project.
1. [大模型实战系列(1) —— 强强联合Langchain-Vicuna应用实战](https://zhuanlan.zhihu.com/p/628750042) - [LLM Practical In Action Series (1) — Combined Langchain-Vicuna Application Practical](https://medium.com/@cfqcsunny/llm-practical-in-action-series-1-combined-langchain-vicuna-application-practical-701cd0413c9f)
2. [大模型实战系列(2) —— DB-GPT 阿里云部署指南](https://zhuanlan.zhihu.com/p/629467580)
3. [大模型实战系列(3) —— DB-GPT插件模型原理与使用](https://zhuanlan.zhihu.com/p/629623125)
## Thanks ## Acknowledgement
- [FastChat](https://github.com/lm-sys/FastChat) The achievements of this project are thanks to the technical community, especially the following projects:
- [vicuna-13b](https://huggingface.co/Tribbiani/vicuna-13b) - FastChat for providing chat services
- [langchain](https://github.com/hwchase17/langchain) - vicuna-13b as the base model
- [llama-index](https://github.com/jerryjliu/llama_index) and [In-Context Learning](https://arxiv.org/abs/2301.00234) - langchain tool chain
- Auto-GPT universal plugin template
- Hugging Face for big model management
- Chroma for vector storage
- Milvus for distributed vector storage
- ChatGLM as the base model
- llama-index for enhancing database-related knowledge using in-context learning based on existing knowledge bases.
<!-- GITCONTRIBUTOR_START --> <!-- GITCONTRIBUTOR_START -->