Real-time Interactive RL Simulation in Your Browser
mjswan is a powerful framework for creating interactive MuJoCo simulations with real-time policy control, running entirely in the browser. Built on top of mujoco wasm, onnxruntime, and three.js, it enables easy sharing of RL simulation demos as static sites, perfect for GitHub Pages hosting.
Check out the demo ― ttktjmt.github.io/mjswan
News
- 2026-08-17: Created mjswan_playground, a collection of mjswan demos
- 2026-08-15: Became mjlab-native, covering most tasks in mjlab
- 2026-06-02: Adopted for the MuscleMimic live demo [Demo]
- 2026-05-06: Adopted for the GentleHumanoid live demo [Demo, X]
- 2026-04-08: Featured in the MuJoCo README
Features
- Real-time: Run mujoco simulations and policy control in real time.
- Interactive: Change the state of objects by applying forces.
- Cross-platform: Works seamlessly on desktop and mobile devices.
- VR & AR Support: Native WebXR viewer with tracked hands that interact with objects.
- Client-only: All computation runs in the browser. No server for simulation is required.
- Easy Sharing: Host as a static site for effortless demo distribution (e.g., GitHub Pages).
- Portable: Embed the simulation in a web page or Google Colab notebook.
- mjlab-native: Create a web demo of any mjlab tasks with minimal effort.
- Customizable: Visualize your mujoco models and onnx policies quickly.
Quick Start
mjswan can be installed with pip:
pip install mjswan # or 'mjswan[dev]', 'mjswan[examples]'
or with npm:
npm install mjswan
You can run the bundled demo with the mjswan CLI (after installing mjswan[examples]):
mjswan demo # runs the default demo
mjswan demo --list # see all available demos
The minimum python script for a sanity check:
import os, mujoco, mjswan
model_path = os.path.join(os.path.dirname(mujoco.__file__), "testdata", "model.xml")
mjspec = mujoco.MjSpec.from_file(model_path)
builder = mjswan.Builder()
builder.add_project(name="Sanity Check").add_scene(name="Test Model", spec=mjspec)
app = builder.build()
app.launch()
For detailed instructions, visit the documentation.
Third-Party Assets
mjswan incorporates mujoco models from the external sources in its demo. See the respective submodule for full details, including individual model licenses and copyrights. All models are used under their respective licenses. Please review and comply with those terms for any use or redistribution.
Robot Descriptions License ・ MuJoCo Playground License ・ MyoSuite License
Acknowledgments
This project was greatly inspired by the Facet project demo from the research group at Tsinghua University.
It is also built upon the excellent work of zalo/mujoco_wasm, one of the earliest efforts to run MuJoCo simulations in a browser.
License
This project is licensed under the Apache-2.0 License. When using mjswan, please retain attribution notices in the app to help other users discover this project.
Release files for mjswan 0.10.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mjswan-0.10.2.tar.gz | 13.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mjswan-0.10.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.9 MB
Release files / mjswan-0.10.2.tar.gz
| Download URL | mjswan-0.10.2.tar.gz |
|---|---|
| Size | 13.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
386d13b4bdd0af4ce74941028af0a8163bd3112e048b94a4681a426bc39048cd
|
|
BLAKE2b-256 checksum How to use checksums |
90dee82607762e850c7a3bd0f994922d263e630a5245b9442cf8654748ef9e3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.14 {"installer":{"name":"uv","version":"0.12.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mjswan-0.10.2-py3-none-any.whl
| Download URL | mjswan-0.10.2-py3-none-any.whl |
|---|---|
| Size | 14.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d13bbdea627e41398ff165dd287cceb05d83dcf631ced447b992084a7e1d34c
|
|
BLAKE2b-256 checksum How to use checksums |
2d8c63597e0d103a0986d6a6cd3c1fc038e0e70b552935682ff6368e1a4b6205
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.14 {"installer":{"name":"uv","version":"0.12.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|