Skip to main content
There are four ways to install Miles. Docker is recommended because Miles pins patched versions of SGLang, Megatron-LM, and a few CUDA kernels. pip covers the FSDP and torchtitan backends, which need none of the patched kernels.
The image ships with:
  • PyTorch (matching the container’s CUDA / ROCm version)
  • Megatron-LM, SGLang, FlashAttention-3, DeepGEMM, Apex
  • Ray, uv, and Miles installed editable at /root/miles
See Hardware requirements for per-GPU status.

Method 2: pip (FSDP and torchtitan)

Every tagged release after the v0.2 line publishes a pure-Python miles wheel to a pip index at https://radixark.github.io/miles-wheels/simple/, next to the sglang wheel it was tested with, which it depends on. Linux x86_64 or aarch64, Python 3.11 or 3.12. PyPI has an unrelated project named miles, and pip gives every index equal weight, so install with uv, which takes each package from the first index that has it:
With plain pip, install the wheel by URL instead, with the index only for sglang:
  • [torchtitan] adds torchtitan and its torch floor; leave it off for FSDP alone. torch itself follows SGLang’s pin.
  • Megatron-LM is not installable this way: --train-backend megatron needs the Docker image. True-on-policy sampling-support replay also needs the image for now (it relies on FlashAttention-3 and the Miles router build).
Training still launches from a checkout’s train.py (Quick Start); the wheel supplies the miles package it imports. The Miles dashboard is not in the wheel: install it from the same checkout with pip install -e packages/miles-dashboard.

Method 3: From source

Clone and install in an existing environment.
Patched dependencies. Miles pins patched versions of SGLang and Megatron-LM. Installing them yourself at the wrong commit is the most common source of bug reports — use Docker if you can.

Method 4: Update an existing container

If you already run a Miles image and want the latest code:

Verify

Confirm Miles imports and the GPUs are visible:
If either command fails, see Debugging.

Hardware requirements

For multi-node training you also need a high-bandwidth interconnect — InfiniBand, RoCEv2, or Slingshot — and 200+ GB/s per node. Single-node jobs run fine over NVLink only.

Next steps