The adapter layer that bridges your physics simulator and a Dreamer-inspired world model adapter. One library. No boilerplate. One afternoon.
A thin but complete adapter layer. All the plumbing between the physics world and the RL world — so you focus on the science.
Six focused APIs that eliminate every friction point between your physics data and a validated world model.
One call before training — not after the crash. Scans Python, PyTorch, CUDA, VRAM, and Colab session time in parallel. Returns a Go/No-Go verdict with one actionable fix per failed check.
Define observation and action spaces in one line. Dimension mismatches surface at creation time, not at step 8 000. Each space exposes .explain() with normalization metadata.
Safetensors checkpoint every N steps, metadata embedded. Colab session disconnects mid-run? Load the last checkpoint in one call and continue — no manual hunt for your save file.
Register invariants — energy conservation, joint limits, torque bounds — as plain Python callables. Hard mode rejects invalid trajectories before they corrupt training. Structured reports per trajectory.
Three-panel GIF renders inline in Colab under 10 seconds — Imagination, Real trajectory, and their Difference. Debug world-model hallucinations without leaving your notebook.
Evaluate your trained adapter against the world-model-eval-lab harness. DreamerWMELAdapter implements random-shoot MPC in latent space — plug it directly into any WMEL BenchmarkEnvironment.
From a blank Colab session to a validated, exported adapted model.
import physlink
# 1 — Verify environment (15 seconds)
physlink.doctor()
# 2 — Define robot spaces
obs = physlink.ObservationSpace.from_proprioception(
joints=7,
include_velocity=True,
)
act = physlink.ActionSpace.continuous(
dims=7,
bounds=(-1.0, 1.0),
)
# 2b — Validate trajectory quality
schema = physlink.TrajectorySchema(obs_dims=obs.dims, act_dims=act.dims)
report = batch.quality_report(schema) # → PASS / WARN / FAIL per check
# 3 — World model adapter
adapter = physlink.DreamerV3Adapter(obs, act)
adapter.fit(trajectories, steps=10_000)
# 4 — Register invariant & validate
physlink.register_invariant(
adapter, "energy",
fn=lambda traj: compute_energy(traj),
tolerance=0.05,
)
report = adapter.compliance_report()
report.plot()
# 5 — Visualize & export
adapter.visualize(trajectories)
adapter.export("./run-2026/")
Measured time from clean environment to first validated adapted model.
| Task | Without PhysLink | With PhysLink |
|---|---|---|
| Env diagnostics | Debug silent OOM at step 8 000 | physlink.doctor() |
| Validate trajectory data before training | Manual checks scattered across notebooks | TrajectorySchema + batch.quality_report(schema) |
| Space definitions | Write framework-specific mappings per adapter | ObservationSpace.from_proprioception() |
| Session disconnect | Lose 3h of T4 training | One-call checkpoint restore, no lost progress |
| Physics check | Manually verify energy conservation | compliance_report() |
| Model diagnosis | Stare at loss curves | Triptych GIF — Imagination / Real / Diff |
| Total | 3–5 days | 1 afternoon |
No local CUDA setup. No conda environment. Open the notebook, select T4 runtime, run all cells.
physlink.doctor() confirms readiness