Practical overview
When it fits
Use DREAMER4 when you want code-level access to a Dreamer research implementation and are prepared to work with Python, training data and model checkpoints.
Who it is for
- Researchers exploring world models and model-based reinforcement learning.
- Python developers who want to inspect or adapt a Dreamer-style implementation.
- Experimenters working with video observations, action data and reward signals.
Documented uses
- Train a video tokenizer from video data and save a checkpoint.
- Train a dynamics model, optionally conditioned on action data.
- Generate imagined experience and use it in actor-critic learning examples.
- Explore the included HalfCheetah, Toy Snake and Moving MNIST workflows.
Requirements & limits
The repository is public, lists an MIT license, and provides `pip install dreamer4` as its installation command.
- The README describes training stages and runnable examples, rather than a hosted model interface.
- The primary workflow depends on video data and saved checkpoints; action-conditioned training additionally uses
.action.npyfiles alongside videos. - The repository is written primarily in Python and lists an MIT license.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train a tokenizer and dynamics model from video data
Use the documented CLI stages to train a video tokenizer, then train a dynamics world model from video data.
Before you start
- Python environment with DREAMER4 installed; the README gives
pip install dreamer4. - A video dataset available at a filesystem path.
- A saved tokenizer checkpoint for the dynamics-training stage.
Steps
Run
dreamer4 train-video-tokenizeron the video path, giving the experiment a name and selecting documented training options such as image size and batch size.Use the resulting tokenizer checkpoint with
dreamer4 train-dynamicson the video path.Load the trained dynamics model in Python with
DynamicsWorldModel.init_and_loadand its checkpoint path.
Expected outcome
A trained video tokenizer and a dynamics model checkpoint that can be loaded from Python.
Guide limitations
- The README's CLI examples do not specify a complete dependency list or hardware requirements.
- Action-conditioned training requires continuous or discrete actions saved as
.action.npyfiles alongside the videos.
Train and serve the Toy Snake world-model example
Follow the README's sequence to create a Snake replay buffer, train an action-conditioned dynamics model, and serve it for browser interaction.
Before you start
- DREAMER4 installed and the documented
uvcommand available for the PPO training step. - A grid-size setting for the Snake PPO example; the README shows
4. - The video tokenizer and dynamics checkpoints produced by the preceding stages.
Steps
Generate an initial replay buffer by running the command below.
uv run train_snake_ppo.py --grid_size 4Train a tokenizer on the generated buffer with
dreamer4 train-video-tokenizer, using the documented Snake example options.Train action-conditioned dynamics on the buffer with
dreamer4 train-dynamics, pointing to the tokenizer checkpoint and setting four discrete actions.Run
dreamer4 serve-world-modelwith the dynamics checkpoint folder to serve the model in the browser.
Expected outcome
The documented workflow serves the trained Toy Snake world model for browser interaction.
Guide limitations
- The serving example automatically looks for the latest EMA checkpoint in the supplied folder.
- The README does not specify the full environment setup or resource requirements for this workflow.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 8 October 2026
- Original website title
- lucidrains/dreamer4 · Official homepage title · retained in its source language

