README.md

June 2, 2026 · View on GitHub

stable-worldmodel

A platform for reproducible world model research and evaluation.

Documentation Tests PyPI ArXiv PyTorch Ruff Open In Colab

Installation · Quick Start · Environments · Solvers & Baselines · Documentation · Paper · Citation


stable-worldmodel provides a single, unified interface for the three stages of world model research — collecting data, training, and evaluating with model-predictive control — across a large suite of standardized environments. It ships with reference implementations of common baselines and planning solvers so research code can stay focused on the contribution that matters: the model and the objective.

Installation

From PyPI:

pip install stable-worldmodel            # base only
pip install 'stable-worldmodel[all]'     # + training, environments, and data formats

LeRobot dataset support is a separate opt-in extra (requires Python 3.12+): pip install 'stable-worldmodel[lerobot]'.

From source (development):

git clone https://github.com/galilai-group/stable-worldmodel
cd stable-worldmodel
uv venv --python=3.10 && source .venv/bin/activate
uv sync --extra all --group dev

Datasets and checkpoints are stored under $STABLEWM_HOME (defaults to ~/.stable_worldmodel/). Override the variable to point at your preferred storage location.

The library is in active development. APIs may change between minor versions.

Quick Start

import stable_worldmodel as swm
from stable_worldmodel.policy import WorldModelPolicy, PlanConfig
from stable_worldmodel.solver import CEMSolver

# 1. Collect a dataset
world = swm.World("swm/PushT-v1", num_envs=8)
world.set_policy(your_expert_policy)
world.collect("data/pusht_demo.lance", episodes=100, seed=0)

# 2. Load it and train your world model (format is autodetected)
dataset = swm.data.load_dataset("data/pusht_demo.lance", num_steps=16)
world_model = ...  # your model

# 3. Evaluate with model-predictive control
solver = CEMSolver(model=world_model, num_samples=300)
policy = WorldModelPolicy(solver=solver, config=PlanConfig(horizon=10))

world.set_policy(policy)
results = world.evaluate(episodes=50)
print(f"Success Rate: {results['success_rate']:.1f}%")

Reference implementations are provided in scripts/train/: lewm.py implements LeWM, and prejepa.py reproduces DINO-WM. To train directly from HuggingFace object storage with no local dataset download, see the Open In Colab notebook.

GPU utilization comparison
GPU utilization for LeWM trained with Push-T LanceDB dataset on a H200 GPU.

Data Formats

Recording, loading, and conversion all go through a small format registry. Pick the backend that matches your trade-off, or register your own.

FormatOn-disk layoutBest for
lanceLanceDB table (episode-contiguous flat rows)default — append-friendly, fast indexed reads
hdf5single .h5 file (one dataset per column)portable single-file artifact
folder.npz columns + one JPEG per stepinspection, partial-key streaming
video.npz columns + one MP4 per episode (decord)long episodes, compact image storage
lerobotlerobot://<repo_id> (read-only adapter)training/eval directly on LeRobot Hub datasets
world.collect("data/pusht.lance", episodes=100)                  # default: lance
world.collect("data/pusht_video", episodes=100, format="video")  # mp4 episodes

ds = swm.data.load_dataset("data/pusht.lance", num_steps=16)     # autodetect
swm.data.convert("data/pusht.lance", "data/pusht_video",
                 dest_format="video", fps=30)                    # one-shot migration

Every writer accepts a mode kwarg ('append' (default), 'overwrite', 'error'); re-running world.collect extends the existing dataset rather than failing.

Throughput & storage benchmarks

Numbers below were produced by scripts/benchmark/compare_h5_lance.py and can be reproduced with it. Benchmarks use the PushT dataset from the LeWorldModel paper.

Throughput

FormatSourceCachesamples/sms/step
HDF5localno-cache1416.145.2
HDF5localcached1474.043.4
LanceDBlocalno-cache4814.813.3
LanceDBlocalcached4431.314.4
Videolocal-1330.648.1
LanceDBs3no-cache3183.720.1
LanceDBs3cached3253.219.7
HDF5s3no-cache9.17032.5
HDF5s3cached756.584.6

Storage size per format (local)

FormatLocal size
HDF543.12 GB
LanceDB13.31 GB
Video496.29 MB

Environments























Top row: default appearance  ·  Bottom row: visual factor of variation

Environments are pulled from the DeepMind Control Suite, Gymnasium classic control, OGBench, Craftax, the Arcade Learning Environment (100+ Atari games), and classical world model benchmarks (Two-Room, PushT). Most environments ship with a set of factors of variation — independently controllable visual and physical parameters (lighting, textures, dynamics, morphology) — that make it straightforward to evaluate zero-shot generalization to distribution shifts without any additional setup. Adding a new environment only requires conforming to the Gymnasium interface.

Full environment list
Environment ID# FoV
swm/PushT-v116
swm/TwoRoom-v117
swm/OGBCube-v011
swm/OGBScene-v012
swm/HumanoidDMControl-v07
swm/CheetahDMControl-v07
swm/HopperDMControl-v07
swm/ReacherDMControl-v08
swm/WalkerDMControl-v08
swm/AcrobotDMControl-v08
swm/PendulumDMControl-v06
swm/CartpoleDMControl-v06
swm/BallInCupDMControl-v09
swm/FingerDMControl-v010
swm/ManipulatorDMControl-v08
swm/QuadrupedDMControl-v07
swm/CartPoleControl-v110
swm/MountainCarControl-v05
swm/MountainCarContinuousControl-v04
swm/AcrobotControl-v111
swm/PendulumControl-v19
swm/FetchReach-v38
swm/FetchPush-v311
swm/FetchSlide-v311
swm/FetchPickAndPlace-v311
swm/CraftaxClassicPixels-v1
swm/CraftaxClassicSymbolic-v1
swm/CraftaxPixels-v1
swm/CraftaxSymbolic-v1
ALE/* (100+ Atari games)

Solvers and Baselines

SolverType
Cross-Entropy Method (CEM)Sampling
Improved CEM (iCEM)Sampling
Model Predictive Path Integral (MPPI)Sampling
Predictive SamplingSampling
Gradient Descent (SGD, Adam)Gradient
Projected Gradient Descent (PGD)Gradient
Augmented LagrangianConstrained Opt
BaselineType
DINO-WMJEPA
PLDMJEPA
LeWMJEPA
GCBCBehaviour Cloning
GCIVLRL
GCIQLRL

Command-Line Interface

After installation, the swm command is available for inspecting/converting datasets, environments, and checkpoints without writing code:

swm datasets                                        # list cached datasets
swm inspect pusht_expert_train                      # inspect a specific dataset
swm envs                                            # list all registered environments
swm fovs PushT-v1                                   # show factors of variation for an environment
swm checkpoints                                     # list available model checkpoints
swm convert pusht_expert_train --dest-format video  # convert a dataset to another format

Documentation

The full documentation lives at galilai-group.github.io/stable-worldmodel, with API references, tutorials, and guides.

Built on stable-worldmodel

Citation

@misc{maes_lld2026swm,
  title  = {stable-worldmodel: A Platform for Reproducible World Modeling Research and Evaluation},
  author = {Lucas Maes and Quentin Le Lidec and Luiz Facury and Nassim Massaudi and
            Ayush Chaurasia and Francesco Capuano and Richard Gao and Taj Gillin and
            Dan Haramati and Damien Scieur and Yann LeCun and Randall Balestriero},
  year   = {2026},
  eprint = {2605.21800},
  archivePrefix = {arXiv},
  primaryClass = {cs.LG},
  url    = {https://arxiv.org/abs/2605.21800},
}

Questions

Open an issue — happy to help.