Skip to main content
Version: dev

Source Code Deployment

Environmental requirements

Startup ModeCPU * MEMGPURemark
Proxy model4C * 8GNoneProxy model does not rely on GPU
Local model8C * 32G24GIt is best to start locally with a GPU of 24G or above

Environment Preparation

Download Source Code

tip

Download DB-GPT

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

There are some ways to install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Then, you can run uv --version to check if uv is installed successfully.

uv --version

Deploy DB-GPT

Install Dependencies

# Use uv to install dependencies needed for OpenAI proxy
uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \
--extra "storage_chromadb" \
--extra "dbgpts"

Run Webserver

To run DB-GPT with OpenAI proxy, you must provide the OpenAI API key in the configs/dbgpt-proxy-openai.toml configuration file or privide it in the environment variable with key OPENAI_API_KEY.

# Model Configurations
[models]
[[models.llms]]
...
api_key = "your-openai-api-key"
[[models.embeddings]]
...
api_key = "your-openai-api-key"

Then run the following command to start the webserver:

uv run dbgpt start webserver --config configs/dbgpt-proxy-openai.toml

In the above command, --config specifies the configuration file, and configs/dbgpt-proxy-openai.toml is the configuration file for the OpenAI proxy model, you can also use other configuration files or create your own configuration file according to your needs.

Optionally, you can also use the following command to start the webserver:

uv run python packages/dbgpt-app/src/dbgpt_app/dbgpt_server.py --config configs/dbgpt-proxy-openai.toml

Visit Website

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

(Optional) Run Web Front-end Separately

You can also run the web front-end separately:

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

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

Install DB-GPT Application Database

NOTE

You do not need to separately create the database tables related to the DB-GPT application in SQLite; they will be created automatically for you by default.

Modify your toml configuration file to use SQLite as the database(Is the default setting).

[service.web.database]
type = "sqlite"
path = "pilot/meta_data/dbgpt.db"

Test data (optional)

The DB-GPT project has a part of test data built-in by default, which can be loaded into the local database for testing through the following command

  • Linux
bash ./scripts/examples/load_examples.sh

  • Windows
.\scripts\examples\load_examples.bat

:::

Visit website

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