# Exporting to training formats

> Write a slice as LeRobot, RLDS, WebDataset, MCAP, OpenUSD or MJCF, to your bucket or to signed URLs.

Source: https://rayform.world/docs/guides/exporting
Last updated: 2026-10-18
Status: Rayform is in private preview. APIs, formats and the SDK described here may change before general availability.

An export writes a [slice](https://rayform.world/docs/concepts#slices) in one format. Exports are cached by slice, format and options, so requesting the same export twice returns the existing files.

## Formats

| Format | `format` | Best for | Contains |
| --- | --- | --- | --- |
| LeRobot | `lerobot` | Imitation learning, VLA fine-tuning | Episodes as Parquet plus MP4 video, `meta/` info |
| RLDS | `rlds` | TensorFlow and Open X-Embodiment tooling | TFRecord episodes with RLDS step structure |
| WebDataset | `webdataset` | Large-scale PyTorch training | Tar shards of 256 MB to 1 GB |
| MCAP | `mcap` | Debugging, Foxglove, Rerun, ROS 2 | Aligned channels plus derived topics |
| OpenUSD | `usd` | Isaac Sim, Isaac Lab | Scene with Gaussian splats and collision meshes |
| MJCF | `mjcf` | MuJoCo | Collision meshes and a scene file |

## Options

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `cameras` | list of strings | all | Camera channels to include |
| `fps` | number | source rate | Resample every stream to this rate |
| `resample` | `"nearest"` or `"linear"` | `"nearest"` | Method for resampling non-image streams |
| `action` | string | none | Channel used as the action, for example `joints/position_delta` |
| `frame` | string | `"rayform"` | Output convention: `rayform`, `ros`, `opencv`, `opengl`, `isaac`, `mujoco` |
| `quat_order` | `"wxyz"` or `"xyzw"` | `"wxyz"` | Quaternion order in the output |
| `image_size` | `[width, height]` | source | Resize images |

## Exporting with Python

```python
export = client.exports.create(
    slice_,
    format="lerobot",
    options={"cameras": ["cam0/rgb", "wrist/rgb"], "fps": 15, "action": "joints/position_delta"},
    destination="s3://my-bucket/rayform/mug-grasps/",
)
export.wait()
print(export.status, export.files[:2])
```

To write to your own bucket, grant Rayform's export role write access to the prefix (see [Exports](https://rayform.world/docs/api/exports#destinations)). Without a `destination`, files are kept in Rayform storage and listed with signed URLs that expire after 15 minutes.

## Loading a LeRobot export

```python
from lerobot.datasets.lerobot_dataset import LeRobotDataset

ds = LeRobotDataset("rayform/mug-grasps", root="/data/rayform/mug-grasps")
print(ds.num_episodes, ds.features.keys())
```

Every episode's metadata carries `rayform.slice`, `rayform.segment` and `rayform.segment_version`, so you can trace any training sample back to its recording.

## Large exports

Exports run next to your data and write in parallel. For training clusters, export to a bucket in the same region as the cluster, so each epoch reads locally.
