Skip to content

Commit e3a25de

Browse files
authored
docs: add vllm llama_cpp docs and standardize configs (#2386)
1 parent b6b232c commit e3a25de

File tree

9 files changed

+136
-51
lines changed

9 files changed

+136
-51
lines changed

configs/dbgpt-graphrag.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,3 @@ name = "${env:EMBEDDING_MODEL_NAME:-text-embedding-3-small}"
5353
provider = "${env:EMBEDDING_MODEL_PROVIDER:-proxy/openai}"
5454
api_url = "${env:EMBEDDING_MODEL_API_URL:-https://api.openai.com/v1/embeddings}"
5555
api_key = "${env:OPENAI_API_KEY}"
56-
57-

configs/dbgpt-local-glm.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ provider = "hf"
2626
# If not provided, the model will be downloaded from the Hugging Face model hub
2727
# uncomment the following line to specify the model path in the local file system
2828
# path = "the-model-path-in-the-local-file-system"
29+
path = "models/THUDM/glm-4-9b-chat-hf"
2930

3031
[[models.embeddings]]
3132
name = "BAAI/bge-large-zh-v1.5"
3233
provider = "hf"
3334
# If not provided, the model will be downloaded from the Hugging Face model hub
3435
# uncomment the following line to specify the model path in the local file system
3536
# path = "the-model-path-in-the-local-file-system"
36-
37+
path = "models/BAAI/glm-4-9b-chat-hf"

configs/dbgpt-local-llama-cpp-server.toml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,18 @@ persist_path = "pilot/data"
2121
# Model Configurations
2222
[models]
2323
[[models.llms]]
24-
name = "Qwen2.5-Coder-0.5B-Instruct"
25-
# Please make sure install DB-GPT with '--extra llama_cpp_server' extra
24+
name = "DeepSeek-R1-Distill-Qwen-1.5B"
2625
provider = "llama.cpp.server"
2726
# If not provided, the model will be downloaded from the Hugging Face model hub
2827
# uncomment the following line to specify the model path in the local file system
29-
# path = "the-model-path-in-the-local-file-system"
30-
path = "/data/models/qwen2.5-coder-0.5b-instruct-q4_k_m.gguf"
31-
32-
[[models.llms]]
33-
name = "DeepSeek-R1-Distill-Qwen-1.5B"
34-
provider = "llama.cpp.server"
3528
# https://huggingface.co/bartowski/DeepSeek-R1-Distill-Qwen-1.5B-GGUF
36-
path = "/data/models/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf"
37-
29+
# path = "the-model-path-in-the-local-file-system"
30+
path = "models/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf"
3831

3932
[[models.embeddings]]
4033
name = "BAAI/bge-large-zh-v1.5"
4134
provider = "hf"
4235
# If not provided, the model will be downloaded from the Hugging Face model hub
4336
# uncomment the following line to specify the model path in the local file system
4437
# path = "the-model-path-in-the-local-file-system"
45-
path = "/data/models/bge-large-zh-v1.5"
46-
38+
path = "models/BAAI/bge-large-zh-v1.5"

configs/dbgpt-local-llama-cpp.toml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,13 @@ persist_path = "pilot/data"
2121
# Model Configurations
2222
[models]
2323
[[models.llms]]
24-
name = "Qwen2.5-Coder-0.5B-Instruct"
25-
# Please make sure install DB-GPT with '--extra llama_cpp' extra
24+
name = "DeepSeek-R1-Distill-Qwen-1.5B"
2625
provider = "llama.cpp"
2726
# If not provided, the model will be downloaded from the Hugging Face model hub
2827
# uncomment the following line to specify the model path in the local file system
29-
# path = "the-model-path-in-the-local-file-system"
30-
path = "/data/models/qwen2.5-coder-0.5b-instruct-q4_k_m.gguf"
31-
32-
[[models.llms]]
33-
name = "DeepSeek-R1-Distill-Qwen-1.5B"
34-
provider = "llama.cpp"
3528
# https://huggingface.co/bartowski/DeepSeek-R1-Distill-Qwen-1.5B-GGUF
36-
path = "/data/models/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf"
29+
# path = "the-model-path-in-the-local-file-system"
30+
path = "models/DeepSeek-R1-Distill-Qwen-1.5B-Q4_K_M.gguf"
3731

3832

3933
[[models.embeddings]]
@@ -42,5 +36,5 @@ provider = "hf"
4236
# If not provided, the model will be downloaded from the Hugging Face model hub
4337
# uncomment the following line to specify the model path in the local file system
4438
# path = "the-model-path-in-the-local-file-system"
45-
path = "/data/models/bge-large-zh-v1.5"
39+
path = "models/BAAI/bge-large-zh-v1.5"
4640

configs/dbgpt-local-qwen.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ provider = "hf"
2626
# If not provided, the model will be downloaded from the Hugging Face model hub
2727
# uncomment the following line to specify the model path in the local file system
2828
# path = "the-model-path-in-the-local-file-system"
29-
path = "/data/models/Qwen2.5-Coder-0.5B-Instruct"
29+
path = "models/Qwen2.5-Coder-0.5B-Instruct"
3030

3131
[[models.embeddings]]
3232
name = "BAAI/bge-large-zh-v1.5"
3333
provider = "hf"
3434
# If not provided, the model will be downloaded from the Hugging Face model hub
3535
# uncomment the following line to specify the model path in the local file system
3636
# path = "the-model-path-in-the-local-file-system"
37-
path = "/data/models/bge-large-zh-v1.5"
37+
path = "models/BAAI/bge-large-zh-v1.5"
3838

configs/dbgpt-local-vllm.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,13 @@ persist_path = "pilot/data"
2121
# Model Configurations
2222
[models]
2323
[[models.llms]]
24-
name = "Qwen2.5-Coder-0.5B-Instruct"
24+
name = "DeepSeek-R1-Distill-Qwen-1.5B"
2525
provider = "vllm"
2626
# If not provided, the model will be downloaded from the Hugging Face model hub
2727
# uncomment the following line to specify the model path in the local file system
2828
# path = "the-model-path-in-the-local-file-system"
29-
path = "/data/models/Qwen2.5-Coder-0.5B-Instruct"
30-
# dtype="float32"
31-
32-
# [[models.llms]]
33-
# name = "DeepSeek-R1-Distill-Qwen-1.5B"
34-
# provider = "vllm"
35-
# # If not provided, the model will be downloaded from the Hugging Face model hub
36-
# # uncomment the following line to specify the model path in the local file system
37-
# # path = "the-model-path-in-the-local-file-system"
38-
# path = "/data/models/DeepSeek-R1-Distill-Qwen-1.5B"
29+
path = "models/DeepSeek-R1-Distill-Qwen-1.5B"
30+
# dtype = "float32"
3931

4032
[[models.embeddings]]
4133
name = "BAAI/bge-large-zh-v1.5"

configs/dbgpt-proxy-deepseek.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,14 @@ persist_path = "pilot/data"
2424
[models]
2525
[[models.llms]]
2626
name = "deepseek-reasoner"
27+
# name = "deepseek-chat"
2728
provider = "proxy/deepseek"
28-
api_key = "${env:DEEPSEEK_API_KEY}"
29-
30-
[[models.llms]]
31-
name = "deepseek-chat"
32-
provider = "proxy/deepseek"
33-
api_key = "${env:DEEPSEEK_API_KEY}"
29+
api_key = "your_deepseek_api_key"
3430

3531
[[models.embeddings]]
3632
name = "BAAI/bge-large-zh-v1.5"
3733
provider = "hf"
3834
# If not provided, the model will be downloaded from the Hugging Face model hub
3935
# uncomment the following line to specify the model path in the local file system
4036
# path = "the-model-path-in-the-local-file-system"
41-
path = "/data/models/bge-large-zh-v1.5"
37+
path = "models/bge-large-zh-v1.5"

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- Install docusaurus dependencies, generate node_modules folder.
88

99
```
10-
sudo yarn install
10+
yarn install
1111
```
1212

1313
### launch

docs/docs/quickstart.md

Lines changed: 117 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ uv --version
7474
```
7575

7676
## Deploy DB-GPT
77+
:::tip
78+
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:
79+
```bash
80+
uv sync --all-packages \
81+
--extra "base" \
82+
--extra "proxy_openai" \
83+
--extra "rag" \
84+
--extra "storage_chromadb" \
85+
--extra "dbgpts" \
86+
--index-url=https://pypi.tuna.tsinghua.edu.cn/simple
87+
```
88+
This tutorial assumes that you can establish network communication with the dependency download sources.
89+
:::
7790

7891
### Install Dependencies
7992

@@ -83,13 +96,15 @@ uv --version
8396
{label: 'OpenAI (proxy)', value: 'openai'},
8497
{label: 'DeepSeek (proxy)', value: 'deepseek'},
8598
{label: 'GLM4 (local)', value: 'glm-4'},
99+
{label: 'VLLM (local)', value: 'vllm'},
100+
{label: 'LLAMA_CPP (local)', value: 'llama_cpp'},
86101
]}>
87102

88103
<TabItem value="openai" label="OpenAI(proxy)">
89104

90105
```bash
91106
# Use uv to install dependencies needed for OpenAI proxy
92-
uv sync --all-packages --frozen \
107+
uv sync --all-packages \
93108
--extra "base" \
94109
--extra "proxy_openai" \
95110
--extra "rag" \
@@ -129,7 +144,7 @@ uv run python packages/dbgpt-app/src/dbgpt_app/dbgpt_server.py --config configs/
129144

130145
```bash
131146
# Use uv to install dependencies needed for OpenAI proxy
132-
uv sync --all-packages --frozen \
147+
uv sync --all-packages \
133148
--extra "base" \
134149
--extra "proxy_openai" \
135150
--extra "rag" \
@@ -141,8 +156,17 @@ uv sync --all-packages --frozen \
141156

142157
To run DB-GPT with DeepSeek proxy, you must provide the DeepSeek API key in the `configs/dbgpt-proxy-deepseek.toml`.
143158

144-
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`.
145-
159+
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:
160+
```bash
161+
uv sync --all-packages \
162+
--extra "base" \
163+
--extra "proxy_openai" \
164+
--extra "rag" \
165+
--extra "storage_chromadb" \
166+
--extra "dbgpts" \
167+
--extra "hf"
168+
```
169+
**Model Configurations**:
146170
```toml
147171
# Model Configurations
148172
[models]
@@ -178,7 +202,7 @@ uv run python packages/dbgpt-app/src/dbgpt_app/dbgpt_server.py --config configs/
178202
```bash
179203
# Use uv to install dependencies needed for GLM4
180204
# Install core dependencies and select desired extensions
181-
uv sync --all-packages --frozen \
205+
uv sync --all-packages \
182206
--extra "base" \
183207
--extra "hf" \
184208
--extra "rag" \
@@ -214,6 +238,94 @@ Then run the following command to start the webserver:
214238

215239
```bash
216240
uv run dbgpt start webserver --config configs/dbgpt-local-glm.toml
241+
```
242+
243+
</TabItem>
244+
<TabItem value="vllm" label="VLLM(local)">
245+
246+
```bash
247+
# Use uv to install dependencies needed for vllm
248+
# Install core dependencies and select desired extensions
249+
uv sync --all-packages \
250+
--extra "base" \
251+
--extra "vllm" \
252+
--extra "rag" \
253+
--extra "storage_chromadb" \
254+
--extra "quant_bnb" \
255+
--extra "dbgpts"
256+
```
257+
258+
### Run Webserver
259+
260+
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.
261+
262+
```toml
263+
# Model Configurations
264+
[models]
265+
[[models.llms]]
266+
name = "THUDM/glm-4-9b-chat-hf"
267+
provider = "vllm"
268+
# If not provided, the model will be downloaded from the Hugging Face model hub
269+
# uncomment the following line to specify the model path in the local file system
270+
# path = "the-model-path-in-the-local-file-system"
271+
272+
[[models.embeddings]]
273+
name = "BAAI/bge-large-zh-v1.5"
274+
provider = "hf"
275+
# If not provided, the model will be downloaded from the Hugging Face model hub
276+
# uncomment the following line to specify the model path in the local file system
277+
# path = "the-model-path-in-the-local-file-system"
278+
```
279+
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.
280+
281+
Then run the following command to start the webserver:
282+
283+
```bash
284+
uv run dbgpt start webserver --config configs/dbgpt-local-vllm.toml
285+
```
286+
287+
</TabItem>
288+
<TabItem value="llama_cpp" label="LLAMA_CPP(local)">
289+
290+
```bash
291+
# Use uv to install dependencies needed for llama-cpp
292+
# Install core dependencies and select desired extensions
293+
uv sync --all-packages \
294+
--extra "base" \
295+
--extra "llama_cpp" \
296+
--extra "rag" \
297+
--extra "storage_chromadb" \
298+
--extra "quant_bnb" \
299+
--extra "dbgpts"
300+
```
301+
302+
### Run Webserver
303+
304+
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.
305+
306+
```toml
307+
# Model Configurations
308+
[models]
309+
[[models.llms]]
310+
name = "DeepSeek-R1-Distill-Qwen-1.5B"
311+
provider = "llama.cpp"
312+
# If not provided, the model will be downloaded from the Hugging Face model hub
313+
# uncomment the following line to specify the model path in the local file system
314+
# path = "the-model-path-in-the-local-file-system"
315+
316+
[[models.embeddings]]
317+
name = "BAAI/bge-large-zh-v1.5"
318+
provider = "hf"
319+
# If not provided, the model will be downloaded from the Hugging Face model hub
320+
# uncomment the following line to specify the model path in the local file system
321+
# path = "the-model-path-in-the-local-file-system"
322+
```
323+
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.
324+
325+
Then run the following command to start the webserver:
326+
327+
```bash
328+
uv run dbgpt start webserver --config configs/dbgpt-local-llama-cpp.toml
217329
```
218330

219331
</TabItem>

0 commit comments

Comments
 (0)