skillfed

sb3-contrib

Contrib package of Stable Baselines3, experimental code.

sb3-contrib v2.9.0 439.1K downloads/30d#6,659 on PyPI729
Permissive license MIT Active released

What it is and what it does

SB3-Contrib is a companion package to stable_baselines3 that houses experimental and newer reinforcement learning algorithms and tools. It maintains the documentation and code style of the main library while hosting implementations that are either too niche, too experimental, or too difficult to integrate into the core package. The package includes algorithms like Augmented Random Search, Quantile Regression DQN, masked PPO variants, recurrent PPO, and Truncated Quantile Critics, along with environment wrappers.

The package is designed for researchers and practitioners who want access to cutting-edge RL implementations without waiting for them to mature enough for the main library. It trades stability guarantees for breadth: algorithms here follow consistent documentation and style but may not have the same level of testing or long-term support as core stable_baselines3 methods.

Use it for:

  • Implement action masking in PPO for environments with invalid actions using MaskablePPO
  • Train agents with recurrent policies using RecurrentPPO for partially observable environments
  • Experiment with newer algorithms like Truncated Quantile Critics or Trust Region Policy Optimization
  • Prototype RL solutions with less mature but potentially better-performing algorithms before production deployment
  • Access environment wrappers like Time Feature Wrapper to augment observation spaces

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides experimental reinforcement learning algorithms and tools that extend stable_baselines3 with newer implementations, including policy gradient variants, Q-learning methods, and environment wrappers.

Yes, if you need experimental RL algorithms or specialized policy variants beyond what stable_baselines3 core offers. The low install friction, active maintenance, and MIT license make it a reasonable addition to an RL workflow. The experimental nature of the algorithms means this is best suited for research or prototyping rather than production systems requiring stability guarantees.

Install

sb3-contrib on PyPI

pip

pip install sb3-contrib

uv

uv add sb3-contrib

poetry

poetry add sb3-contrib

Installing sb3-contrib

Before you install

Low friction installation as a pure Python wheel. Actively maintained with a recent release and steady commit activity. Requires the master version of stable_baselines3 as a runtime dependency.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open and closed projects with minimal obligations.

Quickstart

pip install sb3-contrib

from sb3_contrib import MaskablePPO
model = MaskablePPO('MlpPolicy', env)

Requires stable_baselines3 as a runtime dependency

Verify before relying

  • Whether the master version of stable_baselines3 requirement creates practical installation friction beyond standard dependency resolution
  • Performance or stability characteristics of experimental algorithms relative to stable_baselines3 core implementations

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 1 — stable_baselines3
Maintenance actively maintained — 60 days since the last release
Last repo commit
First released
Downloads 439,072/month — #6,659 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sb3_contrib-2.9.0-py3-none-any.whl

Keywords: reinforcement-learning-algorithms, reinforcement-learning, machine-learning, gym, openai, stable, baselines, toolbox, python, data-science

Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13

Tags

reinforcement learning algorithmsexperimental RL implementationsPPO LSTM recurrent policyaction masking reinforcement learningstable baselines extensionsdeep reinforcement learning toolspolicy optimization algorithms
reinforcement-learningexperimental-algorithmspolicy-gradient

More Artificial Intelligence packages

Further reading