RL Lab

RL Lab — engineering deep-dive

A full-stack reinforcement-learning workbench: a Python/FastAPI training backend and a React 19 front-end wired together over WebSocket, putting 109 environments and 9 algorithms behind one live dashboard. Built solo in ~4 weeks, AI-assisted with Claude Code.

Python · FastAPI · PyTorch React 19 · TypeScript · Vite WebSocket live streaming AGPL-3.0

Every agent here, trained in the tool.

Nine algorithms across 100+ environments — a sample of what comes out the other end.

BreakoutBreakout · DQN
Lunar LanderLunar Lander · Neuroevolution
Car RacingCar Racing · PPO
CheckersCheckers · AlphaZero
Bipedal WalkerBipedal Walker · PPO
DoomDoom: Defend the Center · PPO
HumanoidHumanoid · SAC
PursuitPursuit · multi-agent PPO
PongPong · PPO

By the numbers

109environments, 9 families — classic control, Atari, MuJoCo, MiniGrid, Box2D, OpenSpiel, PettingZoo, ViZDoom
9algorithms — PPO, SAC, TD3, DQN, QR-DQN, A2C, tabular Q, a from-scratch neuroevolution, an in-repo AlphaZero
~45.6klines of code · 115 commits · ~480 tests
99architecture decision records — the integration seams, documented

Atari is optional by design. The Atari backend (ale-py) is GPL-licensed and bundles copyrighted ROMs, so it is deliberately not a hard dependency — it's an opt-in install (pip install ale-py), keeping the core AGPL-clean and free of third-party ROMs. Bring your own and the 64 Atari environments light up; skip it and ~45 run out of the box.

Architecture

Local-first and single-user: the whole thing runs on your own machine, so training uses your own compute. The training loop and the visual preview are decoupled — the network never blocks learning, and the UI stays live at 60 fps while a model trains.

Backend · Python

FastAPI — REST + WebSocket PyTorch — training loop Gymnasium env adapters (×9 families) decoupled preview rollout Data Lab — rliable-style stats
WebSocket
▶ reward curve
▶ frames
▶ telemetry
◀ your inputs

Frontend · TypeScript

React 19 + Vite live dashboard & charts agent preview canvas play-vs-agent controls Data Lab comparison views
Live training — reward curve climbing, Q-table filling in real time

What was interesting to build

01Decoupled live streaming

A separate preview rollout streams frames + metrics over WebSocket while the training loop runs full-speed — the reward curve and the agent you're watching never stall each other.

02Play against your own agent

A human joins the loop over WebSocket and is graded on a per-environment, calibrated scale (Child → Superhuman) across 100+ games, with named leaderboards.

03Pedagogy in the data model

Every hyperparameter carries a per-environment recommended value and a bilingual (EN/CZ) explanation, surfaced exactly where you tune it — teaching baked into the schema, not bolted on.

Half the product — the Data Lab

RL Lab trains the agents. The Data Lab tells you, honestly, which run actually won — a research-grade statistics workbench built into the same browser. Not a chart dump: the real method reviewers expect, one click from a publication-ready export.

Data Lab — live head-to-head statistical comparison of two algorithms

Above: a head-to-head of PPO vs Neuroevolution on CartPole — learning curves overlay, repeated seeds collapse into mean ± CI bands, and the aggregate updates live as each run is added.

rliable aggregates

A faithful reimplementation of the rliable suite — IQM, mean, median and optimality-gap — the modern standard for reporting RL results without cherry-picking a lucky seed.

Honest uncertainty

Stratified-bootstrap confidence intervals, performance profiles and probability-of-improvement — you see whether one algorithm really beats another, or just got lucky.

Ranked, at a glance

Runs sort into a live ranked summary table as you add them — a clean verdict across seeds and environments.

Seven export formats

One click to publication-ready figures and tables — straight into a paper, report or slide deck.

Stack

PythonFastAPIPyTorch NumPyGymnasiumStable-Baselines3 WebSocketsReact 19TypeScript ViteOpenSpielPettingZoo MuJoCoViZDoom
Honest framing. The algorithms themselves are standard implementations — the moat here is integration, UX and pedagogy: making 109 environments × 9 algorithms × live visualisation × play × research statistics behave as one coherent tool a beginner can actually drive. That breadth-under-one-roof is the hard, and the interesting, part. Built solo, AI-assisted with Claude Code.