tiny-jepa
World Labs for your laptop. A tiny, hackable, action-conditioned JEPA (Joint Embedding Predictive Architecture) world model — in pure numpy, zero required dependencies. The whole thing is ~1,500 lines you can read in an afternoon. Inspired by Yann LeCun's predictive world-model program and the spatial-intelligence spirit of Fei-Fei Li's World Labs.
The shipped checkpoint, hunting pellets with learned vision — no hand-coded game AI, just a world model that imagines, perceives, and plans.
Install
pip install git+https://github.com/OpenSourceRulesz/tiny-jepa.git
# PyPI (pip install tiny-jepa) coming soon
# extras: pip install "tiny-jepa[onnx]" (ONNX export)
# pip install "tiny-jepa[gym]" (Gymnasium wrapper)
5-line quickstart
from tiny_jepa import TinyJEPA, OrbyWorld
model = TinyJEPA.load("tiny_jepa/checkpoints/orby_v1.npz") # pretrained
env = OrbyWorld(seed=0)
for _ in range(64):
env.step(model.plan(env.render(), env.agent)) # see, imagine, act
That's it — a world model hunting pellets from raw pixels. Now go crazy:
model.imagine(z, actions) rolls out latent futures, model.dream(frame, actions) decodes them to images, train_on_env / train_on_data train
your own worlds.
Try it with zero installs:
— or drive it yourself in the playable web demo.
What's inside
| Module | What it does |
|---|---|
TinyJEPA |
encode / imagine / decode / dream / perceive_pellet / predict_reward / plan / save / load |
train |
train_on_env (built-in world), train_on_data (your own trajectories) |
export_onnx |
Bit-accurate ONNX export for any runtime |
envs |
OrbyWorld (built-in 2D world) + GymWrapper |
checkpoints/orby_v1.npz |
Pretrained: ~8.6 pellets/episode vs ~0.2 random |
challenges/ |
Quests. Start here if you want to make your mark |
tiny_jepa/bench |
tiny-spatial: 5-probe spatial-intelligence benchmark (SPEC.md) |
tiny-spatial — does your world model understand space?
from tiny_jepa.bench import run_benchmark
run_benchmark("tiny_jepa/checkpoints/orby_v1.npz").print()
Five probes — object permanence under occlusion, hallucination (does it collapse to the dataset prior when blind?), surprise at expectation violations, spatial memory across rooms, memory updates. The shipped checkpoint scores spatial_iq 0.501: it notices surprises and limps along under occlusion, but half-hallucinates when blind and can't do rooms. Beat it.
Hierarchical JEPA — two timescales
tiny_jepa/hjepa.py adds a slow level on top of the frozen fast model:
every 8 steps it picks a subgoal (pellet when visible, novel territory
or last-seen position when not) using a learned command-conditioned
forward model, then steers to it greedily with event-driven replans.
from tiny_jepa import HierarchicalJEPA
hier = HierarchicalJEPA.load("tiny_jepa/checkpoints/orby_v1.npz",
"tiny_jepa/checkpoints/orby_hier_v1_slow.npz")
hier.plan(frame, agent_xy) # drop-in for TinyJEPA
| flat orby_v1 | hierarchical | |
|---|---|---|
| clean pellets/ep | 8.85 | 6.55 |
| tiny-spatial IQ | 0.501 | 0.577 |
| P4 rooms | 0.20 ❌ | 0.30 ✅ |
| P5 memory update | 0.35 | 0.55 |
The tradeoff is principled: hierarchy costs a little reactive hunting skill and buys spatial reasoning — rooms, exploration, last-seen memory. Same story as H-JEPA vs flat JEPA in the literature.
Challenges — make your mark
challenges/ has concrete quests with success metrics, from "beat the
greedy planner" to "teach it object permanence." The leaderboard is empty.
Your move.
Honest limits
32-dim latent, ~200k params, toy 2D world — not a general world model.
Dreams blur with horizon; the planner is greedy, not full MPC. The
architecture is the real JEPA idea end to end, and it's yours to extend:
hierarchical timescales and CEM planning are the obvious next frontiers
(see challenges/).
Citation
@software{tiny_jepa_2026,
title = {tiny-jepa: a tiny, hackable, action-conditioned JEPA world model},
author = {OpenSourceRulesz},
year = {2026},
url = {https://github.com/OpenSourceRulesz/tiny-jepa}
}
MIT licensed.
Metadata
Release files for tiny-jepa 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tiny_jepa-0.1.0.tar.gz | 527.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tiny_jepa-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.1 MB
Release files / tiny_jepa-0.1.0.tar.gz
| Download URL | tiny_jepa-0.1.0.tar.gz |
|---|---|
| Size | 527.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a950dc95e5928c225f4afc11478da103946831cbcd158819e24213049382104
|
|
BLAKE2b-256 checksum How to use checksums |
c1df985fb3ff795230757815bbcf2b69ef4371643918fc7fbefb334c61f0f386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency logRelease files / tiny_jepa-0.1.0-py3-none-any.whl
| Download URL | tiny_jepa-0.1.0-py3-none-any.whl |
|---|---|
| Size | 524.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5497cb7c6d24301cf16fc9b9eb00c6bc960662b592f9f0128d5fb50cc1eeb01c
|
|
BLAKE2b-256 checksum How to use checksums |
1c6a32b9f4d13a0537696842d7336ab58b9ed96c7fd79f2732916eb44586d1bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.
Transparency log