Interact your data and environment using the local GPT, no data leaks, 100% privately, 100% security
Go to file
2023-05-16 18:06:11 +08:00
.github/workflows Create python-publish.yml 2023-04-29 23:30:55 +08:00
assets Add: assets 2023-05-15 22:03:55 +08:00
docs add file 2023-04-28 22:50:44 +08:00
examples convert file address 2023-05-15 17:27:55 +08:00
pilot feature:merge source-embedding 2023-05-15 23:15:47 +08:00
plugins fix:unusual file 2023-05-15 00:18:06 +08:00
tests fix:unusual file 2023-05-15 00:18:06 +08:00
.env.template Add: config 2023-05-09 11:18:06 +08:00
.gitignore Merge remote-tracking branch 'origin/plugin_init' into source_embedding 2023-05-12 21:06:00 +08:00
CONTRIBUTING.md rm oceanbase document 2023-05-08 23:01:52 +08:00
docker-compose.yml Update: python version set 3.10 2023-05-15 15:25:26 +08:00
Dockerfile Update: python version set 3.10 2023-05-15 15:25:26 +08:00
environment.yml Update: python version set 3.10 2023-05-15 15:25:26 +08:00
LICENSE Initial commit 2023-04-13 22:52:44 +08:00
README.en.md Update README.en.md 2023-05-16 18:06:11 +08:00
README.md Update README.md 2023-05-16 18:03:18 +08:00
requirements.txt fix 2023-05-12 18:23:49 +08:00
run.sh Update: python version set 3.10 2023-05-15 15:25:26 +08:00
SECURITY.md Create SECURITY.md 2023-05-13 15:59:34 +08:00

DB-GPT


中文版

A Open Database-GPT Experiment, interact your data and environment using the local GPT, no data leaks, 100% privately, 100% security.

Features

We have currently released various features, which are listed below to showcase the capabilities that have been released so far:

  • SQL language capabilities
    • SQL generation
    • SQL diagnosis
  • Private domain Q&A and data processing
    • Database knowledge Q&A
    • Data processing
  • Plugin model
    • Supports custom plugins to perform tasks, with native support for Auto-GPT plugins. For example:
      • Automatic SQL execution to obtain query results
      • Automatic crawling of learning knowledge
  • Vector storage/indexing of knowledge base
    • Support for unstructured data
    • PDF, Markdown, CSV, WebURL

Demo

Run on an RTX 4090 GPU. YouTube

Run

SQL Generate

  1. Generate SQL based on schema information.

  1. 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:

Q&A

  1. Based on the default built-in knowledge base, question and answer.

  1. Add your own knowledge base.

  1. Learn by scraping data from the internet.
  • TODO

Architecture Design

DB-GPT is an experimental open-source application that builds upon the 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.

The core capabilities mainly include the following parts:

  1. Knowledge base
  2. LLMs management
  3. Vector storage and indexing
  4. Connections
  5. Agent and plugins
  6. Prompt generation and optimization
  7. Multi-end product interface

Below is a brief introduction to each module:

Knowledge Base

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:

  1. Default built-in knowledge base
  2. Customized new knowledge base
  3. Building knowledge bases through plug-in capabilities and other usage scenarios.

Users only need to organize their knowledge documents and use our existing capabilities to build the knowledge base required for large models.

LLMs Management

In the underlying large model integration, we have designed an open interface that supports integration with various large models. At the same time, we have a very strict control and evaluation mechanism for the effectiveness of the integrated models. In terms of accuracy, the integrated models need to align with the capability of ChatGPT at a level of 85% or higher. We use higher standards to select models, hoping to save users the cumbersome testing and evaluation process in the process of use.

Vector storage and indexing

In order to facilitate the management of knowledge after vectorization, we have built-in multiple vector storage engines, from memory-based Chroma to distributed Milvus. Users can choose different storage engines according to their own scenario needs. The storage of knowledge vectors is the cornerstone of AI capability enhancement. As the intermediate language for interaction between humans and large language models, vectors play a very important role in this project.

Connections

In order to interact more conveniently with users' private environments, the project has designed a connection module, which can support connection to databases, Excel, knowledge bases, and other environments to achieve information and data exchange.

Agent and Plugin

The ability of Agent and Plugin is the core of whether large models can be automated. In this project, we natively support the plugin mode, and large models can automatically achieve their goals. At the same time, in order to give full play to the advantages of the community, the plugins used in this project natively support the Auto-GPT plugin ecology, that is, Auto-GPT plugins can directly run in our project.

Prompt Automatic Generation and Optimization

Prompt is a very important part of the interaction between the large model and the user, and to a certain extent, it determines the quality and accuracy of the answer generated by the large model. In this project, we will automatically optimize the corresponding prompt according to user input and usage scenarios, making it easier and more efficient for users to use large language models.

Multi-Platform Product Interface

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

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

2. Install

This project relies on a local MySQL database service, which you need to install locally. We recommend using Docker for installation.

$ docker run --name=mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=aa12345678 -dit mysql:latest

We use Chroma embedding database as the default for our vector database, so there is no need for special 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.

python>=3.10
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env
pip install -r requirements.txt

Alternatively, you can use the following command:

cd DB-GPT
conda env create -f environment.yml

It is recommended to set the Python package path to avoid runtime errors due to package not found.

echo "/root/workspace/DB-GPT" > /root/miniconda3/env/dbgpt_env/lib/python3.10/site-packages/dbgpt.pth 

3. Run

You can refer to this document to obtain the Vicuna weights: Vicuna If you have difficulty with this step, you can also directly use the model from this link as a replacement.

$ cd pilot/server
$ python vicuna_server.py

Run gradio webui

$ python webserver.py 

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.

  1. 大模型实战系列(1) —— 强强联合Langchain-Vicuna应用实战
  2. 大模型实战系列(2) —— DB-GPT 阿里云部署指南
  3. 大模型实战系列(3) —— DB-GPT插件模型原理与使用

Thanks

Contributors


csunny


xudafeng


明天


Aries-ckt


thebigbone

This project follows the git-contributor spec, auto updated at Sun May 14 2023 23:02:43 GMT+0800.

Licence

The MIT License (MIT)