# pufferai/pufferlib

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/pufferai-pufferlib).**

6,039 stars · 497 forks · C · MIT

## Links

- GitHub: https://github.com/PufferAI/PufferLib
- Homepage: https://puffer.ai/
- awesome-repositories: https://awesome-repositories.com/repository/pufferai-pufferlib.md

## Topics

`reinforcement-learning`

## Description

PufferLib is a reinforcement learning framework built around high-speed environment simulation and automatic hyperparameter optimization. It is designed to accelerate the entire RL training pipeline by running simulations at near-native speed and enabling the training of tiny models to super-human performance within seconds.

The framework achieves its speed through a single-process training loop that eliminates inter-process communication overhead, vectorized batched simulation for parallel environment execution, and compiled C extensions that offload performance-critical computations. It also includes an in-process hyperparameter search engine that automatically tunes training parameters by running concurrent trials that share memory, removing the need for manual tuning.

Beyond its core acceleration and optimization capabilities, PufferLib provides lightweight state serialization for fast checkpointing and experiment resumption, and a pure-Python environment wrapping interface that avoids serialization overhead when integrating existing simulation environments.

## Tags

### Development Tools & Productivity

- [RL Environment Simulators](https://awesome-repositories.com/f/development-tools-productivity/high-speed-linkers/rl-environment-simulators.md) — Runs reinforcement learning environments at high speed to reduce training wall-clock time.

### Artificial Intelligence & ML

- [Tiny Model Training](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/training-frameworks/model-training-frameworks/speech-model-training/super-resolution-training/tiny-model-training.md) — Trains small RL models to super-human performance in seconds using fast simulation and built-in tuning.
- [Hyperparameter Tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/model-fine-tuning-resources/hyperparameter-tuning.md) — Searches for optimal hyperparameters during training to maximize model performance without manual tuning. ([source](https://cdn.jsdelivr.net/gh/pufferai/pufferlib@4.0/README.md))
- [In-Process Hyperparameter Search](https://awesome-repositories.com/f/artificial-intelligence-ml/model-fine-tuning-resources/hyperparameter-tuning/hyperparameter-search-strategies/in-process-hyperparameter-search.md) — Runs concurrent hyperparameter trials in-process, sharing memory to avoid inter-process communication costs.
- [Hyperparameter Optimizers](https://awesome-repositories.com/f/artificial-intelligence-ml/optimization-algorithms/hyperparameter-optimizers.md) — Automatically searches for optimal training hyperparameters through in-process concurrent trials that share memory.
- [High-Speed Simulators](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-algorithms/reinforcement-learning-simulators/high-speed-simulators.md) — Runs RL environment simulations at high speed to shorten training cycles and reduce wall-clock time. ([source](https://cdn.jsdelivr.net/gh/pufferai/pufferlib@4.0/README.md))
- [Reinforcement Learning Research Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-research-frameworks.md) — An accelerated framework for training reinforcement learning agents with fast environment simulation and automatic hyperparameter tuning.
- [Reinforcement Learning Training Utilities](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-training-utilities.md) — Trains tiny RL models to super-human performance within seconds using fast simulation and built-in tuning. ([source](https://puffer.ai/))
- [Super-Human Training](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-training/super-human-training.md) — Trains tiny RL models to super-human performance within seconds using fast simulation and built-in tuning. ([source](https://cdn.jsdelivr.net/gh/pufferai/pufferlib@4.0/README.md))
- [RL Environment Wrapping Tools](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-environments/rl-environment-wrapping-tools.md) — Wraps existing Python simulation environments with a thin, zero-copy interface to avoid serialization overhead.

### Part of an Awesome List

- [Batched Environment Simulators](https://awesome-repositories.com/f/awesome-lists/ai/simulation-environments/batched-environment-simulators.md) — Runs multiple environment instances in parallel within a single process, batching observations and actions for GPU-accelerated training.
- [Reinforcement Learning Accelerations](https://awesome-repositories.com/f/awesome-lists/data/physics-and-simulation/robotic-physics-and-sensor-simulators/gpu-accelerated-robot-simulators/reinforcement-learning-accelerations.md) — Runs RL training loops at high speed by eliminating inter-process communication and offloading simulation to compiled C extensions.

### DevOps & Infrastructure

- [RL Pipeline Executors](https://awesome-repositories.com/f/devops-infrastructure/single-node-deployment/single-process-servers/rl-pipeline-executors.md) — Executes simulation, model inference, and gradient updates within a single process to remove synchronization bottlenecks.
- [RL Training Loops](https://awesome-repositories.com/f/devops-infrastructure/single-node-deployment/single-process-servers/rl-training-loops.md) — Executes simulation, model inference, and gradient updates in a single process to eliminate synchronization bottlenecks.

### Programming Languages & Runtimes

- [RL Simulation Accelerators](https://awesome-repositories.com/f/programming-languages-runtimes/python-compilers/c-extensions/rl-simulation-accelerators.md) — Offloads performance-critical RL simulation loops to compiled C extensions for near-native speed.

### Software Engineering & Architecture

- [Model State Serialization](https://awesome-repositories.com/f/software-engineering-architecture/configuration-serializers/execution-state-serializers/model-state-serialization.md) — Saves and loads model and environment state using compact binary formats for fast checkpointing.
