The sklearn of reinforcement learning, now with 13K GitHub stars
A PyTorch library that treats RL algorithms like interchangeable estimators, so you can stop debugging PPO and start actually using it.

What it does
Stable Baselines3 is a collection of vetted reinforcement learning algorithms (PPO, SAC, TD3, DQN, and others) implemented in PyTorch with a unified, sklearn-style API. You instantiate a model, call learn(), and get a trained policy back. The library handles the vectorized environments, logging, and saving/loading so you don’t have to reimplement the tedious scaffolding around every paper you want to reproduce.
The interesting bit
The project deliberately caps its own ambition. The core repo is in maintenance mode—bug fixes, docs, polish—while experimental algorithms live in SB3-Contrib and a JAX rewrite (SBX) chases 20× speedups. This separation keeps the base library stable and compact, which is rarer in ML tooling than you’d hope.
Key highlights
- Implements 13+ algorithms with tested performance benchmarks and public W&B logs
- Supports custom environments, policies, callbacks, and
Dictobservation spaces out of the box - Integrates with Weights & Biases, Hugging Face, and TensorBoard for experiment tracking
- Companion RL Zoo provides tuned hyperparameters and training scripts for common environments
- Published in JMLR with a migration guide from the original TensorFlow Stable Baselines
Caveats
- Requires Python 3.10+ and PyTorch ≥ 2.3; Windows needs extra setup
- The README itself warns you shouldn’t use it without prior RL knowledge—it’s not a tutorial
- Core development is maintenance-only; new algorithms land in separate repos
Verdict
Grab this if you need reliable baselines for research comparisons or production prototypes. Skip it if you’re looking for bleeding-edge methods in one package, or if you need a gentle on-ramp to RL concepts.
Frequently asked
- What is DLR-RM/stable-baselines3?
- A PyTorch library that treats RL algorithms like interchangeable estimators, so you can stop debugging PPO and start actually using it.
- Is stable-baselines3 open source?
- Yes — DLR-RM/stable-baselines3 is open source, released under the MIT license.
- What language is stable-baselines3 written in?
- DLR-RM/stable-baselines3 is primarily written in Python.
- How popular is stable-baselines3?
- DLR-RM/stable-baselines3 has 13.6k stars on GitHub.
- Where can I find stable-baselines3?
- DLR-RM/stable-baselines3 is on GitHub at https://github.com/DLR-RM/stable-baselines3.