CLI Quick Start
Install DB-GPT from PyPI and start it with a single command â no source checkout required.
- Python 3.10 or later
- uv package manager (recommended) or pip
1. Installâ
# Recommended: use uv
uv pip install dbgpt-app
# Or with pip
pip install dbgpt-app
The default installation includes the core framework (CLI, FastAPI, SQLAlchemy, Agent), OpenAI-compatible LLM support (also works with Kimi, Qwen, MiniMax, Z.AI), DashScope / Tongyi support, RAG document parsing, and ChromaDB vector store.
Need additional providers or data sources? See Optional Modules.
After installation the dbgpt command is available in your terminal.
2. Start DB-GPTâ
dbgpt start
That's it! On first run DB-GPT will launch an interactive setup wizard that helps you:
- Choose an LLM provider (OpenAI, Kimi, Qwen, MiniMax, Z.AI, or a custom endpoint)
- Enter your API key (or use an environment variable)
- Confirm the model names and API base URL
Once complete, a TOML configuration file is written to ~/.dbgpt/configs/<profile>.toml and the web server starts automatically.
What the startup looks likeâ
____ ____ ____ ____ _____
| _ \| __ ) / ___| _ \_ _|
| | | | _ \ ____| | _| |_) || |
| |_| | |_) |____| |_| | __/ | |
|____/|____/ \____|_| |_|
đ DB-GPT Quick Start
+- - - - - - - - - - - - - - - - - - - - - - - -+
: Profile: openai :
: Config: /Users/you/.dbgpt/configs/openai.toml:
: Workspace: /Users/you/.dbgpt/workspace :
+- - - - - - - - - - - - - - - - - - - - - - - -+
3. Open the Web UIâ
Then open http://localhost:5670.
4. Command Referenceâ
Overviewâ
dbgpt [OPTIONS] COMMAND [ARGS]...
Options:
--log-level TEXT Log level (default: warn)
--version Show version and exit
--help Show help message
Commands:
start Start the DB-GPT server
stop Stop a running server
setup Configure LLM provider (interactive wizard or CI mode)
profile Manage configuration profiles
knowledge Knowledge base operations
model Manage model serving
db Database management and migration
...
dbgpt startâ
Start the DB-GPT web server. Running dbgpt start without a subcommand is equivalent to dbgpt start web.
Subcommandsâ
| Subcommand | Description |
|---|---|
web (or webserver) | Start the web server (default) |
none | API-only mode â planned for a future release |
controller | Start the model controller |
worker | Start a model worker |
apiserver | Start the API server |
dbgpt start web Optionsâ
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--config | -c | PATH | auto | Path to a TOML config file. If omitted, uses the active profile or launches the setup wizard. |
--profile | -p | TEXT | active | Provider profile name (openai, kimi, qwen, minimax, glm, custom). Overrides the active profile. |
--yes | -y | FLAG | false | Non-interactive mode: skip the wizard and use defaults / environment variables. Ideal for CI/CD. |
--api-key | TEXT | env | API key for the chosen provider. Can also be set via the provider's own environment variable. | |
--daemon | -d | FLAG | false | Run as a background daemon. Stop with dbgpt stop webserver. |
Examplesâ
# Interactive (first run) â wizard will guide you
dbgpt start
# Use an existing profile
dbgpt start web --profile openai
# Non-interactive with explicit API key
dbgpt start web --profile kimi --api-key sk-xxx --yes
# Use a specific config file
dbgpt start web --config /path/to/my-config.toml
# Run as a daemon
dbgpt start web --daemon
Config Resolution Priorityâ
When the web server starts, the configuration file is resolved in this order:
--configflag â if specified, use this file directly--profileflag â look up~/.dbgpt/configs/<profile>.toml- Active profile â read from
~/.dbgpt/config.toml - Setup wizard â if nothing is configured yet, launch the interactive wizard
dbgpt stopâ
Stop running DB-GPT server processes.
# Stop the web server
dbgpt stop webserver
# Stop the web server on a specific port
dbgpt stop webserver --port 5670
# Stop all servers
dbgpt stop all
dbgpt setupâ
Configure the LLM provider interactively, or in non-interactive / CI mode. This command writes a TOML config to ~/.dbgpt/configs/<profile>.toml and marks it as the active profile.
Optionsâ
| Option | Short | Type | Default | Description |
|---|---|---|---|---|
--profile | -p | TEXT | interactive | Provider profile to configure. If omitted, an interactive menu is shown. |
--yes | -y | FLAG | false | Non-interactive mode: skip the wizard and use defaults. |
--api-key | TEXT | env | API key. Also reads DBGPT_API_KEY env var. | |
--show | FLAG | false | Show the current active profile and config path, then exit. |
Examplesâ
# Interactive wizard
dbgpt setup
# Non-interactive: use OpenAI with env key
export OPENAI_API_KEY=sk-xxx
dbgpt setup --profile openai --yes
# Non-interactive with explicit key
dbgpt setup --profile kimi --api-key sk-xxx
# Show current configuration
dbgpt setup --show
dbgpt profileâ
Manage multiple configuration profiles. Each profile is a TOML file under ~/.dbgpt/configs/.
Subcommandsâ
| Subcommand | Description |
|---|---|
list | List all profiles. The active one is marked with *. |
show <name> | Display the TOML content of a profile. |
create <name> | Create (or reconfigure) a profile using the setup wizard. |
switch <name> | Set a profile as the active default. |
delete <name> | Delete a profile configuration file. |
Examplesâ
# List all profiles
dbgpt profile list
# openai â no asterisk
# * kimi â active
# Show profile content
dbgpt profile show openai
# Create a new profile
dbgpt profile create qwen
# Switch active profile
dbgpt profile switch openai
# Delete a profile
dbgpt profile delete minimax
dbgpt profile delete minimax --yes # skip confirmation
5. Supported Providersâ
The setup wizard and --profile flag support the following providers:
| Profile Name | Display Name | LLM Model | Embedding Model | API Key Env Var |
|---|---|---|---|---|
openai | OpenAI | gpt-4o | text-embedding-3-small | OPENAI_API_KEY |
kimi | Kimi | kimi-k2 | text-embedding-v3 | MOONSHOT_API_KEY (+ DASHSCOPE_API_KEY for embeddings) |
qwen | Qwen | qwen-plus | text-embedding-v3 | DASHSCOPE_API_KEY |
minimax | MiniMax | abab6.5s-chat | embo-01 | MINIMAX_API_KEY |
glm | Z.AI | glm-4-plus | embedding-3 | ZHIPUAI_API_KEY |
custom | Custom | gpt-4o | text-embedding-3-small | OPENAI_API_KEY |
The Custom profile lets you connect to any OpenAI-compatible API endpoint. During the wizard you'll be asked for the API base URL.
6. Directory Structureâ
After first run, DB-GPT creates the following structure under your home directory:
~/.dbgpt/
âââ config.toml # Records the active profile name
âââ configs/
â âââ openai.toml # Profile: OpenAI
â âââ kimi.toml # Profile: Kimi
â âââ ... # One file per profile
âââ workspace/
âââ pilot/ # Runtime workspace (databases, data files, etc.)
âââ meta_data/
â âââ dbgpt.db # SQLite metadata database
âââ data/ # Vector store data
Environment Variablesâ
| Variable | Default | Description |
|---|---|---|
DBGPT_HOME | ~/.dbgpt | Override the DB-GPT home directory |
OPENAI_API_KEY | â | OpenAI API key (used by openai and custom profiles) |
MOONSHOT_API_KEY | â | Kimi / Moonshot API key |
DASHSCOPE_API_KEY | â | Qwen / DashScope API key (also used for Kimi embeddings) |
MINIMAX_API_KEY | â | MiniMax API key |
ZHIPUAI_API_KEY | â | Z.AI / Zhipu API key |
DBGPT_API_KEY | â | Generic API key (fallback for --api-key flag) |
DBGPT_LANG | en | UI language (en or zh) |
7. Common Workflowsâ
First-time setupâ
pip install dbgpt-app
dbgpt start
# Follow the wizard â choose provider â enter API key â server starts
Switch between providersâ
# Create a Kimi profile
dbgpt profile create kimi
# Switch to it
dbgpt profile switch kimi
# Start with the new profile
dbgpt start
CI/CD deploymentâ
export OPENAI_API_KEY=sk-xxx
dbgpt setup --profile openai --yes
dbgpt start web --daemon
Custom endpoint (e.g. Azure OpenAI, local vLLM)â
dbgpt setup --profile custom
# Wizard will ask for:
# - API base URL (e.g. http://localhost:8000/v1)
# - API key
# - Model names
8. Optional Modulesâ
The core framework is included by default when you pip install dbgpt-app. Use extras to add LLM providers, vector stores, data sources, and more.
LLM Providersâ
| Extra | Provider | Key packages |
|---|---|---|
proxy_openai | OpenAI, Kimi, Qwen, MiniMax, Z.AI, any OpenAI-compatible API | openai, tiktoken |
proxy_ollama | Ollama (local models) | ollama |
proxy_zhipuai | Zhipu AI (GLM) | openai |
proxy_tongyi | Tongyi Qianwen | openai, dashscope |
proxy_qianfan | Baidu Qianfan | qianfan |
proxy_anthropic | Anthropic Claude | anthropic |
Vector Storesâ
| Extra | Storage | Key packages |
|---|---|---|
storage_chromadb | ChromaDB | chromadb, onnxruntime |
storage_milvus | Milvus | pymilvus |
storage_weaviate | Weaviate | weaviate-client |
storage_elasticsearch | Elasticsearch | elasticsearch |
storage_obvector | OBVector | pyobvector |
Knowledge & RAGâ
| Extra | What it adds | Key packages |
|---|---|---|
rag | Document parsing (PDF, DOCX, PPTX, Markdown, HTML) | spacy, pypdf, python-docx, python-pptx |
graph_rag | Graph-based RAG with TuGraph/Neo4j | networkx, neo4j |
Data Sourcesâ
| Extra | Database | Key packages |
|---|---|---|
datasource_mysql | MySQL | mysqlclient |
datasource_postgres | PostgreSQL | psycopg2-binary |
datasource_clickhouse | ClickHouse | clickhouse-connect |
datasource_oracle | Oracle | oracledb |
datasource_mssql | SQL Server | pymssql |
datasource_spark | Apache Spark | pyspark |
datasource_hive | Hive | pyhive |
datasource_vertica | Vertica | vertica-python |
Example: combine multiple extrasâ
# OpenAI + ChromaDB + RAG + MySQL
pip install "dbgpt-app[proxy_openai,storage_chromadb,rag,datasource_mysql]"
If you only need the core framework without any LLM or storage:
pip install dbgpt-app
This gives you the CLI, FastAPI server, and agent framework â but you'll need to add at least one LLM provider extra to actually use it.
9. Troubleshootingâ
Port already in useâ
# Stop the existing server
dbgpt stop webserver --port 5670
# Or choose a different port by editing the config file
# [service.web]
# port = 5671
"No config file found" errorâ
This means no profile has been set up yet. Run:
dbgpt setup
Changing your API keyâ
Re-run the setup wizard for the same profile â it will overwrite the existing config:
dbgpt setup --profile openai
# Or simply edit ~/.dbgpt/configs/openai.toml directly
View current configurationâ
dbgpt setup --show
dbgpt profile show openai