Skip to main content

mjswan

Real-time Interactive RL Simulation in Your Browser

deploy test docs pypi version npm version

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


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: Port any mjlab task to the web with the mjlab-to-mjswan skill.
  • Customizable: Visualize your mujoco models and onnx policies quickly.

News

Quick Start

mjswan can be installed with pip:

pip install mjswan  # or 'mjswan[dev]', 'mjswan[examples]'

or with npm:

npm install mjswan

The demos live in examples/, which the wheel does not ship, so run them with the mjswan CLI from a clone of this repository (after pip install -e '.[demo]'):

mjswan demo          # lists the bundled demos
mjswan demo simple   # runs the simple demo

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.

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

mjswan is licensed under the Apache-2.0 License.

  • Research and hobby use: modify freely.
  • Commercial use and company pages: please keep the swan icon in the control panel and the dialog it opens.

Please consider sponsoring if you find it useful 🦢

Metadata

Release files for mjswan 0.12.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mjswan 0.12.10
File Size Uploaded Provenance Actions
mjswan-0.12.10.tar.gz 11.7 MB Without provenance Details for mjswan-0.12.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mjswan 0.12.10
File Interpreter ABI Platform Actions
mjswan-0.12.10-py3-none-any.whl Python 3 none any Details for mjswan-0.12.10-py3-none-any.whl

Total release size: 23.7 MB

Release files / mjswan-0.12.10.tar.gz

Download URL mjswan-0.12.10.tar.gz
Size 11.7 MB
Tags Source
SHA-256 checksum
How to use checksums
65bfc3be5f26abb6294cd642b8b7d9efa4d7eaed8f50d110ca648e40deebbde3
BLAKE2b-256 checksum
How to use checksums
2213751b61f7d24aab4d8c91ec079fab8afbee953ceec6c3e066c5bbc353849a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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.12.10-py3-none-any.whl

Download URL mjswan-0.12.10-py3-none-any.whl
Size 12.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
dc55731ea2c25278bf0dd99c01cc890948ec0e45de51032a069b1ae54f270bbc
BLAKE2b-256 checksum
How to use checksums
57e8a9f8737c42f102e8bc61734170bb7061df4f2ddc3d9c057f1e7470f99f72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","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}

Security for mjswan 0.12.10

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.12.10 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page