Registry / ai-ml / skrl
library2.1.0pypypiunverified

Modular and flexible library for reinforcement learning on PyTorch and JAX. Current version: 2.1.0. Release cadence: irregular, with major features and bugfixes.

pip install skrl
INSTALL
IMPORT
SIG · SKRL
S
skrl
ai-mlpythonv2.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PPO
from skrl.agents.torch.ppo import PPO
from skrl.agents import PPO

Basic PPO training on CartPole-v1 using Gymnasium.

import gymnasium as gym from skrl.agents import PPO from skrl.resources.preprocessors import RunningStandardization from skrl.trainers import SequentialTrainer from skrl.memories import RandomMemory # Create environment env = gym.make("CartPole-v1") # Create memory memory = RandomMemory(memory_size=1000, num_envs=1) # Initialize agent agent = PPO( observation_space=env.observation_space, action_space=env.action_space, memory=memory, device="cpu", config={ "rollouts": 200, "learning_epochs": 10, "mini_batches": 4, "discount_factor": 0.99, "learning_rate": 3e-4, } ) # Trainer trainer = SequentialTrainer(agent=agent, environment=env) # Train trainer.train()
Debug
Known issues
breakingIn skrl 2.0+, the API changed significantly. Old skrl 1.x code (e.g., `from skrl import PPO`) no longer works. Migrate to new submodule structure.
fix
Use `from skrl.agents import PPO` and check updated docs.
affects: >=2.0.0
gotchaskrl requires Gymnasium (not Gym) for environment interfaces. Using old Gym will cause compatibility issues.
fix
Install `gymnasium` and use its environments. If you must use Gym, wrap it with Gymnasium compatibility wrappers.
affects: >=2.0.0
gotchaThe `device` argument must match the backend (e.g., 'cuda:0' for PyTorch GPU). skrl does not auto-detect device; setting wrong device leads to silent errors.
fix
Explicitly set `device='cuda:0'` or `'cpu'` based on available hardware.
affects: all
Upgrade
Version history
2.1.0latest on PyPI · released May 10, 2026
Audit
Dependencies
torchoptionalRequired for PyTorch backend
jaxoptionalRequired for JAX backend
gymnasiumrequiredExpected by most environments; skrl uses Gymnasium API
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
skrl — pip install skrl · libregistry