💌 Envelope: a JAX-native environment interface
What I have to say in defense of yet another Jax RL library
Envelope is an environment interface.
- You will be able to set up the same experiments and get the same results with Gymnax or Jumanji.
- If you use coding agents, you easily set up any wrappers, logging, or compatibility you need.
- If what you care about is results, Envelope has little value to you.
But I made it because I care, and I want to get things right. Squeezing gym into Jax is hard. Envelope is my best attempt.
- Envelope gets things right that other libraries get wrong: spaces, wrappers, and adapters.
- It was designed purely by me, not coding agents. Not because I don't like them, but because they wouldn't get it right (as of July 2026).
- Agents have a better time using Envelope over other interfaces, in my subjective experience.
- It supports many popular suites, so you can interact with many environments in the same way.
- It's only requirement is Jax.
It's really good.
The rest of the readme was also written by me, despite the vibe-coding-coded vibes.
🌍 Simple, expressive interaction!
- Environments are pytrees. Squish them through JAX transformations and trace their parameters.
- Idiomatic jax-y interface of
init(key: Key) -> State, Infoandstep(state: State, action: PyTree) -> State, Info. You can directlyjax.scanover astep(...)! - Spaces are super simple. No
Tuple,Dictnonsense! There are two spaces:ContinuousandDiscrete, which you can compose into aPyTreeSpace. - Explicit episode truncation supports correctly handling bootstrapping for value-function targets.
- No auto-reset by default. Resetting every step can be expensive! Obviously Envelope has a wrapper for this.
💪 Powerful, composable wrappers!
- Carry state across episodes to track running statistics, for example to normalize observations.
- Explicit wrapper composition keeps episode boundaries correct. See the wrapper compatibility guide for enforced constraints and ordering examples.
🔌 Adapters for existing suites
| 📦 | # 🤖 | # 🌍 |
|---|---|---|
| brax | 🕺 | 12 |
| craftax | 🕺 | 4 |
| gymnax | 🕺 | 24 |
| jumanji | 🕺 / 👯 | 25 / 1 |
| kinetix | 🕺 | 4 |
| mujoco_playground | 🕺 | 54 |
| navix | 🕺 | 41 |
| Total | 🕺 / 👯 | 164 / 1 |
envelope.create("📦::🌍")
lets you create environments from any of the above!
📝 Testing
- Default (no optional adapters deps required):
uv run pytest -m "not adapters" - Adapters suite (requires full adapters dependency group):
uv sync --group adaptersuv run pytest -m adapters- Tests for suites unavailable in a partial installation are skipped.
🏗️ Installation
pip install jax-envelope
pip install "jax-envelope[navix]" # one published adapter
pip install "jax-envelope[adapters]" # all published adapters
Gymnax and Kinetix are temporarily source-backed development adapters rather than published extras.
💞 Related projects
- stoa is a very similar project that provides adapters and wrappers for the jumanji-like interface.
- Check out all the great suites we have adapters for! gymnax, brax, jumanji, kinetix, craftax, navix, mujoco_playground.
- We will be adding support for jaxmarl and pgx in the future, as soon as we figured out the best ever MARL interface for JAX!
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jax_envelope-0.6.1.tar.gz.
File metadata
- Download URL: jax_envelope-0.6.1.tar.gz
- Upload date:
- Size: 111.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ad298bb2b5eaa0295a0c2a65f04b2516708eb4ab3bf151192a695a7bd0d0612
|
|
| MD5 |
8716aec9f762362f5df9f9caa335a3da
|
|
| BLAKE2b-256 |
37aa9c7187cfb02c2c7456f6d06027a2c43a121a83d3ac2cce3a759bfeb267cd
|
Provenance
The following attestation bundles were made for jax_envelope-0.6.1.tar.gz:
Publisher:
publish.yml on keraJLi/envelope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_envelope-0.6.1.tar.gz -
Subject digest:
3ad298bb2b5eaa0295a0c2a65f04b2516708eb4ab3bf151192a695a7bd0d0612 - Sigstore transparency entry: 2211872836
- Sigstore integration time:
-
Permalink:
keraJLi/envelope@168a16bfff98d0343da0a7fe85483be1fcd347e7 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/keraJLi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@168a16bfff98d0343da0a7fe85483be1fcd347e7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jax_envelope-0.6.1-py3-none-any.whl.
File metadata
- Download URL: jax_envelope-0.6.1-py3-none-any.whl
- Upload date:
- Size: 50.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8143a97ee4ec3492adc61fc0c748354fc803f37ad46c91b31a688e702ab2c3a1
|
|
| MD5 |
12a2fbee10c0a460021d3e621e0d5a00
|
|
| BLAKE2b-256 |
f24a388422b051d1ce7b8a5b061f3134a3c72dffa6fe2f8d5fed68dfa6dbd8e3
|
Provenance
The following attestation bundles were made for jax_envelope-0.6.1-py3-none-any.whl:
Publisher:
publish.yml on keraJLi/envelope
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_envelope-0.6.1-py3-none-any.whl -
Subject digest:
8143a97ee4ec3492adc61fc0c748354fc803f37ad46c91b31a688e702ab2c3a1 - Sigstore transparency entry: 2211872851
- Sigstore integration time:
-
Permalink:
keraJLi/envelope@168a16bfff98d0343da0a7fe85483be1fcd347e7 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/keraJLi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@168a16bfff98d0343da0a7fe85483be1fcd347e7 -
Trigger Event:
release
-
Statement type: