Skip to main content

💌 Envelope: a JAX-native environment interface

xkcd: Standards
# Create environments from JAX-native suites you have installed, ...
env = envelope.create("gymnax::CartPole-v1")
<p># ... interact with the environments using a simple interface, ...
state, info = env.init(key)
states, infos = jax.lax.scan(env.step, state, actions)
plt.plot(infos.reward.cumsum())</p>
<p># ... and enjoy a powerful ecosystem of wrappers.
env = envelope.wrappers.AutoResetWrapper(env)
env = envelope.wrappers.VmapWrapper(env)
env = envelope.wrappers.ObservationNormalizationWrapper(env)

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, Info and step(state: State, action: PyTree) -> State, Info. You can directly jax.scan over a step(...)!
  • Spaces are super simple. No Tuple, Dict nonsense! There are two spaces: Continuous and Discrete, which you can compose into a PyTreeSpace.
  • 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 adapters
    • uv 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

jax_envelope-0.6.0.tar.gz (109.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jax_envelope-0.6.0-py3-none-any.whl (50.1 kB view details)

Uploaded Python 3

File details

Details for the file jax_envelope-0.6.0.tar.gz.

File metadata

  • Download URL: jax_envelope-0.6.0.tar.gz
  • Upload date:
  • Size: 109.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for jax_envelope-0.6.0.tar.gz
Algorithm Hash digest
SHA256 af5756d184c8b34c070359b30e145ffd2a515316467f17828f55fbbe1138212c
MD5 434c62e1880c8d847a51f7850588fb92
BLAKE2b-256 e3e5d9b5ed955c4d0aca2d838ed2d659e910c395743453536d7f6cee7c843495

See more details on using hashes here.

Provenance

The following attestation bundles were made for jax_envelope-0.6.0.tar.gz:

Publisher: publish.yml on keraJLi/envelope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jax_envelope-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: jax_envelope-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 50.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for jax_envelope-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de80dfe5feeb9072008c6ea481c866910d6f292606a1d1619c19462b86bc95c9
MD5 530ad3200370303dfd5b49ba4ae941e2
BLAKE2b-256 889b2cc8315155ac6a309ec60a4eb324b597acc5bc3590b5079051ae01ec619c

See more details on using hashes here.

Provenance

The following attestation bundles were made for jax_envelope-0.6.0-py3-none-any.whl:

Publisher: publish.yml on keraJLi/envelope

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.1

2 files

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

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