Open-source project
lucas-maes/le-wm avatar
lucas-maes/le-wm

LeWorldModel (le-wm): a JEPA world model that trains from pixels end to end

Official code base for LeWorldModel: Stable End-to-End Joint-Embedding Predictive Architecture from Pixels

4,667 stars695 forksPythonMIT

At a glance

What is it?
LeWorldModel is the reference implementation for a two-loss JEPA world model, built on stable-worldmodel and stable-pretraining. It is a research codebase, not a drop-in planner, and the README assumes you already have HDF5 datasets and checkpoints in place.
Who is it for?
Adopt le-wm if you are reproducing or extending the LeWorldModel training objective and you already work with stable-worldmodel environments, HDF5 datasets and a GPU. Do not adopt it if you need a packaged planner with a stable API and no Hydra configs, or if you cannot supply the checkpoint layout that eval.py expects.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Activity is slowing. The repository last received commits 6 months ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 24, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • lucas-maes/le-wm4,667 ★ · +203
Star history
Repository2026-09-232026-11-24
lucas-maes/le-wm4.5k4.7k

203 Stars in the last 62 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What LeWorldModel is and who the repository is for

LeWorldModel (LeWM) is the official code base for a Joint-Embedding Predictive Architecture that learns a world model directly from raw pixels. The abstract frames the contribution narrowly: existing JEPAs avoid representation collapse through multi-term losses, exponential moving averages, pretrained encoders or auxiliary supervision, and LeWM replaces that with two loss terms, a next-embedding prediction loss and a regularizer that pushes latent embeddings toward a Gaussian. The stated effect is that tunable loss hyperparameters drop from six to one relative to the only existing end-to-end alternative.

The audience is narrow. This is a research repository from Lucas Maes, Quentin Le Lidec, Damien Scieur, Yann LeCun and Randall Balestriero, and the README points to an arXiv paper and a project website rather than to user documentation. The codebase deliberately does not reimplement environment management, planning or evaluation. Those come from stable-worldmodel, and training comes from stable-pretraining, so the repository itself is close to its core contribution: jepa.py for the architecture, module.py for the components, train.py and eval.py as entry points, and Hydra configs under config/. If you want a library with a supported Python API and a changelog, this is not it.

The two-loss objective and how the code is split

The mechanism the README describes is a joint-embedding predictor trained end to end from pixels. Two losses do the work: predicting the next embedding, and a regularizer that keeps latent embeddings Gaussian-distributed. That second term is what the authors present as the replacement for the collapse-avoidance machinery (EMA targets, multi-term losses, pretrained encoders) that other JEPAs depend on. The README does not spell out the regularizer's mathematical form, so anyone evaluating the method should read the paper rather than infer it from the code layout.

The repository is thin by design. jepa.py holds the PyTorch model, module.py holds the building blocks (the Hugging Face conversion snippet imports ARPredictor, Embedder and MLP from it), train.py and eval.py are the two entry points, and utils.py carries shared helpers. Hydra owns configuration: training configs live under config/train/ with per-dataset files such as config/train/data/pusht.yaml, and evaluation configs under config/eval/. The abstract puts the model at roughly 15M parameters and says it trains on a single GPU in a few hours, which is the practical reason this split works: the outer loops are borrowed, so the repository stays small enough to read in one sitting.

Installing le-wm and running a first training job

Installation goes through uv and the stable-worldmodel package with the train and env extras. The README gives these commands verbatim, including the Python version pin:

bash
uv venv --python=3.10
source .venv/bin/activate
uv pip install stable-worldmodel[train,env]

After activation, `stable-worldmodel` pulls in the training and environment machinery the repository depends on. There is no separate install step for le-wm itself in the README; the expectation is that you work from a checkout of this repository so that `jepa.py`, `module.py`, `train.py` and `eval.py` are importable.

Datasets are HDF5 files downloaded from the Hugging Face collection and decompressed with zstd. They must land under `$STABLEWM_HOME`, which defaults to `~/.stable-wm/`:

bash
tar --zstd -xvf archive.tar.zst
export STABLEWM_HOME=/path/to/your/storage

Dataset names are written without the `.h5` extension. The README's example is that `pusht_expert_train` in `config/train/data/pusht.yaml` resolves to `$STABLEWM_HOME/pusht_expert_train.h5`.

Before launching, set your WandB entity and project in `config/train/lewm.yaml`:

yaml
wandb:
  config:
    entity: your_entity
    project: your_project

Training is then a single Hydra invocation, and the README states that checkpoints are saved to `$STABLEWM_HOME` on completion:

bash
python train.py data=pusht

For evaluation, the `policy` field must be the checkpoint path relative to `$STABLEWM_HOME` and must omit the `_object.ckpt` suffix. The README marks both forms explicitly:

bash
# correct
python eval.py --config-name=pusht.yaml policy=pusht/lewm

# incorrect
python eval.py --config-name=pusht.yaml policy=pusht/lewm_object.ckpt

The suffix rule is easy to get wrong, because the file on disk has that suffix while the argument must not.

Loading checkpoints: the object ckpt versus the weights ckpt

Each checkpoint archive contains two files, and the distinction matters. `<name>_object.ckpt` is a serialized Python object that `eval.py` and the `stable_worldmodel` API consume directly. `<name>_weight.ckpt` is a weights-only `state_dict` for loading into your own model instance. If you plan to use the repository's evaluation path, you need the object checkpoint; if you are porting the architecture into a different training loop, the weights file is the one you want.

For programmatic use, the README shows `AutoCostModel`, which takes a `run_name` relative to `$STABLEWM_HOME` without the suffix, and an optional `cache_dir` that overrides the checkpoint root:

python
import stable_worldmodel as swm

# Load the cost model (for MPC)
cost = swm.policy.AutoCostModel('pusht/lewm')

The returned module is in `eval` mode and exposes PyTorch weights through `.state_dict()`. The Hugging Face mirror is a different shape: those repos ship `weights.pt` plus a `config.json`, and the README provides a conversion script that reconstructs the encoder with `spt.backbone.utils.vit_hf` and writes a `_object.ckpt` under `$STABLEWM_HOME/pusht/lewm_object.ckpt`. That script is long and depends on the exact config keys in `config.json`; treat it as a one-time migration step, not as a stable API.

Where le-wm is the wrong tool

The repository is not self-contained. Environment management, planning and evaluation all come from stable-worldmodel, and training comes from stable-pretraining. That means the failure modes you will hit are often not in this repository at all: a version bump in either dependency can change behavior that le-wm's configs assume, and the README documents no pinned versions beyond the Python 3.10 pin in the venv command. There is no lockfile in the top-level listing.

Second, the README does not document rollback, checkpoint resumption, or what happens when training is interrupted. Checkpoints are described as saved to `$STABLEWM_HOME` upon completion, which suggests an all-or-nothing save at the end of a run. If your GPU allocation is preemptible, that is a real constraint, and the README does not say how to work around it.

Third, the checkpoint argument convention is a footgun rather than a bug. A path that is correct as a filesystem path is wrong as a `policy` value. Nothing in the README says the loader validates this and produces a helpful message.

Finally, the scope is 2D and 3D control tasks with the listed environments (pusht, cube, tworooms, reacher). If your problem is not a control task with an HDF5 dataset in the expected format, the training pipeline gives you nothing to start from. The abstract's planning-speed claim is a comparison against foundation-model-based world models, not a claim that this codebase is fast to set up.

LeWM against DINO-WM and PLDM

The README ships a baseline checkpoint table that doubles as a comparison. PLDM and LeJEPA have checkpoints for all four environments (two-room, pusht, cube, reacher); IVL, IQL and GCBC cover three (no reacher); DINO-WM covers two-room and pusht only, while DINO-WM-noprop covers all four. Those baseline checkpoints live on Google Drive rather than on Hugging Face, which is a practical difference if your environment blocks Drive.

The methodological difference is the one the abstract draws. The abstract says existing JEPA methods rely on pretrained encoders, among other techniques, to avoid representation collapse. LeWM's claim is that the encoder and predictor train jointly from pixels without that scaffolding, using the Gaussian regularizer to prevent collapse. That is a real trade-off, not a free win. LeWM's end-to-end training means the representation is only as good as the data and the two losses allow. The README does not report a head-to-head number here, so if the distinction matters for your use case, the paper is the place to check it.

Licence, maintenance and what an upgrade costs

The repository is MIT licensed, with the LICENSE file at the top level. MIT is permissive: it allows reuse and modification with attribution and without a copyleft obligation on your own code. That is a statement about the licence text, not legal advice, and it does not cover the datasets or checkpoints hosted on Hugging Face, which carry their own terms that the README does not restate.

The last push to the default branch was on 2026-05-26. The repository is not archived, but it has no published releases, so there is no versioned upgrade path to follow. Practically, an upgrade means pulling the branch and re-reading the Hydra configs, because the config schema is the interface: `config/train/lewm.yaml` for WandB settings, `config/train/data/*.yaml` for dataset names, and `config/eval/*.yaml` for the `policy` field. Because training and evaluation are delegated to stable-worldmodel and stable-pretraining, a change in either dependency can alter behavior without any commit in this repository. Budget for that: if you pin nothing, a fresh `uv pip install stable-worldmodel[train,env]` months from now is not guaranteed to reproduce today's run.

Editorial conclusion

Adopt le-wm if you are reproducing or extending the LeWorldModel training objective and you already work with stable-worldmodel environments, HDF5 datasets and a GPU. Do not adopt it if you need a packaged planner with a stable API and no Hydra configs, or if you cannot supply the checkpoint layout that eval.py expects. Before running anything, verify three things: that STABLEWM_HOME points at storage large enough for the extracted .h5 files, that config/train/lewm.yaml has your WandB entity and project set, and that the policy argument you pass to eval.py is relative to STABLEWM_HOME without the _object.ckpt suffix.

Frequently asked questions

What is le-wm?

le-wm is the official code base for LeWorldModel, a Joint-Embedding Predictive Architecture that trains a world model end to end from raw pixels using two loss terms: a next-embedding prediction loss and a regularizer enforcing Gaussian-distributed latent embeddings. It is a research repository, with environment management, planning and evaluation delegated to stable-worldmodel and training delegated to stable-pretraining.

How do I install le-wm?

The README's installation steps create a Python 3.10 virtual environment with uv and then install the stable-worldmodel package with the train and env extras. There is no separate install command for le-wm itself; you work from a checkout of the repository.

Where do LeWorldModel checkpoints live?

Pretrained LeWM checkpoints for each environment are mirrored on the Hugging Face Hub in the same collection as the datasets, and the full baseline checkpoint suite is on Google Drive. Each archive contains an `_object.ckpt` for the eval path and a `_weight.ckpt` weights-only file.

Why does eval.py reject my checkpoint path?

The `policy` field must be the checkpoint path relative to `$STABLEWM_HOME` and must omit the `_object.ckpt` suffix, so `policy=pusht/lewm` is correct and `policy=pusht/lewm_object.ckpt` is not. The file on disk does carry the suffix; the argument must not.

What does LeWorldModel use for training configuration?

Training is configured through Hydra config files under `config/train/`, and evaluation configs live under `config/eval/`. Before training you set your WandB entity and project in `config/train/lewm.yaml`.

Official sources

  1. Issues
  2. License: MIT
  3. lucas-maes/le-wm on GitHub
  4. Project website
  5. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/lucas-maes-le-wm.svg)](https://hysenlabs.com/projects/lucas-maes-le-wm)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/lucas-maes-le-wm.svg)](https://hysenlabs.com/projects/lucas-maes-le-wm)

Was this useful?