跳到主要内容
版本:dev

Quickstart

DB-GPT supports the installation and use of a variety of open source and closed models. Different models have different requirements for environment and resources. If localized model deployment is required, GPU resources are required for deployment. The API proxy model requires relatively few resources and can be deployed and started on a CPU machine.

note
  • Detailed installation and deployment tutorials can be found in Installation.
  • This page only introduces deployment based on ChatGPT proxy and local glm model.

Environmental preparation

Download source code

提示

Download DB-GPT

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

Miniconda environment installation

  • The default database uses SQLite, so there is no need to install a database in the default startup mode. If you need to use other databases, you can read the advanced tutorials below. We recommend installing the Python virtual environment through the conda virtual environment. For the installation of Miniconda environment, please refer to the Miniconda installation tutorial.
提示

Create a Python virtual environment

python >= 3.10
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env

# it will take some minutes
pip install -e ".[default]"
提示

Copy environment variables

cp .env.template  .env

Model deployment

note

Provide two deployment methods to quickly start experiencing DB-GPT.

note

⚠️ You need to ensure that git-lfs is installed

● CentOS installation: yum install git-lfs
● Ubuntu installation: apt-get install git-lfs
● MacOS installation: brew install git-lfs

Install dependencies

pip install  -e ".[openai]"

Download embedding model

cd DB-GPT
mkdir models and cd models
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese

Configure the proxy and modify LLM_MODEL, PROXY_API_URL and API_KEY in the .envfile

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

Test data (optional)

Load default test data into SQLite database

  • Linux
bash ./scripts/examples/load_examples.sh
  • Windows
.\scripts\examples\load_examples.bat

Run service

python dbgpt/app/dbgpt_server.py
NOTE

Run old service

If you are running version v0.4.3 or earlier, please start with the following command:

python pilot/server/dbgpt_server.py

Run DB-GPT with command dbgpt

If you want to run DB-GPT with the command dbgpt:

dbgpt start webserver

Visit website

Open the browser and visit http://localhost:5670

(Optional) Run web front-end separately

On the other hand, you can also run the web front-end separately.

cd web & npm install
cp .env.template .env
// set the API_BASE_URL to your DB-GPT server address, it usually is http://localhost:5670
npm run dev

Open the browser and visit http://localhost:3000