This tutorial shows how to use Instant Clusters with Ray to run distributed inference on large language models. By combining Ray’s cluster management with vLLM’s tensor and pipeline parallelism, you can serve models that exceed the memory of a single node — for example, a 70B parameter model across multiple 8×H100 pods.
Ray handles the cluster topology; vLLM uses it to split the model across GPUs both within each node (tensor parallelism) and across nodes (pipeline parallelism).
Requirements
- A Runpod account with sufficient credits for a multi-node cluster
- Basic familiarity with large language model inference and distributed GPU setups
Step 1: Deploy an Instant Cluster
-
Open the Instant Clusters page.
-
Click Create Cluster.
-
Name your cluster and configure it. For this walkthrough, set Pod Count to 2 and select 8× H100 SXM GPUs per pod. Use the Runpod PyTorch template as your base image.
Increase /dev/shm when configuring your pod. The default (64 MB) is too small for large tensor-parallel workloads. Set it to at least 8 GB. In the pod configuration, add the environment variable MALLOC_ARENA_MAX=1 and set --shm-size to 8g in your Docker run options.
-
Click Deploy Cluster. You are redirected to the Instant Clusters page.
Step 2: Start the Ray head on pod-0
The first pod (CLUSTERNAME-pod-0) runs the Ray head node. All other pods connect to it as workers.
-
Click your cluster to expand the pod list.
-
Click CLUSTERNAME-pod-0, then click Connect → Web Terminal.
-
In the terminal, clone the reference scripts:
-
Run the head startup script:
The script sets the correct NIC address and starts Ray:
RAY_NODE_IP_ADDRESS and VLLM_HOST_IP must be set to the pod’s internal network IP — not 0.0.0.0. Setting them prevents Ray and vLLM from binding to the wrong interface on multi-NIC pods.
Step 3: Join the worker pods to the cluster
Repeat this for each remaining pod in the cluster (pod-1, pod-2, …).
-
In the Instant Clusters page, click the next pod and open its Web Terminal.
-
Clone the same scripts:
-
Run the worker startup script:
The script waits for the head to be reachable, then joins:
$MASTER_ADDR is injected automatically by Runpod into all pods in the cluster — it resolves to pod-0.
Step 4: Verify the cluster
Run this on pod-0 to confirm all nodes have joined:
Expected output for a two-pod cluster with 8 GPUs each:
You can also open the Ray dashboard. The console shows the dashboard port in the Connect dialog for pod-0.
Step 5: Launch distributed inference with vLLM
Run this on pod-0 only. vLLM uses the Ray cluster that is already running.
The script launches vLLM with tensor parallelism across GPUs within each node and pipeline parallelism across nodes:
--tensor-parallel-size should equal the number of GPUs per node ($NUM_TRAINERS). --pipeline-parallel-size should equal the number of nodes ($NUM_NODES). Both are injected as environment variables by Runpod.
vLLM connects to the running Ray cluster automatically. It may take several minutes to load model weights across all nodes.
Step 6: Test the endpoint
Once vLLM reports that it is ready, validate from pod-0:
Then send a test request:
Step 7: Clean up
When you are done, return to the Instant Clusters page and delete your cluster. Leaving it running continues to incur charges.
Environment variables reference
Runpod injects these environment variables into every pod in the cluster. The startup scripts rely on them.
Common issues
Ray workers don’t join
Confirm $MASTER_ADDR resolves from each worker pod. Run ping $MASTER_ADDR in a worker terminal. If it fails, the cluster network may still be initializing — wait 30 seconds and try again.
vLLM OOM during model load
Check that /dev/shm is large enough (at least 8 GB for 70B models). Also verify that --tensor-parallel-size matches the number of GPUs per node — a mismatch causes uneven shard sizes.
VLLM_HOST_IP binding error
This error occurs when vLLM tries to bind to 0.0.0.0 on a pod with multiple network interfaces. Make sure VLLM_HOST_IP is set to the internal IP (hostname -I | awk '{print $1}') before starting the server.
Stale Ray cluster after restart
If you restart a pod, Ray does not automatically rejoin the cluster. Rerun head.sh on pod-0 first, then worker.sh on all other pods.
Next steps