pufferlib

Vectorize Gymnasium, PettingZoo, and Ocean environments for parallel reinforcement learning training.

33.0k|3.2k|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill pufferlib-k-dense-ai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pufferlib
Source: https://github.com/K-Dense-AI/scientific-agent-skills/tree/main/scientific-skills/pufferlib
Command: npx skills add https://github.com/K-Dense-AI/scientific-agent-skills --skill pufferlib-k-dense-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires torch, numpy, pufferlib, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Accelerates reinforcement learning workflows by providing a high-performance, vectorized training engine and ready-made templates for single- and multi-agent tasks across diverse environments.

Core Features & Use Cases

  • High-speed PPO/LSTM training with PuffeRL and native multi-agent support
  • Native vectorization of environments for Gymnasium, PettingZoo, and Ocean-like suites
  • Flexible templates for training loops and custom environments
  • Seamless integration with common RL tooling and scalable experimentation

Quick Start

Create a vectorized training run by launching PuffeRL on an environment with multiple parallel instances.

Frequently Asked Questions about pufferlib

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I speed up reinforcement learning training with vectorized environments?▼

Pufferlib accelerates multi-agent reinforcement learning by applying shared-memory vectorization to run multiple parallel environment instances with zero-copy observations. This enables high-speed PPO and LSTM training across single- and multi-agent tasks.

Can I use Pufferlib for multi-agent training in PettingZoo environments?▼

Yes, Pufferlib natively supports multi-agent reinforcement learning workflows and provides vectorization for PettingZoo, Gymnasium, and Ocean-style suites. It includes flexible templates to scale experimentation across these platforms.

Does Pufferlib work with PyTorch for high parallelism training?▼

Yes, Pufferlib relies on PyTorch and the PuffeRL framework to support high parallelism in reinforcement learning. It integrates with common RL tooling to execute scalable experimentation.

How do I integrate custom environments into a vectorized training loop?▼

Pufferlib provides flexible templates for training loops and custom environment integration. You can use these templates to structure your reinforcement learning workflows while leveraging shared-memory vectorization for zero-copy observations.

What is shared-memory vectorization for zero-copy observations in RL?▼

Shared-memory vectorization is a mechanism that allows multiple parallel environment instances to access observation data directly without copying it. This zero-copy approach drastically reduces overhead during high-speed reinforcement learning training.