Skip to main content

dstack

还没翻译译自英文(docs.vllm.ai)本页 12 段都还没译

dstack

vLLM_plus_dstack

vLLM can be run on a cloud based GPU machine with dstack, an open-source framework for running LLMs on any cloud. This tutorial assumes that you have already configured credentials, gateway, and GPU quotas on your cloud environment.

To install dstack client, run:

pip install dstack[all]
dstack server

Next, to configure your dstack project, run:

mkdir -p vllm-dstack
cd vllm-dstack
dstack init

Next, to provision a VM instance with LLM of your choice (NousResearch/Llama-2-7b-chat-hf for this example), create the following serve.dstack.yml file for the dstack Service:

Config

Then, run the following CLI for provisioning:

Command

After the provisioning, you can interact with the model by using the OpenAI SDK:

Code

Note

dstack automatically handles authentication on the gateway using dstack's tokens. Meanwhile, if you don't want to configure a gateway, you can provision dstack Task instead of Service. The Task is for development purpose only. If you want to know more about hands-on materials how to serve vLLM using dstack, check out this repository