Stable Baselines3 (SB3) delivers tested PyTorch implementations of reinforcement learning algorithms for research and industry baselines. Online documentation explains installation, algorithms, training patterns, and integrations.
Overview
Stable Baselines3 is a PyTorch toolkit that implements common reinforcement learning algorithms with a unified interface. It follows the prior Stable Baselines lineage and targets users who already understand reinforcement learning basics.
The library supports custom Gymnasium environments and policies, dictionary observation spaces, callbacks, and TensorBoard logging. Documented algorithms span on-policy and off-policy methods with varied action space types, while experimental variants live in companion projects such as SB3 Contrib and SBX.
Documentation walks through training, saving and loading models, vectorized environments, Atari and robotics examples, and migration from earlier Stable Baselines versions. Integrations cover experiment trackers such as Weights & Biases and Hugging Face for sharing trained models.
A related RL Baselines3 Zoo project provides training scripts, hyperparameter tuning, benchmarking, and pre-trained agents for common environments. The docs site is the reference for API details, reproducibility notes, and export options for deployed models.
Key features
- Unified algorithm interface
- Custom environments and policies
- Dict observation spaces
- TensorBoard logging
- Training callbacks
- Vectorized environments
- Notebook-friendly usage
- Third-party experiment tracking
Use cases
- RL research baselines
- Benchmarking new algorithms
- Training Gymnasium agents
- Comparing policy methods
- Teaching RL with examples