Installation From Source#

To get started, install DB-GPT with the following steps.

1.Preparation#

Download DB-GPT

git clone https://github.com/eosphoros-ai/DB-GPT.git

Install Miniconda

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

python>=3.10
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env
# it will take some minutes
pip install -e ".[default]"
cp .env.template .env

2.Deploy LLM Service#

DB-GPT can be deployed on servers with low hardware requirements or on servers with high hardware requirements.

If you are low hardware requirements you can install DB-GPT by Using third-part LLM REST API Service OpenAI, Azure, tongyi.

Tip

As our project has the ability to achieve OpenAI performance of over 85%,

Note

Notice make sure you have install git-lfs

centos:yum install git-lfs

ubuntu:apt-get install git-lfs

macos:brew install git-lfs

Installing Dependencies

pip install -e ".[openai]"

Download embedding model

cd DB-GPT
mkdir models and cd models

#### embedding model
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
or
git clone https://huggingface.co/moka-ai/m3e-large

Configure LLM_MODEL, PROXY_API_URL and API_KEY in .env file

LLM_MODEL=chatgpt_proxyllm
PROXY_API_KEY={your-openai-sk}
PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions

Tip

Make sure your .env configuration is not overwritten

3.Prepare sql example(Optional)#

(Optional) load examples into SQLite

bash ./scripts/examples/load_examples.sh

On windows platform:

.\scripts\examples\load_examples.bat

4.Run db-gpt server#

python pilot/server/dbgpt_server.py

Open http://localhost:5000 with your browser to see the product.