AI/TLDR

Ray

Scale Python and ML workloads from a laptop to a cluster with one framework

GPU & Compute CloudsOpen source
Latest
2.58.0
Updated
23 Aug 2026
Language
Python
Coverage
3 stories
$pip install ray

What's new

2.58.023 Aug 2026

Ray 2.58.0 finishes KV-cache- and token-aware request routing for Ray Serve LLM: the router tokenizes inside its own ingress replica and passes tokens out-of-band, so the engine never tokenizes twice.

Latest news

Overview

Ray is an open-source framework for scaling Python and AI applications. It pairs a core distributed runtime with a set of higher-level AI libraries, so you can run the same code on a laptop and then on a cluster without rewriting it or managing extra infrastructure yourself.

It is aimed at Python and ML engineers who hit the limits of a single machine. The core gives you three building blocks: Tasks (stateless functions run across the cluster), Actors (stateful worker processes), and Objects (immutable values shared across the cluster). On top of that sit libraries for data, training, tuning, reinforcement learning, and serving.

As a compute-orchestration tool, Ray runs on any machine, cloud provider, or Kubernetes. It fits teams that want one way to distribute training, hyperparameter tuning, batch data jobs, and online model serving rather than stitching together separate systems for each.

What it does

  • Core distributed runtime with three primitives: Tasks (stateless functions), Actors (stateful workers), and Objects (shared immutable values)
  • Ray Data for scalable datasets and batch processing across a cluster
  • Ray Train for distributed model training
  • Ray Tune for scalable hyperparameter tuning
  • Ray Serve for programmable model and application serving, plus RLlib for reinforcement learning
  • Runs on any machine, cloud provider, or Kubernetes, with a Ray Dashboard and distributed debugger for monitoring

Getting started

Install Ray from PyPI, then use the core API to run Python functions across the cluster.

Install Ray

Install the package from PyPI. For nightly wheels, see the Ray installation page in the docs.

bashbash
pip install ray

Run a task on the cluster

Decorate a Python function with @ray.remote to turn it into a Task, call it with .remote(), and collect results with ray.get(). Ray starts a local runtime automatically when you call ray.init().

pythonpython
import ray

ray.init()

@ray.remote
def square(x):
    return x * x

futures = [square.remote(i) for i in range(4)]
print(ray.get(futures))  # [0, 1, 4, 9]

Explore the AI libraries

Once Ray Core works, layer on the higher-level libraries (Data, Train, Tune, RLlib, Serve) for distributed data processing, training, tuning, and serving. See the Ray documentation for each library's quickstart.

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Scale an existing Python script from a laptop to a cluster without rewriting it for new infrastructure
  • Run distributed model training and hyperparameter tuning with Ray Train and Ray Tune
  • Process large datasets in parallel with Ray Data as a batch compute layer
  • Serve models and applications online with Ray Serve

How Ray compares

Ray alongside other open-source gpu & compute clouds tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Ray★ 43.8kScale Python and ML workloads from a laptop to a cluster with one framework
Prefect★ 23.8kA Python-native workflow orchestration tool for scheduling, running, and monitoring data and ML pipelines.
Dagster★ 16.1kA data and ML pipeline orchestrator with a declarative asset model, built-in lineage, and observability.
Kubeflow★ 15.9kA Kubernetes toolkit that brings together pipelines, notebooks, and training operators for running ML workflows at scale.
Kedro★ 11kPython framework for production-ready data engineering and data science pipelines, hosted by the LF AI & Data Foundation: a project template, a Data Catalog of connectors, and a dependency-resolving pipeline abstraction.
SkyPilot★ 10.6kA framework that runs AI jobs across clouds and Kubernetes, automatically finding and provisioning the cheapest available GPUs.
Metaflow★ 10.3kA Python framework from Netflix for building and running data science and ML workflows that scale from laptop to cloud.
Flyte★ 7.5kA Kubernetes-native workflow engine for building reproducible, versioned ML and data pipelines.