feat(build): Support docker install

This commit is contained in:
Fangyin Cheng
2025-03-11 15:57:52 +08:00
parent ee1ac0df8e
commit 455cdd1612
32 changed files with 1844 additions and 589 deletions

View File

@@ -0,0 +1,339 @@
---
id: docker-build-guide
title: DB-GPT Docker Build Guide
sidebar_label: Docker Build Guide
description: Comprehensive guide for building DB-GPT Docker images with various configurations
keywords:
- DB-GPT
- Docker
- Build
- CUDA
- OpenAI
- VLLM
- Llama-cpp
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
# DB-GPT Docker Build Guide
This guide provides comprehensive instructions for building DB-GPT Docker images with various configurations using the `docker/base/build_image.sh` script.
## Overview
The DB-GPT build script allows you to create Docker images tailored to your specific requirements. You can choose from predefined installation modes or customize the build with specific extras, environment variables, and other settings.
## Available Installation Modes
<Tabs>
<TabItem value="default" label="Default" default>
CUDA-based image with standard features.
```bash
bash docker/base/build_image.sh
```
Includes: CUDA support, proxy integrations (OpenAI, Ollama, Zhipuai, Anthropic, Qianfan, Tongyi), RAG capabilities, graph RAG, Hugging Face integration, and quantization support.
</TabItem>
<TabItem value="openai" label="OpenAI">
CPU-based image optimized for OpenAI API usage.
```bash
bash docker/base/build_image.sh --install-mode openai
```
Includes: Basic functionality, all proxy integrations, and RAG capabilities without GPU acceleration.
</TabItem>
<TabItem value="vllm" label="VLLM">
CUDA-based image with VLLM for optimized inference.
```bash
bash docker/base/build_image.sh --install-mode vllm
```
Includes: All default features plus VLLM support for high-performance inference.
</TabItem>
<TabItem value="llama-cpp" label="Llama-cpp">
CUDA-based image with Llama-cpp support.
```bash
bash docker/base/build_image.sh --install-mode llama-cpp
```
Includes: All default features plus Llama-cpp and Llama-cpp server with CUDA acceleration enabled via `CMAKE_ARGS="-DGGML_CUDA=ON"`.
</TabItem>
<TabItem value="full" label="Full">
CUDA-based image with all available features.
```bash
bash docker/base/build_image.sh --install-mode full
```
Includes: All features from other modes plus embedding capabilities.
</TabItem>
</Tabs>
## Basic Usage
### View Available Modes
To see all available installation modes and their configurations:
```bash
bash docker/base/build_image.sh --list-modes
```
### Get Help
Display all available options:
```bash
bash docker/base/build_image.sh --help
```
## Customization Options
### Python Version
DB-GPT requires Python 3.10 or higher. The default is Python 3.11, but you can specify a different version:
```bash
bash docker/base/build_image.sh --python-version 3.10
```
### Custom Image Name
Set a custom name for the built image:
```bash
bash docker/base/build_image.sh --image-name mycompany/dbgpt
```
### Image Name Suffix
Add a suffix to the image name for versioning or environment identification:
```bash
bash docker/base/build_image.sh --image-name-suffix v1.0
```
This will generate `eosphorosai/dbgpt-v1.0` for the default mode or `eosphorosai/dbgpt-MODE-v1.0` for specific modes.
### PIP Mirror
Choose a different PIP index URL:
```bash
bash docker/base/build_image.sh --pip-index-url https://pypi.org/simple
```
### Ubuntu Mirror
Control whether to use Tsinghua Ubuntu mirror:
```bash
bash docker/base/build_image.sh --use-tsinghua-ubuntu false
```
### Language Preference
Set your preferred language (default is English):
```bash
bash docker/base/build_image.sh --language zh
```
## Advanced Customization
### Custom Extras
You can customize the Python package extras installed in the image:
<Tabs>
<TabItem value="override" label="Override Extras" default>
Completely replace the default extras with your own selection:
```bash
bash docker/base/build_image.sh --extras "base,proxy_openai,rag,storage_chromadb"
```
</TabItem>
<TabItem value="add" label="Add Extras">
Keep the default extras and add more:
```bash
bash docker/base/build_image.sh --add-extras "storage_milvus,storage_elasticsearch,datasource_postgres"
```
</TabItem>
<TabItem value="mode-specific" label="Mode-Specific">
Add specific extras to a particular installation mode:
```bash
bash docker/base/build_image.sh --install-mode vllm --add-extras "storage_milvus,datasource_postgres"
```
</TabItem>
</Tabs>
#### Available Extra Options
Here are some useful extras you can add:
| Extra Package | Description |
|--------------|-------------|
| `storage_milvus` | Vector store integration with Milvus |
| `storage_elasticsearch` | Vector store integration with Elasticsearch |
| `datasource_postgres` | Database connector for PostgreSQL |
| `vllm` | VLLM integration for optimized inference |
| `llama_cpp` | Llama-cpp Python bindings |
| `llama_cpp_server` | Llama-cpp HTTP server |
You can run `uv run install_help.py list` in your local DB-GPT repository to see all available extras.
### Environment Variables
DB-GPT build supports environment variables for specialized builds. The main environment variable used is `CMAKE_ARGS` which is particularly important for Llama-cpp compilation.
<Tabs>
<TabItem value="override-env" label="Override Env Vars" default>
Replace the default environment variables:
```bash
bash docker/base/build_image.sh --env-vars "CMAKE_ARGS=\"-DGGML_CUDA=ON -DLLAMA_CUBLAS=ON\""
```
</TabItem>
<TabItem value="add-env" label="Add Env Vars">
Add additional environment variables:
```bash
bash docker/base/build_image.sh --install-mode llama-cpp --add-env-vars "FORCE_CMAKE=1"
```
</TabItem>
</Tabs>
:::note
For Llama-cpp mode, `CMAKE_ARGS="-DGGML_CUDA=ON"` is automatically set to enable CUDA acceleration.
:::
### Docker Network
Specify a Docker network for building:
```bash
bash docker/base/build_image.sh --network host
```
### Custom Dockerfile
Use a custom Dockerfile:
```bash
bash docker/base/build_image.sh --dockerfile Dockerfile.custom
```
## Example Scenarios
### Enterprise DB-GPT with PostgreSQL and Elasticsearch
Build a full-featured enterprise version with PostgreSQL and Elasticsearch support:
```bash
bash docker/base/build_image.sh --install-mode full \
--add-extras "storage_elasticsearch,datasource_postgres" \
--image-name-suffix enterprise \
--python-version 3.10 \
--load-examples false
```
### Optimized Llama-cpp for Specific Hardware
Build with custom Llama-cpp optimization flags:
```bash
bash docker/base/build_image.sh --install-mode llama-cpp \
--env-vars "CMAKE_ARGS=\"-DGGML_CUDA=ON -DGGML_AVX2=OFF -DGGML_AVX512=ON\"" \
--python-version 3.11
```
### Lightweight OpenAI Proxy
Build a minimal OpenAI proxy image:
```bash
bash docker/base/build_image.sh --install-mode openai \
--use-tsinghua-ubuntu false \
--pip-index-url https://pypi.org/simple \
--load-examples false
```
### Development Build with Milvus
Build a development version with Milvus support:
```bash
bash docker/base/build_image.sh --install-mode vllm \
--add-extras "storage_milvus" \
--image-name-suffix dev
```
## Troubleshooting
<details>
<summary>Common Build Issues</summary>
### CUDA Not Found
If you encounter CUDA-related errors:
```bash
# Try building with a different CUDA base image
bash docker/base/build_image.sh --base-image nvidia/cuda:12.1.0-devel-ubuntu22.04
```
### Package Installation Failures
If extras fail to install:
```bash
# Try building with fewer extras to isolate the problem
bash docker/base/build_image.sh --extras "base,proxy_openai,rag"
```
### Network Issues
If you encounter network problems:
```bash
# Use a specific network
bash docker/base/build_image.sh --network host
```
</details>
## API Reference
### Script Options
| Option | Description | Default Value |
|--------|-------------|---------------|
| `--install-mode` | Installation mode | `default` |
| `--base-image` | Base Docker image | `nvidia/cuda:12.4.0-devel-ubuntu22.04` |
| `--image-name` | Docker image name | `eosphorosai/dbgpt` |
| `--image-name-suffix` | Suffix for image name | ` ` |
| `--pip-index-url` | PIP mirror URL | `https://pypi.tuna.tsinghua.edu.cn/simple` |
| `--language` | Interface language | `en` |
| `--load-examples` | Load example data | `true` |
| `--python-version` | Python version | `3.11` |
| `--use-tsinghua-ubuntu` | Use Tsinghua Ubuntu mirror | `true` |
| `--extras` | Extra packages to install | Mode dependent |
| `--add-extras` | Additional extra packages | ` ` |
| `--env-vars` | Build environment variables | Mode dependent |
| `--add-env-vars` | Additional environment variables | ` ` |
| `--dockerfile` | Dockerfile to use | `Dockerfile` |
| `--network` | Docker network to use | ` ` |
## Additional Resources
- [DB-GPT Documentation](https://github.com/eosphoros-ai/DB-GPT)
- [Docker Documentation](https://docs.docker.com/)
- [CUDA Documentation](https://docs.nvidia.com/cuda/)

View File

@@ -1,112 +1,223 @@
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Docker Deployment
## Docker image preparation
There are two ways to prepare a Docker image. 1. Pull from the official image 2. Build locally. You can **choose any one** during actual use.
There are two ways to prepare a Docker image.
1. Pull from the official image
2. Build locally, see [Build Docker Image](./build_image.md)
1.Pulled from the official image repository, [Eosphoros AI Docker Hub](https://hub.docker.com/u/eosphorosai)
```bash
docker pull eosphorosai/dbgpt:latest
```
2.local build(optional)
```bash
bash docker/build_all_images.sh
```
Check the Docker image
```bash
# command
docker images | grep "eosphorosai/dbgpt"
You can **choose any one** during actual use.
# result
--------------------------------------------------------------------------------------
eosphorosai/dbgpt-allinone latest 349d49726588 27 seconds ago 15.1GB
eosphorosai/dbgpt latest eb3cdc5b4ead About a minute ago 14.5GB
```
`eosphorosai/dbgpt` is the base image, which contains project dependencies and the sqlite database. The `eosphorosai/dbgpt-allinone` image is built from `eosphorosai/dbgpt`, which contains a MySQL database. Of course, in addition to pulling the Docker image, the project also provides Dockerfile files, which can be built directly through scripts in DB-GPT. Here are the build commands:
## Deploy With Proxy Model
In this deployment, you don't need an GPU environment.
1. Pull from the official image repository, [Eosphoros AI Docker Hub](https://hub.docker.com/u/eosphorosai)
```bash
bash docker/build_all_images.sh
docker pull eosphorosai/dbgpt-openai:latest
```
When using it, you need to specify specific parameters. The following is an example of specifying parameter construction:
```bash
bash docker/build_all_images.sh \
--base-image nvidia/cuda:11.8.0-runtime-ubuntu22.04 \
--pip-index-url https://pypi.tuna.tsinghua.edu.cn/simple \
--language zh
```
You can view the specific usage through the command `bash docker/build_all_images.sh --help`
2. Run the Docker container
## Run Docker container
### Run through Sqlite database
This example requires you previde a valid API key for the SiliconFlow API. You can obtain one by signing up at [SiliconFlow](https://siliconflow.cn/) and creating an API key at [API Key](https://cloud.siliconflow.cn/account/ak).
```bash
docker run --ipc host --gpus all -d \
-p 5670:5670 \
-e LOCAL_DB_TYPE=sqlite \
-e LOCAL_DB_PATH=data/default_sqlite.db \
-e LLM_MODEL=glm-4-9b-chat \
-e LANGUAGE=zh \
-v /data/models:/app/models \
--name dbgpt \
eosphorosai/dbgpt
```
Open the browser and visit [http://localhost:5670](http://localhost:5670)
- `-e LLM_MODEL=glm-4-9b-chat`, which means the base model uses `glm-4-9b-chat`. For more model usage, you can view the configuration in `/pilot/configs/model_config.LLM_MODEL_CONFIG`.
- `-v /data/models:/app/models`, specifies the model file to be mounted. The directory `/data/models` is mounted in `/app/models` of the container. Of course, it can be replaced with other paths.
After the container is started, you can view the logs through the following command
```bash
docker logs dbgpt -f
docker run -it --rm -e SILICONFLOW_API_KEY=${SILICONFLOW_API_KEY} \
-p 5670:5670 --name dbgpt eosphorosai/dbgpt-openai
```
### Run through MySQL database
Please replace `${SILICONFLOW_API_KEY}` with your own API key.
Then you can visit [http://localhost:5670](http://localhost:5670) in the browser.
## Deploy With GPU (Local Model)
In this deployment, you need an GPU environment.
Before running the Docker container, you need to install the NVIDIA Container Toolkit. For more information, please refer to the official documentation [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html).
In this deployment, you will use a local model instead of downloading it from the Hugging Face or ModelScope model hub. This is useful if you have already downloaded the model to your local machine or if you want to use a model from a different source.
### Step 1: Download the Model
Before running the Docker container, you need to download the model to your local machine. You can use either Hugging Face or ModelScope (recommended for users in China) to download the model.
<Tabs>
<TabItem value="modelscope" label="Download from ModelScope">
1. Install `git` and `git-lfs` if you haven't already:
```bash
sudo apt-get install git git-lfs
```
2. Create a `models` directory in your current working directory:
```bash
mkdir -p ./models
```
3. Use `git` to clone the model repositories into the `models` directory:
```bash
cd ./models
git lfs install
git clone https://www.modelscope.cn/Qwen/Qwen2.5-Coder-0.5B-Instruct.git
git clone https://www.modelscope.cn/BAAI/bge-large-zh-v1.5.git
cd ..
```
This will download the models into the `./models/Qwen2.5-Coder-0.5B-Instruct` and `./models/bge-large-zh-v1.5` directories.
</TabItem>
<TabItem value="huggingface" label="Download from Hugging Face">
1. Install `git` and `git-lfs` if you haven't already:
```bash
sudo apt-get install git git-lfs
```
2. Create a `models` directory in your current working directory:
```bash
mkdir -p ./models
```
3. Use `git` to clone the model repositories into the `models` directory:
```bash
cd ./models
git lfs install
git clone https://huggingface.co/Qwen/Qwen2.5-Coder-0.5B-Instruct
git clone https://huggingface.co/BAAI/bge-large-zh-v1.5
cd ..
```
This will download the models into the `./models/Qwen2.5-Coder-0.5B-Instruct` and `./models/bge-large-zh-v1.5` directories.
</TabItem>
</Tabs>
---
### Step 2: Prepare the Configuration File
Create a `toml` file named `dbgpt-local-gpu.toml` and add the following content:
```toml
[models]
[[models.llms]]
name = "Qwen2.5-Coder-0.5B-Instruct"
provider = "hf"
# Specify the model path in the local file system
path = "/app/models/Qwen2.5-Coder-0.5B-Instruct"
[[models.embeddings]]
name = "BAAI/bge-large-zh-v1.5"
provider = "hf"
# Specify the model path in the local file system
path = "/app/models/bge-large-zh-v1.5"
```
This configuration file specifies the local paths to the models inside the Docker container.
---
### Step 3: Run the Docker Container
Run the Docker container with the local `models` directory mounted:
```bash
docker run --ipc host --gpus all -d -p 3306:3306 \
-p 5670:5670 \
-e LOCAL_DB_HOST=127.0.0.1 \
-e LOCAL_DB_PASSWORD=aa123456 \
-e MYSQL_ROOT_PASSWORD=aa123456 \
-e LLM_MODEL=glm-4-9b-chat \
-e LANGUAGE=zh \
-v /data/models:/app/models \
--name db-gpt-allinone \
db-gpt-allinone
```
Open the browser and visit [http://localhost:5670](http://localhost:5670)
- `-e LLM_MODEL=glm-4-9b-chat`, which means the base model uses `glm-4-9b-chat`. For more model usage, you can view the configuration in `/pilot/configs/model_config.LLM_MODEL_CONFIG`.
- `-v /data/models:/app/models`, specifies the model file to be mounted. The directory `/data/models` is mounted in `/app/models` of the container. Of course, it can be replaced with other paths.
After the container is started, you can view the logs through the following command
```bash
docker logs db-gpt-allinone -f
docker run --ipc host --gpus all \
-it --rm \
-p 5670:5670 \
-v ./dbgpt-local-gpu.toml:/app/configs/dbgpt-local-gpu.toml \
-v ./models:/app/models \
--name dbgpt \
eosphorosai/dbgpt \
dbgpt start webserver --config /app/configs/dbgpt-local-gpu.toml
```
### Run through the OpenAI proxy model
```bash
PROXY_API_KEY="You api key"
PROXY_SERVER_URL="https://api.openai.com/v1/chat/completions"
docker run --gpus all -d -p 3306:3306 \
-p 5670:5670 \
-e LOCAL_DB_HOST=127.0.0.1 \
-e LOCAL_DB_PASSWORD=aa123456 \
-e MYSQL_ROOT_PASSWORD=aa123456 \
-e LLM_MODEL=proxyllm \
-e PROXY_API_KEY=$PROXY_API_KEY \
-e PROXY_SERVER_URL=$PROXY_SERVER_URL \
-e LANGUAGE=zh \
-v /data/models/text2vec-large-chinese:/app/models/text2vec-large-chinese \
--name db-gpt-allinone \
db-gpt-allinone
#### Explanation of the Command:
- `--ipc host`: Enables host IPC mode for better performance.
- `--gpus all`: Allows the container to use all available GPUs.
- `-v ./dbgpt-local-gpu.toml:/app/configs/dbgpt-local-gpu.toml`: Mounts the local configuration file into the container.
- `-v ./models:/app/models`: Mounts the local `models` directory into the container.
- `eosphorosai/dbgpt`: The Docker image to use.
- `dbgpt start webserver --config /app/configs/dbgpt-local-gpu.toml`: Starts the webserver with the specified configuration file.
---
### Step 4: Access the Application
Once the container is running, you can visit [http://localhost:5670](http://localhost:5670) in your browser to access the application.
---
### Step 5: Persist Data (Optional)
To ensure that your data is not lost when the container is stopped or removed, you can map the `pilot/data` and `pilot/message` directories to your local machine. These directories store application data and messages.
1. Create local directories for data persistence:
```bash
mkdir -p ./pilot/data
mkdir -p ./pilot/message
mkdir -p ./pilot/alembic_versions
```
2. Modify the `dbgpt-local-gpu.toml` configuration file to point to the correct paths:
```toml
[service.web.database]
type = "sqlite"
path = "/app/pilot/message/dbgpt.db"
```
3. Run the Docker container with the additional volume mounts:
```bash
docker run --ipc host --gpus all \
-it --rm \
-p 5670:5670 \
-v ./dbgpt-local-gpu.toml:/app/configs/dbgpt-local-gpu.toml \
-v ./models:/app/models \
-v ./pilot/data:/app/pilot/data \
-v ./pilot/message:/app/pilot/message \
-v ./pilot/alembic_versions:/app/pilot/meta_data/alembic/versions \
--name dbgpt \
eosphorosai/dbgpt \
dbgpt start webserver --config /app/configs/dbgpt-local-gpu.toml
```
This ensures that the `pilot/data` and `pilot/message` directories are persisted on your local machine.
---
### Summary of Directory Structure
After completing the steps, your directory structure should look like this:
```
.
├── dbgpt-local-gpu.toml
├── models
│ ├── Qwen2.5-Coder-0.5B-Instruct
│ └── bge-large-zh-v1.5
├── pilot
│ ├── data
│ └── message
```
- `-e LLM_MODEL=proxyllm`, set the model to serve the third-party model service API, which can be openai or fastchat interface.
- `-v /data/models/text2vec-large-chinese:/app/models/text2vec-large-chinese`, sets the knowledge base embedding model to `text2vec`
Open the browser and visit [http://localhost:5670](http://localhost:5670)
This setup ensures that the models and application data are stored locally and mounted into the Docker container, allowing you to use them without losing data.
```

View File

@@ -1,19 +1,26 @@
# Docker-Compose Deployment
## Run via Docker-Compose
```python
$ docker compose up -d
------------------------------------------
[+] Building 0.0s (0/0)
[+] Running 2/2
Container db-gpt-db-1 Started 0.4s
Container db-gpt-webserver-1 Started
This example requires you previde a valid API key for the SiliconFlow API. You can obtain one by signing up at [SiliconFlow](https://siliconflow.cn/) and creating an API key at [API Key](https://cloud.siliconflow.cn/account/ak).
```bash
SILICONFLOW_API_KEY=${SILICONFLOW_API_KEY} docker compose up -d
```
You will see the following output if the deployment is successful.
```bash
[+] Running 3/3
✔ Network dbgptnet Created 0.0s
✔ Container db-gpt-db-1 Started 0.2s
✔ Container db-gpt-webserver-1 Started 0.2s
```
## View log
```python
$ docker logs db-gpt-webserver-1 -f
```bash
docker logs db-gpt-webserver-1 -f
```
:::info note

View File

@@ -7,7 +7,7 @@ In this example, we will show how to use the ClickHouse as in DB-GPT Datasource.
First, you need to install the `dbgpt clickhouse datasource` library.
```bash
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "datasource_clickhouse" \
--extra "rag" \

View File

@@ -10,7 +10,7 @@ First, you need to install the `dbgpt duckdb datasource` library.
```bash
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "datasource_duckdb" \
--extra "rag" \

View File

@@ -11,7 +11,7 @@ You can refer to the python example file `DB-GPT/examples/rag/graph_rag_example.
First, you need to install the `dbgpt graph_rag` library.
```bash
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \

View File

@@ -7,7 +7,7 @@ In this example, we will show how to use the Hive as in DB-GPT Datasource. Using
First, you need to install the `dbgpt hive datasource` library.
```bash
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "datasource_hive" \
--extra "rag" \

View File

@@ -9,7 +9,7 @@ In this example, we will show how to use the Milvus as in DB-GPT RAG Storage. Us
First, you need to install the `dbgpt milvus storage` library.
```bash
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \

View File

@@ -8,7 +8,7 @@ First, you need to install the `dbgpt mssql datasource` library.
```bash
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "datasource_mssql" \
--extra "rag" \

View File

@@ -9,7 +9,7 @@ In this example, we will show how to use the Oceanbase Vector as in DB-GPT RAG S
First, you need to install the `dbgpt Oceanbase Vector storage` library.
```bash
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \

View File

@@ -10,7 +10,7 @@ First, you need to install the `dbgpt postgres datasource` library.
```bash
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "datasource_postgres" \
--extra "rag" \

View File

@@ -80,7 +80,7 @@ uv --version
```bash
# Use uv to install dependencies needed for OpenAI proxy
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \
@@ -120,7 +120,7 @@ uv run python packages/dbgpt-app/src/dbgpt_app/dbgpt_server.py --config configs/
```bash
# Use uv to install dependencies needed for OpenAI proxy
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "proxy_openai" \
--extra "rag" \
@@ -169,8 +169,9 @@ uv run python packages/dbgpt-app/src/dbgpt_app/dbgpt_server.py --config configs/
```bash
# Use uv to install dependencies needed for GLM4
# Install core dependencies and select desired extensions
uv sync --all-packages --frozen \
uv sync --all-packages \
--extra "base" \
--extra "cuda121" \
--extra "hf" \
--extra "rag" \
--extra "storage_chromadb" \
@@ -228,20 +229,6 @@ npm run dev
Open your browser and visit [`http://localhost:3000`](http://localhost:3000)
#### More descriptions
| environment variables | default value | description |
|-------------------------------------|------------------|-----------------------|
| `llama_cpp_prompt_template` | None | Prompt template now supports `zero_shot, vicuna_v1.1,alpaca,llama-2,baichuan-chat,internlm-chat`. If it is None, the model Prompt template can be automatically obtained according to the model path. |
| `llama_cpp_model_path` | None | model path |
| `llama_cpp_n_gpu_layers` | 1000000000 | How many network layers to transfer to the GPU, set this to 1000000000 to transfer all layers to the GPU. If your GPU is low on memory, you can set a lower number, for example: 10. |
| `llama_cpp_n_threads` | None | The number of threads to use. If None, the number of threads will be determined automatically. |
| `llama_cpp_n_batch` | 512 | The maximum number of prompt tokens to be batched together when calling llama_eval |
| `llama_cpp_n_gqa` | None | For the llama-2 70B model, Grouped-query attention must be 8. |
| `llama_cpp_rms_norm_eps` | 5e-06 | For the llama-2 model, 5e-6 is a good value. |
| `llama_cpp_cache_capacity` | None | Maximum model cache size. For example: 2000MiB, 2GiB |
| `llama_cpp_prefer_cpu` | False | If a GPU is available, the GPU will be used first by default unless prefer_cpu=False is configured. |
## Install DB-GPT Application Database
<Tabs
defaultValue="sqlite"
@@ -258,6 +245,13 @@ they will be created automatically for you by default.
:::
Modify your toml configuration file to use SQLite as the database(Is the default setting).
```toml
[service.web.database]
type = "sqlite"
path = "pilot/meta_data/dbgpt.db"
```
</TabItem>
<TabItem value="mysql" label="MySQL">
@@ -274,15 +268,18 @@ After version 0.4.7, we removed the automatic generation of MySQL database Schem
$ mysql -h127.0.0.1 -uroot -p{your_password} < ./assets/schema/dbgpt.sql
```
2. Second, set DB-GPT MySQL database settings in `.env` file.
2. Second, modify your toml configuration file to use MySQL as the database.
```bash
LOCAL_DB_TYPE=mysql
LOCAL_DB_USER= {your username}
LOCAL_DB_PASSWORD={your_password}
LOCAL_DB_HOST=127.0.0.1
LOCAL_DB_PORT=3306
```toml
[service.web.database]
type = "mysql"
host = "127.0.0.1"
port = 3306
user = "root"
database = "dbgpt"
password = "aa123456"
```
Please replace the `host`, `port`, `user`, `database`, and `password` with your own MySQL database settings.
</TabItem>
</Tabs>

View File

@@ -165,8 +165,10 @@ uv sync --all-packages \
--extra "rag" \
--extra "storage_chromadb" \
--extra "dbgpts" \
--extra "hf"
--extra "hf" \
--extra "cpu"
```
**Model Configurations**:
```toml
# Model Configurations
@@ -205,6 +207,7 @@ uv run python packages/dbgpt-app/src/dbgpt_app/dbgpt_server.py --config configs/
# Install core dependencies and select desired extensions
uv sync --all-packages \
--extra "base" \
--extra "cuda121" \
--extra "hf" \
--extra "rag" \
--extra "storage_chromadb" \
@@ -249,6 +252,8 @@ uv run dbgpt start webserver --config configs/dbgpt-local-glm.toml
# Install core dependencies and select desired extensions
uv sync --all-packages \
--extra "base" \
--extra "hf" \
--extra "cuda121" \
--extra "vllm" \
--extra "rag" \
--extra "storage_chromadb" \
@@ -295,6 +300,8 @@ If you has a Nvidia GPU, you can enable the CUDA support by setting the environm
# Install core dependencies and select desired extensions
CMAKE_ARGS="-DGGML_CUDA=ON" uv sync --all-packages \
--extra "base" \
--extra "hf" \
--extra "cuda121" \
--extra "llama_cpp" \
--extra "rag" \
--extra "storage_chromadb" \
@@ -308,6 +315,7 @@ Otherwise, run the following command to install dependencies without CUDA suppor
# Install core dependencies and select desired extensions
uv sync --all-packages \
--extra "base" \
--extra "hf" \
--extra "llama_cpp" \
--extra "rag" \
--extra "storage_chromadb" \
@@ -388,6 +396,35 @@ uv run python packages/dbgpt-app/src/dbgpt_app/dbgpt_server.py --config configs/
</Tabs>
## DB-GPT Install Help Tool
If you need help with the installation, you can use the `uv` script to get help.
```bash
uv run install_help.py --help
```
## Generate Install Command
You can use the `uv` script to generate the install command in the interactive mode.
```bash
uv run install_help.py install-cmd --interactive
```
And you can generate an install command with all the dependencies needed for the OpenAI proxy model.
```bash
uv run install_help.py install-cmd --all
```
You can found all the dependencies and extras.
```bash
uv run install_help.py list
```
## Visit Website
Open your browser and visit [`http://localhost:5670`](http://localhost:5670)

View File

@@ -124,6 +124,10 @@ const sidebars = {
type: 'doc',
id: 'installation/docker_compose',
},
{
type: 'doc',
id: 'installation/docker-build-guide',
},
{
type: 'category',
label: 'Model Service Deployment',