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.
- Open AI(Proxy LLM)
- glm-4(Local LLM)
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 .env
file
# .env
LLM_MODEL=chatgpt_proxyllm
PROXY_API_KEY={your-openai-sk}
PROXY_SERVER_URL=https://api.openai.com/v1/chat/completions
Hardware requirements description
Model | GPU VRAM Size |
---|---|
glm-4-9b | 16GB |
Download LLM
cd DB-GPT
mkdir models and cd models
# embedding model
git clone https://huggingface.co/GanymedeNil/text2vec-large-chinese
# also you can use m3e-large model, you can choose one of them according to your needs
# git clone https://huggingface.co/moka-ai/m3e-large
# LLM model, if you use openai or Azure or tongyi llm api service, you don't need to download llm model
git clone https://huggingface.co/THUDM/glm-4-9b-chat
Environment variable configuration, configure the LLM_MODEL parameter in the .env
file
# .env
LLM_MODEL=glm-4-9b-chat
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
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