meta-llama/Llama-3.1-8B-Instruct
model from Hugging Face using a Python environment.
pip
(or pip3
on macOS)curl
pip
to install dstack:
pip3
is not available, you may need to install it or use pip
.config.yml
file is a global configuration used by dstack for all deployments on your computer. It’s essential to place it in the correct configuration directory.
config.yml
File
In the configuration directory, create a file named config.yml
with the following content:
YOUR_RUNPOD_API_KEY
with the API key you obtained from Runpod.
ADMIN-TOKEN
displayed is important for accessing the dstack web UI.http://127.0.0.1:3000
.ADMIN-TOKEN
from the server output..dstack.yml
File
Create a file named .dstack.yml
(or dstack.yml
if your system doesn’t allow filenames starting with a dot) with the following content:
YOUR_HUGGING_FACE_HUB_TOKEN
with your actual Hugging Face access token (read-access is enough) or define the token in your environment variables. Without this token, the model cannot be downloaded as it is gated..dstack.yml
file is located:
y
and press Enter
to confirm.
ports
configuration provides port forwarding from the deployed pod to localhost
, allowing you to access the deployed vLLM via localhost:8000
.
dstack apply
, you’ll see all the steps that dstack performs:
ports
configuration forwards port 8000
from the deployed pod to localhost
, you can access the vLLM server via http://localhost:8000
.
curl
curl
command to test the deployed model:
dstack apply
, you can stop the task by pressing Ctrl + C
.
You’ll be prompted:
y
and press Enter
to confirm stopping the task.
volume.dstack.yml
with the following content:
region
ties your volume to a specific region, which then also ties your Pod to that same region.llama31-volume
.
.dstack.yml
file to include the volume:
/data
directory inside your container.
By doing this, you can store models and data persistently, which can be especially useful for large models that take time to download.
For more information on using volumes with Runpod, refer to the dstack blog on volumes.