Source Code Deployment
Deploy DB-GPT directly from source code. This is the most flexible option for development, debugging, and custom integrations.
Hardware requirementsâ
| Mode | CPU Ã RAM | GPU | Notes |
|---|---|---|---|
| API proxy | 4C Ã 8 GB | None | Proxy mode does not use local GPU |
| Local model | 8C Ã 32 GB | âĨ 24 GB VRAM | NVIDIA GPU with CUDA support |
Step 1 â Clone the repositoryâ
git clone https://github.com/eosphoros-ai/DB-GPT.git
cd DB-GPT
Step 2 â Install uvâ
- macOS / Linux
- PyPI (pipx)
curl -LsSf https://astral.sh/uv/install.sh | sh
python -m pip install --upgrade pip
python -m pip install --upgrade pipx
python -m pipx ensurepath
pipx install uv --global
Verify:
uv --version
Step 3 â Install dependenciesâ
- OpenAI (proxy)
- DeepSeek (proxy)
- Ollama (local)
- Local GPU (HuggingFace)
uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \
--extra "storage_chromadb" \
--extra "dbgpts"
uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \
--extra "storage_chromadb" \
--extra "dbgpts"
DeepSeek uses the OpenAI-compatible proxy, so the extras are the same as OpenAI.
uv sync --all-packages \
--extra "base" \
--extra "proxy_ollama" \
--extra "rag" \
--extra "storage_chromadb" \
--extra "dbgpts"
uv sync --all-packages \
--extra "base" \
--extra "cuda121" \
--extra "hf" \
--extra "rag" \
--extra "storage_chromadb" \
--extra "quant_bnb" \
--extra "dbgpts"
Use the interactive install helper
DB-GPT provides an interactive helper to generate the right uv sync command:
uv run install_help.py install-cmd --interactive
Or list all available extras:
uv run install_help.py list
Step 4 â Configure your modelâ
Edit the TOML config file for your chosen provider. See Model Providers for details.
- OpenAI
- DeepSeek
- Ollama
Edit configs/dbgpt-proxy-openai.toml:
[models]
[[models.llms]]
name = "chatgpt_proxyllm"
provider = "proxy/openai"
api_key = "your-openai-api-key" # <-- replace
[[models.embeddings]]
name = "text-embedding-3-small"
provider = "proxy/openai"
api_key = "your-openai-api-key" # <-- replace
Edit configs/dbgpt-proxy-deepseek.toml:
[models]
[[models.llms]]
name = "deepseek-reasoner"
provider = "proxy/deepseek"
api_key = "your-deepseek-api-key" # <-- replace
[[models.embeddings]]
name = "BAAI/bge-large-zh-v1.5"
provider = "hf"
If using a HuggingFace embedding, also add --extra "hf" and --extra "cpu" to the install command.
Make sure Ollama is running, then edit configs/dbgpt-proxy-ollama.toml:
[models]
[[models.llms]]
name = "qwen2.5:latest"
provider = "proxy/ollama"
api_base = "http://localhost:11434"
[[models.embeddings]]
name = "nomic-embed-text:latest"
provider = "proxy/ollama"
api_base = "http://localhost:11434"
Use "${env:OPENAI_API_KEY}" syntax in TOML to read from environment variables instead of hardcoding keys.
Step 5 â Start the serverâ
- OpenAI
- DeepSeek
- Ollama
uv run dbgpt start webserver --config configs/dbgpt-proxy-openai.toml
uv run dbgpt start webserver --config configs/dbgpt-proxy-deepseek.toml
uv run dbgpt start webserver --config configs/dbgpt-proxy-ollama.toml
Step 6 â Open the Web UIâ
Open your browser and visit http://localhost:5670.
If the Web UI loads and you can start a chat conversation, your DB-GPT is running.
Common first-run issuesâ
uv syncfails- Re-check Python and uv: Prerequisites
- If you are in China, use a mirror via
UV_INDEX_URL
- Provider auth fails
- Verify the selected TOML file under
configs/ - Check the matching provider guide: Model Providers
- Verify the selected TOML file under
- Server starts but UI is blank
- Confirm the terminal shows the webserver started cleanly
- Check whether another process is already using port
5670
Database configurationâ
- SQLite (default)
- MySQL
SQLite is the default â tables are created automatically. No extra setup needed.
[service.web.database]
type = "sqlite"
path = "pilot/meta_data/dbgpt.db"
- Create the database:
mysql -h127.0.0.1 -uroot -p{your_password} < ./assets/schema/dbgpt.sql
- Update your TOML config:
[service.web.database]
type = "mysql"
host = "127.0.0.1"
port = 3306
user = "root"
database = "dbgpt"
password = "your-password"
Load test data (optional)â
# Linux / macOS
bash ./scripts/examples/load_examples.sh
# Windows
.\scripts\examples\load_examples.bat
Run web front-end separately (optional)â
For front-end development or custom UI work:
cd web && npm install
cp .env.template .env
# Edit .env â set API_BASE_URL=http://localhost:5670
npm run dev
Open http://localhost:3000.
Next stepsâ
| Topic | Link |
|---|---|
| Configure more model providers | Model Providers |
| Deploy with Docker | Docker |
| Deploy as a cluster | Cluster |
| Explore the Web UI | Web UI Guide |