mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-27 20:39:41 +00:00
docs: add vllm llama_cpp docs and standardize configs (#2386)
This commit is contained in:
parent
b6b232c8f2
commit
e3a25de7f7
@ -53,5 +53,3 @@ name = "${env:EMBEDDING_MODEL_NAME:-text-embedding-3-small}"
|
||||
provider = "${env:EMBEDDING_MODEL_PROVIDER:-proxy/openai}"
|
||||
api_url = "${env:EMBEDDING_MODEL_API_URL:-https://api.openai.com/v1/embeddings}"
|
||||
api_key = "${env:OPENAI_API_KEY}"
|
||||
|
||||
|
||||
|
@ -26,6 +26,7 @@ provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "models/THUDM/glm-4-9b-chat-hf"
|
||||
|
||||
[[models.embeddings]]
|
||||
name = "BAAI/bge-large-zh-v1.5"
|
||||
@ -33,4 +34,4 @@ provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
|
||||
path = "models/BAAI/glm-4-9b-chat-hf"
|
||||
|
@ -21,20 +21,13 @@ persist_path = "pilot/data"
|
||||
# Model Configurations
|
||||
[models]
|
||||
[[models.llms]]
|
||||
name = "Qwen2.5-Coder-0.5B-Instruct"
|
||||
# Please make sure install DB-GPT with '--extra llama_cpp_server' extra
|
||||
name = "DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
provider = "llama.cpp.server"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "/data/models/qwen2.5-coder-0.5b-instruct-q4_k_m.gguf"
|
||||
|
||||
[[models.llms]]
|
||||
name = "DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
provider = "llama.cpp.server"
|
||||
# https://huggingface.co/bartowski/DeepSeek-R1-Distill-Qwen-1.5B-GGUF
|
||||
path = "/data/models/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf"
|
||||
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "models/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf"
|
||||
|
||||
[[models.embeddings]]
|
||||
name = "BAAI/bge-large-zh-v1.5"
|
||||
@ -42,5 +35,4 @@ provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "/data/models/bge-large-zh-v1.5"
|
||||
|
||||
path = "models/BAAI/bge-large-zh-v1.5"
|
||||
|
@ -21,19 +21,13 @@ persist_path = "pilot/data"
|
||||
# Model Configurations
|
||||
[models]
|
||||
[[models.llms]]
|
||||
name = "Qwen2.5-Coder-0.5B-Instruct"
|
||||
# Please make sure install DB-GPT with '--extra llama_cpp' extra
|
||||
name = "DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
provider = "llama.cpp"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "/data/models/qwen2.5-coder-0.5b-instruct-q4_k_m.gguf"
|
||||
|
||||
[[models.llms]]
|
||||
name = "DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
provider = "llama.cpp"
|
||||
# https://huggingface.co/bartowski/DeepSeek-R1-Distill-Qwen-1.5B-GGUF
|
||||
path = "/data/models/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf"
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "models/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf"
|
||||
|
||||
|
||||
[[models.embeddings]]
|
||||
@ -42,5 +36,5 @@ provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "/data/models/bge-large-zh-v1.5"
|
||||
path = "models/BAAI/bge-large-zh-v1.5"
|
||||
|
||||
|
@ -26,7 +26,7 @@ provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "/data/models/Qwen2.5-Coder-0.5B-Instruct"
|
||||
path = "models/Qwen2.5-Coder-0.5B-Instruct"
|
||||
|
||||
[[models.embeddings]]
|
||||
name = "BAAI/bge-large-zh-v1.5"
|
||||
@ -34,5 +34,5 @@ provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "/data/models/bge-large-zh-v1.5"
|
||||
path = "models/BAAI/bge-large-zh-v1.5"
|
||||
|
||||
|
@ -21,21 +21,13 @@ persist_path = "pilot/data"
|
||||
# Model Configurations
|
||||
[models]
|
||||
[[models.llms]]
|
||||
name = "Qwen2.5-Coder-0.5B-Instruct"
|
||||
name = "DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
provider = "vllm"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "/data/models/Qwen2.5-Coder-0.5B-Instruct"
|
||||
# dtype="float32"
|
||||
|
||||
# [[models.llms]]
|
||||
# name = "DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
# provider = "vllm"
|
||||
# # If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# # uncomment the following line to specify the model path in the local file system
|
||||
# # path = "the-model-path-in-the-local-file-system"
|
||||
# path = "/data/models/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
path = "models/DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
# dtype = "float32"
|
||||
|
||||
[[models.embeddings]]
|
||||
name = "BAAI/bge-large-zh-v1.5"
|
||||
|
@ -24,13 +24,9 @@ persist_path = "pilot/data"
|
||||
[models]
|
||||
[[models.llms]]
|
||||
name = "deepseek-reasoner"
|
||||
# name = "deepseek-chat"
|
||||
provider = "proxy/deepseek"
|
||||
api_key = "${env:DEEPSEEK_API_KEY}"
|
||||
|
||||
[[models.llms]]
|
||||
name = "deepseek-chat"
|
||||
provider = "proxy/deepseek"
|
||||
api_key = "${env:DEEPSEEK_API_KEY}"
|
||||
api_key = "your_deepseek_api_key"
|
||||
|
||||
[[models.embeddings]]
|
||||
name = "BAAI/bge-large-zh-v1.5"
|
||||
@ -38,4 +34,4 @@ provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
path = "/data/models/bge-large-zh-v1.5"
|
||||
path = "models/bge-large-zh-v1.5"
|
||||
|
@ -7,7 +7,7 @@
|
||||
- Install docusaurus dependencies, generate node_modules folder.
|
||||
|
||||
```
|
||||
sudo yarn install
|
||||
yarn install
|
||||
```
|
||||
|
||||
### launch
|
||||
|
@ -74,6 +74,19 @@ uv --version
|
||||
```
|
||||
|
||||
## Deploy DB-GPT
|
||||
:::tip
|
||||
If you are in the China region, you can add --index-url=https://pypi.tuna.tsinghua.edu.cn/simple at the end of the command.Like this:
|
||||
```bash
|
||||
uv sync --all-packages \
|
||||
--extra "base" \
|
||||
--extra "proxy_openai" \
|
||||
--extra "rag" \
|
||||
--extra "storage_chromadb" \
|
||||
--extra "dbgpts" \
|
||||
--index-url=https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
```
|
||||
This tutorial assumes that you can establish network communication with the dependency download sources.
|
||||
:::
|
||||
|
||||
### Install Dependencies
|
||||
|
||||
@ -83,13 +96,15 @@ uv --version
|
||||
{label: 'OpenAI (proxy)', value: 'openai'},
|
||||
{label: 'DeepSeek (proxy)', value: 'deepseek'},
|
||||
{label: 'GLM4 (local)', value: 'glm-4'},
|
||||
{label: 'VLLM (local)', value: 'vllm'},
|
||||
{label: 'LLAMA_CPP (local)', value: 'llama_cpp'},
|
||||
]}>
|
||||
|
||||
<TabItem value="openai" label="OpenAI(proxy)">
|
||||
|
||||
```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" \
|
||||
@ -129,7 +144,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" \
|
||||
@ -141,8 +156,17 @@ uv sync --all-packages --frozen \
|
||||
|
||||
To run DB-GPT with DeepSeek proxy, you must provide the DeepSeek API key in the `configs/dbgpt-proxy-deepseek.toml`.
|
||||
|
||||
And you can specify your embedding model in the `configs/dbgpt-proxy-deepseek.toml` configuration file, the default embedding model is `BAAI/bge-large-zh-v1.5`. If you want to use other embedding models, you can modify the `configs/dbgpt-proxy-deepseek.toml` configuration file and specify the `name` and `provider` of the embedding model in the `[[models.embeddings]]` section. The provider can be `hf`.
|
||||
|
||||
And you can specify your embedding model in the `configs/dbgpt-proxy-deepseek.toml` configuration file, the default embedding model is `BAAI/bge-large-zh-v1.5`. If you want to use other embedding models, you can modify the `configs/dbgpt-proxy-deepseek.toml` configuration file and specify the `name` and `provider` of the embedding model in the `[[models.embeddings]]` section. The provider can be `hf`.Finally, you need to append `--extra "hf"` at the end of the dependency installation command. Here's the updated command:
|
||||
```bash
|
||||
uv sync --all-packages \
|
||||
--extra "base" \
|
||||
--extra "proxy_openai" \
|
||||
--extra "rag" \
|
||||
--extra "storage_chromadb" \
|
||||
--extra "dbgpts" \
|
||||
--extra "hf"
|
||||
```
|
||||
**Model Configurations**:
|
||||
```toml
|
||||
# Model Configurations
|
||||
[models]
|
||||
@ -178,7 +202,7 @@ 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 "hf" \
|
||||
--extra "rag" \
|
||||
@ -214,6 +238,94 @@ Then run the following command to start the webserver:
|
||||
|
||||
```bash
|
||||
uv run dbgpt start webserver --config configs/dbgpt-local-glm.toml
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="vllm" label="VLLM(local)">
|
||||
|
||||
```bash
|
||||
# Use uv to install dependencies needed for vllm
|
||||
# Install core dependencies and select desired extensions
|
||||
uv sync --all-packages \
|
||||
--extra "base" \
|
||||
--extra "vllm" \
|
||||
--extra "rag" \
|
||||
--extra "storage_chromadb" \
|
||||
--extra "quant_bnb" \
|
||||
--extra "dbgpts"
|
||||
```
|
||||
|
||||
### Run Webserver
|
||||
|
||||
To run DB-GPT with the local model. You can modify the `configs/dbgpt-local-vllm.toml` configuration file to specify the model path and other parameters.
|
||||
|
||||
```toml
|
||||
# Model Configurations
|
||||
[models]
|
||||
[[models.llms]]
|
||||
name = "THUDM/glm-4-9b-chat-hf"
|
||||
provider = "vllm"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
|
||||
[[models.embeddings]]
|
||||
name = "BAAI/bge-large-zh-v1.5"
|
||||
provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
```
|
||||
In the above configuration file, `[[models.llms]]` specifies the LLM model, and `[[models.embeddings]]` specifies the embedding model. If you not provide the `path` parameter, the model will be downloaded from the Hugging Face model hub according to the `name` parameter.
|
||||
|
||||
Then run the following command to start the webserver:
|
||||
|
||||
```bash
|
||||
uv run dbgpt start webserver --config configs/dbgpt-local-vllm.toml
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
<TabItem value="llama_cpp" label="LLAMA_CPP(local)">
|
||||
|
||||
```bash
|
||||
# Use uv to install dependencies needed for llama-cpp
|
||||
# Install core dependencies and select desired extensions
|
||||
uv sync --all-packages \
|
||||
--extra "base" \
|
||||
--extra "llama_cpp" \
|
||||
--extra "rag" \
|
||||
--extra "storage_chromadb" \
|
||||
--extra "quant_bnb" \
|
||||
--extra "dbgpts"
|
||||
```
|
||||
|
||||
### Run Webserver
|
||||
|
||||
To run DB-GPT with the local model. You can modify the `configs/dbgpt-local-llama-cpp.toml` configuration file to specify the model path and other parameters.
|
||||
|
||||
```toml
|
||||
# Model Configurations
|
||||
[models]
|
||||
[[models.llms]]
|
||||
name = "DeepSeek-R1-Distill-Qwen-1.5B"
|
||||
provider = "llama.cpp"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
|
||||
[[models.embeddings]]
|
||||
name = "BAAI/bge-large-zh-v1.5"
|
||||
provider = "hf"
|
||||
# If not provided, the model will be downloaded from the Hugging Face model hub
|
||||
# uncomment the following line to specify the model path in the local file system
|
||||
# path = "the-model-path-in-the-local-file-system"
|
||||
```
|
||||
In the above configuration file, `[[models.llms]]` specifies the LLM model, and `[[models.embeddings]]` specifies the embedding model. If you not provide the `path` parameter, the model will be downloaded from the Hugging Face model hub according to the `name` parameter.
|
||||
|
||||
Then run the following command to start the webserver:
|
||||
|
||||
```bash
|
||||
uv run dbgpt start webserver --config configs/dbgpt-local-llama-cpp.toml
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
Loading…
Reference in New Issue
Block a user