stable-baselines3
Pytorch version of Stable Baselines, implementations of reinforcement learning algorithms.
Decision gist · record as of 2026-08-14
Yes. Stable Baselines3 is actively maintained, has no known vulnerabilities, installs with low friction, and is widely used (top 5000 PyPI packages). It's the standard choice for RL practitioners who want reliable algorithm implementations without reinventing core components. Install it if you're training RL agents or need a trusted baseline for comparison.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyTorch (torch) as a runtime dependency; ensure a compatible PyTorch installation is available for your system before importing.
- Low install friction with a pure-Python wheel and four runtime dependencies (gymnasium, numpy, torch, cloudpickle).
- The project is actively maintained with a recent release and high repository engagement (13690 stars), indicating stable ongoing support.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions, making the package suitable for both research and production deployments without licensing concerns.
last release 2026-06-15 (60 days) · last repo commit 2026-07-25 · 13,690 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,412,536 downloads/mo, #3,934 on PyPI
Alternatives
Verify before relying
pip install stable-baselines3
import gymnasium
from stable_baselines3 import PPO
env = gymnasium.make("CartPole-v1")
model = PPO("MlpPolicy", env, verbose=1)
model.learn(total_timesteps=10_000)
action, _states = model.predict(env.reset()[0])- Whether pre-trained model checkpoints or zoo environments are available beyond the core library.
- Performance characteristics and scalability limits for large-scale RL training tasks.
- GPU acceleration requirements and CUDA compatibility details for torch-based training.
What it is and what it does
Stable Baselines3 is a collection of production-ready reinforcement learning algorithms implemented in PyTorch. It provides a unified, scikit-learn-inspired interface for training RL agents on Gymnasium environments, making it accessible for both researchers and practitioners. The library abstracts away low-level implementation details while maintaining flexibility for customization.
The package is built on top of gymnasium, numpy, torch, and cloudpickle, handling the complexity of policy networks, value functions, and training loops so users can focus on environment design and hyperparameter tuning. It supports algorithms like PPO and DQN and is designed as a foundation for building new RL approaches or comparing novel methods against established baselines.
Use it for
- Train a reinforcement learning agent on a custom or standard Gymnasium environment for robotics or game-playing tasks.
- Establish a baseline for comparing new RL algorithms or techniques against well-tested implementations.
- Prototype RL solutions quickly using pre-built algorithms without implementing training loops from scratch.
- Conduct RL research with a modular, extensible codebase that separates policy, value, and environment concerns.
- Deploy trained RL policies in production systems where reproducibility and reliability are critical.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Stable Baselines3 is actively maintained, has no known vulnerabilities, installs with low friction, and is widely used (top 5000 PyPI packages). It's the standard choice for RL practitioners who want reliable algorithm implementations without reinventing core components. Install it if you're training RL agents or need a trusted baseline for comparison.
Install
stable-baselines3 on PyPI
Before you install
Low install friction with a pure-Python wheel and four runtime dependencies (gymnasium, numpy, torch, cloudpickle). The project is actively maintained with a recent release and high repository engagement (13690 stars), indicating stable ongoing support.
Requires PyTorch (torch) as a runtime dependency; ensure a compatible PyTorch installation is available for your system before importing.
License in practice
MIT license permits commercial and private use with minimal restrictions, making the package suitable for both research and production deployments without licensing concerns.
Quickstart
pip install stable-baselines3
import gymnasium
from stable_baselines3 import PPO
env = gymnasium.make("CartPole-v1")
model = PPO("MlpPolicy", env, verbose=1)
model.learn(total_timesteps=10_000)
action, _states = model.predict(env.reset()[0])
Verify before relying
- Whether pre-trained model checkpoints or zoo environments are available beyond the core library.
- Performance characteristics and scalability limits for large-scale RL training tasks.
- GPU acceleration requirements and CUDA compatibility details for torch-based training.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesgymnasiumnumpytorchcloudpickle |
| Maintenance | Actively maintained 60 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,412,536 / month, #3,934 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13 |
Evidence: stable_baselines3-2.9.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “reinforcement learning algorithms pytorch”
- stable-baselines3Stable Baselines3 provides PyTorch implementations of reinforcement…
- rsl-rl-libRSL-RL is a GPU-accelerated reinforcement learning library for…
- tianshouTianshou is a PyTorch-based reinforcement learning library that…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also sb3-contrib · tianshou · gymnasium · dopamine-rl · skrl · rsl-rl-lib · reasoning-gym · nemo-gym · torchrl · gym-aloha