mjlab-to-mjswan¶
Give it a repository that defines mjlab tasks, local or on GitHub. A coding agent ports one task, with its trained checkpoints, into a browser app.
Tip
For mjlab's own tasks with checkpoints on W&B or the Hugging Face Hub,
Builder.from_mjlab does this in one
line of Python.
Usage¶
- Install the
mjswanplugin. -
Run the skill on a GitHub URL or a local path:
-
Pick a task, and answer the agent's questions.
-
Open the app, from the repository root:
Requirements¶
gitand Python 3.10 to 3.13. The agent installs mjswan itself. No GPU needed.- Checkpoints: a W&B run, a Hugging Face repository, or
model_*.ptfiles.
Warning
If the repository pins other mujoco or mjlab versions than mjswan, the agent stops
and leaves the choice to you.
What the agent does¶
- Finds the repository's tasks, and asks you to pick one.
- Checks, in seconds, that mjswan supports the task's actions.
- Converts the checkpoints to ONNX.
- Writes
mjswan_app/and builds it, fixing what fails. - Checks that the converted code computes the same numbers as mjlab (parity check).
- Opens a pull request to mjswan, only if mjswan lacks something other tasks need too.
- Reports what was ported and what was skipped.
Watch it before you share it
The parity check compares numbers, not behavior. mjlab trains with mujoco_warp, the
browser runs MuJoCo's WebAssembly build, and a policy can behave differently.
Output¶
mjswan_app/
├── main.py the build script
├── terms.py rewritten terms, only if some failed to convert
├── README.md how to run it
└── dist/ the built app
To share dist/, see Deployment or
Publishing to Cloud.