Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(model): multi-model supports embedding model and simple component design implementation #574

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions docker/compose_examples/cluster-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ services:
controller:
image: eosphorosai/dbgpt:latest
command: dbgpt start controller
restart: unless-stopped
networks:
- dbgptnet
worker:
llm-worker:
image: eosphorosai/dbgpt:latest
command: dbgpt start worker --model_name vicuna-13b-v1.5 --model_path /app/models/vicuna-13b-v1.5 --port 8001 --controller_addr http://controller:8000
environment:
Expand All @@ -17,6 +18,27 @@ services:
- /data:/data
# Please modify it to your own model directory
- /data/models:/app/models
restart: unless-stopped
networks:
- dbgptnet
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
embedding-worker:
image: eosphorosai/dbgpt:latest
command: dbgpt start worker --model_name text2vec --worker_type text2vec --model_path /app/models/text2vec-large-chinese --port 8002 --controller_addr http://controller:8000
environment:
- DBGPT_LOG_LEVEL=DEBUG
depends_on:
- controller
volumes:
- /data:/data
# Please modify it to your own model directory
- /data/models:/app/models
restart: unless-stopped
networks:
- dbgptnet
deploy:
Expand All @@ -37,7 +59,8 @@ services:
- MODEL_SERVER=http://controller:8000
depends_on:
- controller
- worker
- llm-worker
- embedding-worker
volumes:
- /data:/data
# Please modify it to your own model directory
Expand Down
Binary file added docs/_static/img/muti-model-cluster-overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ DB-GPT product is a Web application that you can chat database, chat knowledge,
- docker
- docker_compose
- environment
- cluster deployment
- deploy_faq

.. toctree::
Expand All @@ -20,6 +21,7 @@ DB-GPT product is a Web application that you can chat database, chat knowledge,
./install/deploy/deploy.md
./install/docker/docker.md
./install/docker_compose/docker_compose.md
./install/cluster/cluster.rst
./install/llm/llm.rst
./install/environment/environment.md
./install/faq/deploy_faq.md
19 changes: 19 additions & 0 deletions docs/getting_started/install/cluster/cluster.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Cluster deployment
==================================

In order to deploy DB-GPT to multiple nodes, you can deploy a cluster. The cluster architecture diagram is as follows:

.. raw:: html

<img src="../../../_static/img/muti-model-cluster-overview.png" />


* On :ref:`Deploying on local machine <local-cluster-index>`. Local cluster deployment.

.. toctree::
:maxdepth: 2
:caption: Cluster deployment
:name: cluster_deploy
:hidden:

./vms/index.md
3 changes: 3 additions & 0 deletions docs/getting_started/install/cluster/kubernetes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Kubernetes cluster deployment
==================================
(kubernetes-cluster-index)=
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Cluster deployment
Local cluster deployment
==================================

(local-cluster-index)=
## Model cluster deployment


Expand All @@ -17,7 +17,7 @@ dbgpt start controller
By default, the Model Controller starts on port 8000.


### Launch Model Worker
### Launch LLM Model Worker

If you are starting `chatglm2-6b`:

Expand All @@ -39,6 +39,18 @@ dbgpt start worker --model_name vicuna-13b-v1.5 \

Note: Be sure to use your own model name and model path.

### Launch Embedding Model Worker

```bash

dbgpt start worker --model_name text2vec \
--model_path /app/models/text2vec-large-chinese \
--worker_type text2vec \
--port 8003 \
--controller_addr http://127.0.0.1:8000
```

Note: Be sure to use your own model name and model path.

Check your model:

Expand All @@ -51,8 +63,12 @@ You will see the following output:
+-----------------+------------+------------+------+---------+---------+-----------------+----------------------------+
| Model Name | Model Type | Host | Port | Healthy | Enabled | Prompt Template | Last Heartbeat |
+-----------------+------------+------------+------+---------+---------+-----------------+----------------------------+
| chatglm2-6b | llm | 172.17.0.6 | 8001 | True | True | None | 2023-08-31T04:48:45.252939 |
| vicuna-13b-v1.5 | llm | 172.17.0.6 | 8002 | True | True | None | 2023-08-31T04:48:55.136676 |
| chatglm2-6b | llm | 172.17.0.2 | 8001 | True | True | | 2023-09-12T23:04:31.287654 |
| WorkerManager | service | 172.17.0.2 | 8001 | True | True | | 2023-09-12T23:04:31.286668 |
| WorkerManager | service | 172.17.0.2 | 8003 | True | True | | 2023-09-12T23:04:29.845617 |
| WorkerManager | service | 172.17.0.2 | 8002 | True | True | | 2023-09-12T23:04:24.598439 |
| text2vec | text2vec | 172.17.0.2 | 8003 | True | True | | 2023-09-12T23:04:29.844796 |
| vicuna-13b-v1.5 | llm | 172.17.0.2 | 8002 | True | True | | 2023-09-12T23:04:24.597775 |
+-----------------+------------+------------+------+---------+---------+-----------------+----------------------------+
```

Expand All @@ -69,15 +85,15 @@ MODEL_SERVER=http://127.0.0.1:8000
#### Start the webserver

```bash
python pilot/server/dbgpt_server.py --light
dbgpt start webserver --light
```

`--light` indicates not to start the embedded model service.

Alternatively, you can prepend the command with `LLM_MODEL=chatglm2-6b` to start:

```bash
LLM_MODEL=chatglm2-6b python pilot/server/dbgpt_server.py --light
LLM_MODEL=chatglm2-6b dbgpt start webserver --light
```


Expand All @@ -101,9 +117,11 @@ Options:
--help Show this message and exit.

Commands:
model Clients that manage model serving
start Start specific server.
stop Start specific server.
install Install dependencies, plugins, etc.
knowledge Knowledge command line tool
model Clients that manage model serving
start Start specific server.
stop Start specific server.
```

**View the `dbgpt start` help**
Expand Down Expand Up @@ -146,10 +164,11 @@ Options:
--model_name TEXT Model name [required]
--model_path TEXT Model path [required]
--worker_type TEXT Worker type
--worker_class TEXT Model worker class, pilot.model.worker.defau
lt_worker.DefaultModelWorker
--worker_class TEXT Model worker class,
pilot.model.cluster.DefaultModelWorker
--host TEXT Model worker deploy host [default: 0.0.0.0]
--port INTEGER Model worker deploy port [default: 8000]
--port INTEGER Model worker deploy port [default: 8001]
--daemon Run Model Worker in background
--limit_model_concurrency INTEGER
Model concurrency limit [default: 5]
--standalone Standalone mode. If True, embedded Run
Expand All @@ -166,7 +185,7 @@ Options:
(seconds) [default: 20]
--device TEXT Device to run model. If None, the device is
automatically determined
--model_type TEXT Model type, huggingface or llama.cpp
--model_type TEXT Model type, huggingface, llama.cpp and proxy
[default: huggingface]
--prompt_template TEXT Prompt template. If None, the prompt
template is automatically determined from
Expand All @@ -190,7 +209,7 @@ Options:
--compute_dtype TEXT Model compute type
--trust_remote_code Trust remote code [default: True]
--verbose Show verbose output.
--help Show this message and exit.
--help Show this message and exit.
```

**View the `dbgpt model`help**
Expand All @@ -208,10 +227,13 @@ Usage: dbgpt model [OPTIONS] COMMAND [ARGS]...

Options:
--address TEXT Address of the Model Controller to connect to. Just support
light deploy model [default: http://127.0.0.1:8000]
light deploy model, If the environment variable
CONTROLLER_ADDRESS is configured, read from the environment
variable
--help Show this message and exit.

Commands:
chat Interact with your bot from the command line
list List model instances
restart Restart model instances
start Start model instances
Expand Down
3 changes: 1 addition & 2 deletions docs/getting_started/install/llm/llm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DB-GPT provides a management and deployment solution for multiple models. This c


Multi LLMs Support, Supports multiple large language models, currently supporting
- 🔥 Baichuan2(7b,13b)
- 🔥 Vicuna-v1.5(7b,13b)
- 🔥 llama-2(7b,13b,70b)
- WizardLM-v1.2(13b)
Expand All @@ -19,7 +20,6 @@ Multi LLMs Support, Supports multiple large language models, currently supportin

- llama_cpp
- quantization
- cluster deployment

.. toctree::
:maxdepth: 2
Expand All @@ -29,4 +29,3 @@ Multi LLMs Support, Supports multiple large language models, currently supportin

./llama/llama_cpp.md
./quantization/quantization.md
./cluster/model_cluster.md
22 changes: 13 additions & 9 deletions docs/locales/zh_CN/LC_MESSAGES/getting_started/install.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-16 18:31+0800\n"
"POT-Creation-Date: 2023-09-13 09:06+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
Expand All @@ -19,34 +19,38 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"

#: ../../getting_started/install.rst:2 ../../getting_started/install.rst:14
#: 2861085e63144eaca1bb825e5f05d089
#: ../../getting_started/install.rst:2 ../../getting_started/install.rst:15
#: e2c13385046b4da6b6838db6ba2ea59c
msgid "Install"
msgstr "Install"

#: ../../getting_started/install.rst:3 01a6603d91fa4520b0f839379d4eda23
#: ../../getting_started/install.rst:3 3cb6cd251ed440dabe5d4f556435f405
msgid ""
"DB-GPT product is a Web application that you can chat database, chat "
"knowledge, text2dashboard."
msgstr "DB-GPT 可以生成sql,智能报表, 知识库问答的产品"

#: ../../getting_started/install.rst:8 beca85cddc9b4406aecf83d5dfcce1f7
#: ../../getting_started/install.rst:8 6fe8104b70d24f5fbfe2ad9ebf3bc3ba
msgid "deploy"
msgstr "部署"

#: ../../getting_started/install.rst:9 601e9b9eb91f445fb07d2f1c807f0370
#: ../../getting_started/install.rst:9 e67974b3672346809febf99a3b9a55d3
msgid "docker"
msgstr "docker"

#: ../../getting_started/install.rst:10 6d1e094ac9284458a32a3e7fa6241c81
#: ../../getting_started/install.rst:10 64de16a047c74598966e19a656bf6c4f
msgid "docker_compose"
msgstr "docker_compose"

#: ../../getting_started/install.rst:11 ff1d1c60bbdc4e8ca82b7a9f303dd167
#: ../../getting_started/install.rst:11 9f87d65e8675435b87cb9376a5bfd85c
msgid "environment"
msgstr "environment"

#: ../../getting_started/install.rst:12 33bfbe8defd74244bfc24e8fbfd640f6
#: ../../getting_started/install.rst:12 e60fa13bb24544ed9d4f902337093ebc
msgid "cluster deployment"
msgstr "集群部署"

#: ../../getting_started/install.rst:13 7451712679c2412e858e7d3e2af6b174
msgid "deploy_faq"
msgstr "deploy_faq"

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, csunny
# This file is distributed under the same license as the DB-GPT package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-13 10:11+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
"Language-Team: zh_CN <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"

#: ../../getting_started/install/cluster/cluster.rst:2
#: ../../getting_started/install/cluster/cluster.rst:13
#: 69804208b580447798d6946150da7bdf
msgid "Cluster deployment"
msgstr "集群部署"

#: ../../getting_started/install/cluster/cluster.rst:4
#: fa3e4e0ae60a45eb836bcd256baa9d91
msgid ""
"In order to deploy DB-GPT to multiple nodes, you can deploy a cluster. "
"The cluster architecture diagram is as follows:"
msgstr "为了能将 DB-GPT 部署到多个节点上,你可以部署一个集群,集群的架构图如下:"

#: ../../getting_started/install/cluster/cluster.rst:11
#: e739449099ca43cabe9883233ca7e572
#, fuzzy
msgid ""
"On :ref:`Deploying on local machine <local-cluster-index>`. Local cluster"
" deployment."
msgstr "关于 :ref:`在本地机器上部署 <local-cluster-index>`。本地集群部署。"

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2023, csunny
# This file is distributed under the same license as the DB-GPT package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: DB-GPT 👏👏 0.3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-09-13 09:06+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: zh_CN\n"
"Language-Team: zh_CN <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.12.1\n"

#: ../../getting_started/install/cluster/kubernetes/index.md:1
#: 48e6f08f27c74f31a8b12758fe33dc24
msgid "Kubernetes cluster deployment"
msgstr "Kubernetes 集群部署"

Loading