Skip to main content
Start from a recipe: a base model, a dataset and a few settings. train starts a job on Relay’s GPUs and returns at once.
To write the training loop yourself instead, see Training loops.

The config

str
required
The base model: "pi05".
str
required
A LeRobot dataset on the Hugging Face Hub, such as "lerobot/pusht_image". See Datasets.
int
default:"128"
Samples per step, 1 to 512.
float
default:"2.5e-5"
The peak learning rate, after warmup.
int
default:"6000"
Optimizer steps, 1 to 100,000.
str
default:"lora"
"lora" trains low-rank adapters; "full" trains every weight of the targets.
int
default:"32"
The adapters’ rank, 1 to 256.
float
LoRA’s alpha: the update is scaled by alpha / rank. By default, the rank.
list[str]
Where training goes. By default the action expert for LoRA, and the whole model in full. See Where training goes.
dict[str, str]
Model camera → dataset feature, such as {"base_0_rgb": "observation.images.top"}. By default, the dataset’s image features, in order.
str
A name for the job.
The rest is fixed: AdamW (β 0.9, 0.95), a linear warmup over the first tenth of the steps (at most 200), then cosine decay to zero; gradients clipped at norm 1; chunks of 10 actions; checkpoints every 1,000 steps.

Datasets

A dataset is a LeRobot dataset on the Hugging Face Hub, in format v2.1 (Relay reads the repo’s v2.1 revision), with:
  • its cameras stored as images ("dtype": "image" in meta/info.json). Datasets that store video aren’t supported yet;
  • the state in observation.state and the actions in action, each at most 32 wide;
  • the tasks in meta/tasks.jsonl: each frame’s task is its prompt.
Relay downloads a dataset once. If it has no norm_stats.json, Relay computes one: state and actions are normalized so their 1st and 99th percentiles map to −1 and 1, then padded with zeros to 32. Send states, and read actions, in those units when you serve the result.

The job

train returns a FineTuneJob, as the API last reported it:
Find jobs again:
A failed request raises RuntimeError with the API’s message, such as POST /v1/fine-tunes: 400 bad batch_size: 0.