Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

SLM-Lab

> 编程语言
Open source

Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".

1.4K stars0 likes1 views
WebsiteGitHub

About

Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".

SLM Lab

Modular Deep Reinforcement Learning framework in PyTorch.
Companion library of the book Foundations of Deep Reinforcement Learning.
Documentation · Benchmark Results

NOTE: v5.0 updates to Gymnasium, uv tooling, and modern dependencies with ARM support - see CHANGELOG.md.

Book readers: git checkout v4.1.1 for Foundations of Deep Reinforcement Learning code.

BeamRider Breakout KungFuMaster MsPacman
Pong Qbert Seaquest Sp.Invaders
Ant HalfCheetah Hopper Humanoid
Inv.DoublePendulum InvertedPendulum Reacher Walker

SLM Lab is a software framework for reinforcement learning (RL) research and application in PyTorch. RL trains agents to make decisions by learning from trial and error—like teaching a robot to walk or an AI to play games.

What SLM Lab Offers

Feature Description
Ready-to-use algorithms PPO, SAC, CrossQ, DQN, A2C, REINFORCE—validated on 70+ environments
Easy configuration JSON spec files fully define experiments—no code changes needed
Reproducibility Every run saves its spec + git SHA for exact reproduction
Automatic analysis Training curves, metrics, and TensorBoard logging out of the box
Cloud integration dstack for GPU training, HuggingFace for sharing results

Algorithms

Algorithm Type Best For Validated Environments
REINFORCE On-policy Learning/teaching Classic
SARSA On-policy Tabular-like Classic
DQN/DDQN+PER Off-policy Discrete actions Classic, Box2D, Atari
A2C On-policy Fast iteration Classic, Box2D, Atari
PPO On-policy General purpose Classic, Box2D, MuJoCo (11), Atari (54)
SAC Off-policy Continuous control Classic, Box2D, MuJoCo
CrossQ Off-policy Sample-efficient control Classic, Box2D, MuJoCo

See Benchmark Results for detailed performance data.

Environments

SLM Lab uses Gymnasium (the maintained fork of OpenAI Gym):

Category Examples Difficulty Docs
Classic Control CartPole, Pendulum, Acrobot Easy Gymnasium Classic
Box2D LunarLander, BipedalWalker Medium Gymnasium Box2D
MuJoCo Hopper, HalfCheetah, Humanoid Hard Gymnasium MuJoCo
Atari Breakout, MsPacman, and 54 more Varied ALE

Any gymnasium-compatible environment works—just specify its name in the spec.

Quick Start

…

Cloud Training (dstack)

Run experiments on cloud GPUs with automatic result sync to HuggingFace.

bash
# Setup
cp .env.example .env  # Add HF_TOKEN
uv tool install dstack  # Install dstack CLI
# Configure dstack server - see https://dstack.ai/docs/quickstart

# Run on cloud
slm-lab run-remote spec.json spec_name train           # CPU training (default)
slm-lab run-remote spec.json spec_name search          # CPU ASHA search (default)
slm-lab run-remote --gpu spec.json spec_name train     # GPU training (for image envs)

# Sync results
slm-lab pull spec_name    # Download from HuggingFace
slm-lab list              # List available experiments

Config options in .dstack/: run-gpu-train.yml, run-gpu-search.yml, run-cpu-train.yml, run-cpu-search.yml

Minimal Install (Orchestration Only)

For a lightweight box that only dispatches dstack runs, syncs results, and generates plots (no local ML training):

bash
uv sync --no-default-groups  # skip ML deps (torch, gymnasium, etc.)
uv tool install dstack
uv run --no-default-groups slm-lab run-remote spec.json spec_name train
uv run --no-default-groups slm-lab pull spec_name
uv run --no-default-groups slm-lab plot -f folder1,folder2

Citation

If you use SLM Lab in your research, please cite:

bibtex
@misc{kenggraesser2017slmlab,
    author = {Keng, Wah Loon and Graesser, Laura},
    title = {SLM Lab},
    year = {2017},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\\url{https://github.com/kengz/SLM-Lab}},
}

License

MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythona2ca3cbenchmarkdeep-reinforcement-learning

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言