← all repositories
kengz/SLM-Lab

A PyTorch RL framework that still ships with its own textbook

SLM Lab bundles seven validated algorithms and a cloud-training CLI into a JSON-configured research box built to accompany a deep RL book.

1.4k stars Python ML FrameworksAgents
SLM-Lab
Velocity · 7d
+0.4
★ / day
Trend
steady
star history

What it does SLM Lab is a PyTorch reinforcement-learning framework that lets you train agents via JSON spec files—no code edits required. It wraps seven algorithms (PPO, SAC, CrossQ, DQN variants, A2C, REINFORCE, SARSA) validated across 70+ Gymnasium environments, from CartPole to Atari to MuJoCo humanoids. A Typer-based CLI handles local runs, cloud dispatch via dstack, and HuggingFace result syncing.

The interesting bit The project is explicitly the companion code for the Pearson book Foundations of Deep Reinforcement Learning—a rarity in an ecosystem where most frameworks are either abandoned course repos or hyperscaler black boxes. Version 5.0 modernized the stack (Gymnasium, uv, ARM support) while keeping a v4.1.1 branch frozen for book readers chasing printed page numbers.

Key highlights

  • JSON specs fully define experiments; the CLI consumes them directly
  • Every run saves its spec plus git SHA for reproduction
  • TensorBoard logging and automatic training-curve analysis included
  • Optional minimal install skips torch/gymnasium for pure cloud orchestration
  • Cloud configs for CPU/GPU training and ASHA hyperparameter search ship in .dstack/

Caveats

  • Book readers must remember to git checkout v4.1.1; the default branch is ahead of the text
  • Cloud training requires dstack server setup and a HuggingFace token—no managed endpoint is provided

Verdict Graduate students and RL practitioners who want readable, book-aligned reference implementations with modern packaging. Skip it if you need distributed multi-node training or JAX-level speed.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.