PufferLib
Use PufferLib with an explicit version profile. Upstream currently has two incompatible surfaces:
| Profile | Status on 2026-07-23 | Main use |
|---|---|---|
pufferlib==3.0.0 | Latest stable PyPI release, published 2025-06-23 | Python/Gymnasium/PettingZoo emulation, pufferlib.vector, Torch PuffeRL |
source 4.0 | Upstream default branch; not the latest stable PyPI artifact | Native C Ocean environments, native CUDA trainer, optional Torch fallback |
Do not combine 3.0 imports with 4.0 config/CLI examples. The 4.0 redesign
removed the 3.0 emulation, vector, and pytorch modules from the current
package tree.
Safe defaults
- Start with bundled synthetic, CPU-only, network-free tools.
- Do not import an arbitrary environment by dotted path. Bundled tools accept only allowlisted built-ins and slug identifiers.
- Do not install or execute an unreviewed environment package, native extension, ROM, map, checkpoint, or pickle file.
- Verify official source, immutable revision, licenses, checksums or attestations, and build hooks. Sandbox native builds and first execution.
- Cap steps, environments, agents, workers, threads, buffers, memory, di…