Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
97264e5
Create documentation for Ray Clusters
lavanya-gunreddi Nov 17, 2026
5fdb4e2
Revise Ray and vLLM deployment tutorial
lavanya-gunreddi Nov 17, 2026
8f2761b
Add ray-clusters and ray-vllm to documentation
lavanya-gunreddi Nov 17, 2026
c339fb1
Revise Ray Clusters documentation for beta status
lavanya-gunreddi Nov 17, 2026
c8ee76d
Revise beta notice and remove TODO comment
lavanya-gunreddi Nov 17, 2026
61b25f1
Update Ray Clusters
lavanya-gunreddi Nov 18, 2026
1f03353
Update Ray Clusters
lavanya-gunreddi Nov 18, 2026
ac848b4
Update Ray Clusters
lavanya-gunreddi Nov 18, 2026
70d3960
Update Ray Clusters
lavanya-gunreddi Nov 18, 2026
685ef6a
Update Deploy your first Ray Cluster and ray-vllm
lavanya-gunreddi Nov 18, 2026
de02039
Update Overview
lavanya-gunreddi Nov 18, 2026
4c1587d
Update Overview
lavanya-gunreddi Nov 18, 2026
2b31c5c
Update Overview
lavanya-gunreddi Nov 18, 2026
559686b
Update Ray Clusters
lavanya-gunreddi Nov 18, 2026
7141b30
Update Ray Clusters
lavanya-gunreddi Nov 18, 2026
393848a
docs(instant-clusters): add a Ray Cluster inference tutorial with Lit…
taylorburmeister-runpod Nov 18, 2026
abd657e
docs(instant-clusters): document handing off to /start.sh from a cust…
taylorburmeister-runpod Nov 19, 2026
2cb9c92
docs(instant-clusters): add a Ray Cluster inference tutorial with Lit…
lavanya-gunreddi Nov 19, 2026
4b784c8
Update Ray Clusters, Deploy your first Ray Cluster and 1 more page
lavanya-gunreddi Nov 23, 2026
d4ba466
Update Ray Clusters
lavanya-gunreddi Nov 23, 2026
c9398c2
Update Serve a model across a Ray Cluster with vLLM and LiteLLM
lavanya-gunreddi Nov 23, 2026
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
7 changes: 7 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,16 @@
"instant-clusters",
"instant-clusters/configuration",
"instant-clusters/slurm-clusters",
"instant-clusters/ray-clusters",
"instant-clusters/scale-clusters",
"instant-clusters/cluster-observability",
{
"group": "Deployment guides",
"pages": [
"instant-clusters/pytorch",
"instant-clusters/axolotl",
"instant-clusters/ray-quickstart",
"instant-clusters/ray-litellm",
"instant-clusters/slurm"
]
}
Expand Down Expand Up @@ -2085,6 +2088,10 @@
{
"source": "/integrations/transformer-lab",
"destination": "/integrations/overview"
},
{
"source": "/instant-clusters/ray-vllm",
"destination": "/instant-clusters/ray-litellm"
}
],
"description": "Developer documentation for building, deploying, and scaling AI applications on Runpod.",
Expand Down
6 changes: 3 additions & 3 deletions instant-clusters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Instant Clusters provide fully managed multi-node compute with high-performance

## Get started

For distributed inference across multiple nodes, follow the [Ray and vLLM deployment guide](/instant-clusters/ray-vllm).
To run Ray workloads across multiple nodes, follow the [Ray Clusters quickstart](/instant-clusters/ray-quickstart).

<CardGroup cols={3}>
<Card title="Deploy a Slurm cluster" href="/instant-clusters/slurm-clusters" icon="splotch" horizontal>
Expand All @@ -30,8 +30,8 @@ For distributed inference across multiple nodes, follow the [Ray and vLLM deploy
<Card title="Axolotl fine-tuning" href="/instant-clusters/axolotl" icon="screwdriver" horizontal>
Fine-tune LLMs across multiple GPUs.
</Card>
<Card title="Distributed inference with Ray and vLLM" href="/instant-clusters/ray-vllm" icon="network-wired" horizontal>
Serve models across multiple nodes with Ray and vLLM.
<Card title="Deploy a Ray Cluster" icon="network-wired" horizontal href="/instant-clusters/ray-clusters">
Managed Ray for distributed GPU workloads.
</Card>
</CardGroup>

Expand Down
287 changes: 287 additions & 0 deletions instant-clusters/ray-clusters.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,287 @@
---
title: "Ray Clusters"
sidebarTitle: "Ray Clusters"
description: "Run Ray across multiple GPU nodes with Instant Clusters. Covers the Ray cluster image, environment variables, ports, dashboard access, and metrics."
tag: "Beta"
---

<Note>
Ray Clusters are in beta. Features and behavior may change before general availability.
</Note>

Ray Clusters are Instant Clusters that start a [Ray](https://docs.ray.io/) cluster across every node for you. Use them to run Ray jobs, Ray Serve applications, and other distributed workloads across multiple GPU nodes.

Every Ray Cluster runs the supported Ray cluster image (`runpod/ray-cluster`) or an image you build from it. The image starts Ray on each node, so you don't need to install Ray or run `ray start` yourself.

To deploy your first Ray Cluster, follow the [Ray Clusters quickstart](/instant-clusters/ray-quickstart).

## How Ray Clusters work

When you create a Ray Cluster, Runpod deploys one Pod per node and gives each Pod the cluster topology:

- `NODE_RANK`: the Pod's position in the cluster. The Pod with rank `0` is the Ray head node.
- `NUM_NODES`: the configured number of nodes in the cluster.
- Hostnames `node-0` through `node-N` in `/etc/hosts`, one for each member of the cluster. The head node is always `node-0`.

The image entrypoint uses these values to start Ray. On the head node, it runs `ray start --head`. On each worker, it waits until `node-0` is reachable, then joins the cluster. If the head node isn't running yet, workers keep retrying and join as soon as it comes up.

After Ray starts, the image starts the services on the head node: the Ray dashboard, JupyterLab, and the Grafana metrics stack.

Ray, Python, CUDA, and PyTorch versions are pinned in the image. Because the head and workers run the same image, their versions always match.

## The Ray cluster image

The supported image is published as pinned, versioned tags of [`runpod/ray-cluster`](https://hub.docker.com/r/runpod/ray-cluster). It includes Python, CUDA, PyTorch, and Ray 2.59.0.

{/* TODO(DOCS-609): Taylor to confirm final tag naming and template name for alpha (known tag: runpod/ray-cluster:1.1.2-cu1281-torch2130-ubuntu2404). */}

When you create a Ray Cluster, the console selects the Ray Cluster template automatically. It uses the supported image and exposes the right ports on the head node. If you change the template's ports, Runpod can't guarantee that the cluster works. Use the template as is unless you need dependencies that are slow to install for every job. See [build a custom image](#build-a-custom-image).

## Serve a model with the inference variant

The inference variant of the image (`runpod/ray-cluster:VERSION-inference-cu1300-torch2130-ubuntu2404`) serves one Hugging Face model across every node of the cluster, with no image build. It keeps the same entrypoint, so Ray starts exactly as it does with the base image. After every node has joined, the head node runs vLLM across the whole cluster and serves the model through a [LiteLLM](https://docs.litellm.ai/) proxy on port `4000`, with OpenAI-compatible and Anthropic-compatible APIs.

The **Ray Inference** template uses this image and exposes port `4000`. You configure the model with environment variables such as `MODEL_REPO` and `LITELLM_MASTER_KEY`. To deploy it, send requests, and connect coding agents such as Claude Code, follow [serve a model across a Ray Cluster with vLLM and LiteLLM](/instant-clusters/ray-litellm).

{/* TODO(DOCS-609): replace VERSION with the published tag once runpod/containers#245 ships. */}

## Create a Ray Cluster with the REST API

To create a Ray Cluster from code, call [`POST /v2/clusters`](/api-reference-v2/clusters/create-a-cluster) with `type` set to `RAY` and `templateId` set to the Ray Cluster template, or your own template built from the supported image:

```bash
curl -X POST https://api.runpod.io/v2/clusters \
-H "Authorization: Bearer RUNPOD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "my-ray-cluster",
"type": "RAY",
"templateId": "RAY_TEMPLATE_ID",
"compute": {
"gpuTypeId": "NVIDIA H100 80GB HBM3",
"gpuCountPerPod": 2,
"podCount": 2
}
}'
```

{/* TODO(DOCS-609): replace RAY_TEMPLATE_ID with the public Ray Cluster template ID once it's published. */}

To set environment variables such as `RAY_START_EXTRA_ARGS`, save them in your own template, because a request with `templateId` can't include `env`.

To find the head node, call [`GET /v2/clusters/CLUSTER_ID/pods`](/api-reference-v2/clusters/list-a-clusters-pods). The head node's `cluster` object has rank `0` and the role `RAY_HEAD`. Workers have the role `RAY_WORKER`.

For every request field, and for renaming or deleting a cluster, see the [Clusters API reference](/api-reference-v2/clusters/create-a-cluster).

## Run Ray jobs

Connect to the head node over [SSH](/pods/configuration/use-ssh) or JupyterLab, then submit work with `ray job submit` or a Python driver.

```bash
# Run on the head node.
ray job submit --working-dir . -- python my_job.py
```

This command uploads the current directory to the cluster and runs `my_job.py` as a Ray job.

For light, per-job dependencies, use Ray's [runtime environments](https://docs.ray.io/en/latest/ray-core/handling-dependencies.html) instead of building a new image:

```bash
ray job submit \
--working-dir . \
--runtime-env-json '{"pip": ["datasets", "transformers"]}' \
-- python my_job.py
```

Ray installs the listed packages on each node before running the job.

You can also keep a Python virtual environment on a [network volume](/storage/network-volumes) attached to the cluster. Point Ray at the environment's Python with `py_executable`:

```bash
ray job submit \
--working-dir . \
--runtime-env-json '{"py_executable": "/workspace/venv/bin/python"}' \
-- python my_job.py
```

Without `py_executable`, worker nodes run your job with the container's default Python, not the virtual environment.

## Environment variables

Set these variables in the environment variables of the template you use for the cluster.

| Variable | Default | Description |
| --- | --- | --- |
| `RAY_START_EXTRA_ARGS` | None | Extra arguments for `ray start` on every node, such as `--resources` or `--object-store-memory`. Can't include `--dashboard-port` or `--metrics-export-port`. |
| `JUPYTER_PASSWORD` | Set by Runpod | Token for JupyterLab on the head node. Also the default token for the Ray dashboard and Grafana. |
| `RAY_DASHBOARD_PASSWORD` | Value of `JUPYTER_PASSWORD` | Token for signing in to the Ray dashboard. |
| `GRAFANA_PASSWORD` | Value of `JUPYTER_PASSWORD` | Token for the Grafana instance on the head node. |
| `RAY_CLUSTER_METRICS` | `1` | Set to `0` to turn off the Prometheus and Grafana metrics stack on the head node. |

Runpod also sets `NODE_RANK`, `NUM_NODES`, and the standard cluster variables on every Pod. See the [Instant Clusters configuration reference](/instant-clusters/configuration) for the full list.

## Ports

The head node exposes the following HTTP ports through the [Runpod proxy](/pods/configuration/expose-ports). Each one requires a token. Worker nodes expose only non-HTTP ports such as SSH.

| Port | Service |
| --- | --- |
| `8266` | Ray dashboard. |
| `8888` | JupyterLab. |
| `8889` | Grafana. |
| `4000` | Inference API (LiteLLM). Ray Inference template only. |

The console's links to the Ray dashboard, JupyterLab, and Grafana include your token, so you're signed in when you open them.

The following ports are reserved inside every Ray Cluster Pod. Don't use them for your own services:

| Port | Purpose |
| --- | --- |
| `8265` | Ray dashboard. Unauthenticated and never exposed directly. |
| `20217` | Ray metrics endpoint on every node. |
| `6379` | Ray GCS, used by workers to join the head node. |

Ports `8265` and `20217` are fixed. If you set `RAY_DASHBOARD_PORT` or `RAY_METRICS_PORT` to a different value, or pass `--dashboard-port` or `--metrics-export-port` in `RAY_START_EXTRA_ARGS`, the container exits before Ray starts with an error that names the variable and the required value.

## Open the Ray dashboard
Comment thread
lavanya-gunreddi marked this conversation as resolved.
Resolved

The Ray dashboard runs on the head node behind a token-protected proxy on port `8266`. Ray's own dashboard port (`8265`) is never exposed, because it allows anyone who can reach it to submit jobs to your cluster.

To open the dashboard:

<Steps>
<Step title="Open your cluster">
Go to the [Instant Clusters page](https://console.runpod.io/instant-clusters) and select your Ray Cluster.
</Step>
<Step title="Connect to the head node">
Select the head Pod (rank `0`), then click **Connect**.
</Step>
<Step title="Open the dashboard">
Click **Ray Dashboard**. The console opens the dashboard with your token, and the dashboard sets a session cookie so you stay signed in.
</Step>
</Steps>

{/* TODO(DOCS-609): once the latest main-ui changes are deployed to prod, the Ray dashboard, Grafana, and Jupyter links also appear in the cluster status bar above the head node card. Update these steps then. */}

To open the dashboard from a URL instead, append your token as a query parameter:

```text
https://HEAD_POD_ID-8266.proxy.runpod.net/?token=RAY_DASHBOARD_PASSWORD
```

The token is the value of `RAY_DASHBOARD_PASSWORD`, or `JUPYTER_PASSWORD` if `RAY_DASHBOARD_PASSWORD` is unset. Requests without a valid token receive a `403` response.

## View cluster metrics

The Ray dashboard shows metrics in two places:

- **Cluster** tab: live CPU, GPU, memory, and disk usage for each node. Available with no setup.
- **Metrics** tab: historical charts for every node.

The **Metrics** tab is powered by a Prometheus and Grafana stack that runs on the head node. Prometheus discovers each node's metrics endpoint automatically, and Grafana comes with Ray's standard dashboards. When you open the Ray dashboard, it signs you in to Grafana too, so the charts load without a separate sign-in. Retention is capped by time and size so the stack can't fill the head node's disk.

Metrics data stays on the head node, inside your cluster, and is deleted when you delete the cluster.

New data takes a short time to reach the **Metrics** tab, so charts can lag the **Cluster** tab by a minute or more after a workload starts.

If you already run your own monitoring stack, set `RAY_CLUSTER_METRICS=0` to turn off the bundled stack. You can scrape each node's metrics endpoint at `node-RANK:20217/metrics` from inside the cluster.

## Build a custom image

Build your own image when you need dependencies that are slow to install for every job, or a locked, reproducible production image. Start from a pinned tag of the supported image and add your dependencies:

```dockerfile
FROM runpod/ray-cluster:TAG

# Add your dependencies.
RUN pip install --no-cache-dir my-package==1.2.3
```
Comment thread
lavanya-gunreddi marked this conversation as resolved.
Resolved

Your image inherits the supported image's entrypoint, start command, and the `com.runpod.ray-cluster.contract` label that Ray Clusters require. To keep your image compatible:

- Don't override `ENTRYPOINT`. The entrypoint is what starts Ray on each node.
- If you set your own `CMD`, end it with `/start.sh`. See [run your own start command](#run-your-own-start-command).
- Don't upgrade or downgrade Ray. The image logs a warning if the Ray version changes.
- Don't use ports `8265` or `20217` for your own services.

### Run your own start command

The image's default start command is `/start.sh`, which starts SSH, JupyterLab, the Ray dashboard proxy, and Grafana. The entrypoint starts Ray first and then runs the start command, so a custom `CMD` replaces `/start.sh`. If your command doesn't call it, those services don't start, and you can't connect to any node over SSH.

To run your own commands when the container starts, put them in a script that ends by handing off to `/start.sh`:

```bash start.sh
#!/bin/bash
set -euo pipefail

# Your per-boot setup.
python /opt/app/setup.py

# Hand off to the base image's start script.
exec /start.sh
```

```dockerfile
FROM runpod/ray-cluster:TAG

COPY start.sh /opt/app/start.sh
RUN chmod +x /opt/app/start.sh
CMD ["/opt/app/start.sh"]
```

`/start.sh` keeps running after the services start, so handing off with `exec` also keeps the container up. To run a long-lived process alongside the services, start it in the background before the handoff: `my-app & exec /start.sh`.

The start command runs on every node. To run a step only on the head node, check `NODE_RANK`:

```bash
if [[ "$NODE_RANK" == "0" ]]; then
serve deploy /workspace/serve_config.yaml &
fi
exec /start.sh
```

After you push the image, create a [template](/pods/templates/manage-templates) that uses it, then select that template when you create a Ray Cluster.

{/* TODO(DOCS-609): confirm how a customer template is marked Ray-capable in the console (STO-992 rayClusterCapable owner opt-in) and add the exact step here. */}

## Limitations

- Ray Clusters run only on the supported image or an image built from it. Creating a Ray Cluster with any other image fails.
- The status shown on the cluster card reflects the requested cluster, not whether Ray is ready. Run `ray status` on the head node to check readiness.
Comment thread
lavanya-gunreddi marked this conversation as resolved.
Resolved
- Ray processes aren't restarted automatically. If Ray exits on a node, the Pod stays up so you can connect and investigate, but that node leaves the cluster.
- If the head node restarts, workers that were already running don't rejoin on their own. Restart the worker Pods after the head node is back.

{/* TODO(DOCS-609): remove the cluster card status bullet once the latest main-ui changes are deployed to prod (fixed, not yet deployed). */}

## Troubleshooting

### Cluster creation fails with an image error

{/* TODO(DOCS-609): in the 11/12 demo this showed as a pod initialization "image pull error". Taylor plans to make the message more specific. Confirm the final text before publishing. */}

The Pods fail to initialize with an error saying that Ray cluster pods require the official Ray cluster image or an image built from it. The template uses an image that isn't the supported Ray cluster image or built from it, or the template overrides the image entrypoint. Use the Ray Cluster template, or rebuild your image with `FROM runpod/ray-cluster:TAG` and keep the entrypoint.

### Container exits with a port error

The template or image sets a reserved port, for example "RAY_METRICS_PORT is fixed at 20217". Remove the override and move your own service to a different port.

### Workers don't join the cluster

Connect to the head node and run:

```bash
ray status
```

The output lists each node that has joined. If a node is missing, check that Pod's logs for the entrypoint output. Workers retry until `node-0` is reachable, so a worker that started before the head node joins once the head node is running.

### Dashboard returns `403`

The request has no token or the wrong token. Open the dashboard from the console, or add `?token=` with your `RAY_DASHBOARD_PASSWORD` (or `JUPYTER_PASSWORD`) value.

## Next steps

- [Deploy your first Ray Cluster](/instant-clusters/ray-quickstart).
- [Serve a model across the cluster with vLLM and LiteLLM](/instant-clusters/ray-litellm).
- [Review Instant Cluster environment variables and networking](/instant-clusters/configuration).
- [Attach a network volume](/storage/network-volumes) to share data and environments across nodes.
Loading
Loading