Compare learned and classical controllers under the same conditions.
ControlBench is a local experiment tracker and benchmarking dashboard for reinforcement learning and classical control. Training and control scripts send their results to a small REST API; the dashboard groups runs into configurations and compares them over multiple seeds, with averaged learning curves over environment steps or wall-clock time. Everything runs on your machine, backed by a single SQLite file. No account and no cloud needed.
Status: early development / public preview (v0.1.0). The API may still change.
Demo data generated by docs/demo/generate_demo_data.py: six invented experiments in two categories (stabilization, positioning). These are not real training results. Classical controllers (LQR, PID, IK+PD) do not train, so they appear as reference lines without a learning curve.
When you solve a control problem, such as swinging up and balancing a pendulum, once with an RL agent (SAC, PPO, TQC, …) and once with a classical controller (PID, LQR, MPC, …), you want to answer questions like:
- Does the controller work at all, i.e. what is its success rate, and how much do results vary across seeds?
- After how many training steps, and after how much compute, does the RL agent become reliably stable?
- How quickly does the system stabilize, how much control effort does it need, and how robust is it to changed conditions?
- Which kind of controller works best for which kind of task?
RL results usually end up scattered across CSV files, TensorBoard runs, notebooks and log folders, and classical control results somewhere else. ControlBench puts both into the same structure: experiment → configuration → seeds → metrics. It compares configurations, not single runs, because one lucky seed says little about an algorithm.
- RL and classical controllers side by side: any controller name, learned or hand-designed, in one experiment. Controllers without training (LQR, PID, MPC, ...) appear as dashed reference lines across the learning curves
- Seed-aware comparison: runs with the same controller and name form a configuration; per configuration you get the success rate, when it first reached 90 % (steps and wall-clock time), the control effort (∫‖u‖² dt), the reward and the wall-clock time, each as mean ± standard deviation. The best configuration is the one that works most reliably, not the one with the highest reward
- Learning curves averaged over seeds with a min–max or 95 % confidence band, switchable between environment steps and wall-clock time, optionally cut to an equal budget; single final values are drawn as markers with error bars
- Robustness: key figures per scenario (heavier mass, sensor noise, pushes, other terrain); the dashboard shows the worst scenario and the drop vs. nominal
- Episode traces: states and actuator commands of a test episode over simulated time, to see how calmly or nervously a controller acts
- Categories: classify experiments by task type (stabilization, swing-up, positioning, tracking, locomotion, ...) and see which controller wins per category, using ranks instead of rewards that are not comparable between environments
- Hyperparameters stored per configuration and shown in the dashboard
- Free-form metrics: any metric name without schema changes; the standard metrics are one click away, all others behind a search field
- Built for long trainings: batched uploads and server-side downsampling (
max_points), tested with 4.6 M metric points - Generic REST API (FastAPI) with interactive OpenAPI docs at
/docs - Framework-agnostic ingestion: anything that can send JSON over HTTP works; a Python upload template with building blocks for success rate and control effort is included
- Local-first: SQLite storage with Alembic migrations, React + TypeScript dashboard in English and German
| Overview | Experiment detail |
|---|---|
![]() |
![]() |
| Episode trace and robustness | Categories |
![]() |
![]() |
flowchart LR
S["Training / control script<br/>(Python, curl, any HTTP client)"] -- "HTTP + JSON" --> API["FastAPI backend<br/>:8000"]
UI["React dashboard<br/>:5173"] -- "HTTP + JSON" --> API
API -- SQLAlchemy --> DB[("SQLite<br/>backend/controlbench.db")]
Everything goes through the REST API: the backend doesn't distinguish between a training script, the browser or curl. More details: docs/architecture.md.
Requirements: Python 3.10+, Node.js 22.22+, Git.
git clone https://github.com/maximilian467/ControlBench.git
cd ControlBench1. Backend (terminal 1)
python3 -m venv .venv # Windows: python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
pip install -r backend/requirements.txt -r experiments/requirements.txt
cd backend
alembic upgrade head # creates backend/controlbench.db
uvicorn main:app --reload # API on http://127.0.0.1:8000, docs at /docs2. Frontend (terminal 2)
cd frontend
npm install
npm run dev # dashboard on http://localhost:51733. Demo data (terminal 3, from the repository root, with the virtual environment active)
python experiments/example_upload.pyThis uploads a demo experiment (SAC and PPO with 5 seeds each, LQR with one seed) with generated learning curves. Open http://localhost:5173 and click the experiment.
Something not working? See docs/troubleshooting.md.
The quickest path is to copy experiments/example_upload.py and replace its fake_run() with your real training or controller rollout. The template creates the experiment, keeps a local JSON backup of each run and uploads metrics in batches.
Without the template, three requests are enough:
import requests
API = "http://127.0.0.1:8000"
exp = requests.post(f"{API}/experiments", json={
"name": "Pendulum swing-up", "environment": "Pendulum-v1",
}).json()
run = requests.post(f"{API}/runs", json={
"experiment_id": exp["id"], "controller": "LQR", "name": "LQR Q=diag(10,1)",
"seed": 0, "reward": -120.4, "stability_time": 0.8, "num_steps": 200, "duration": 0.4,
}).json()
requests.post(f"{API}/runs/{run['id']}/metrics", json=[
{"name": "angle", "step": 0, "value": 3.14, "time": 0.0},
{"name": "angle", "step": 1, "value": 3.02, "time": 0.001},
])All seeds of one configuration use the same controller and name; that is how ControlBench groups and averages them.
- Uploading results: the template step by step, a Stable-Baselines3 callback sketch, large trainings, live uploads, conventions
- API reference: all endpoints and fields
ControlBench/
├── backend/ FastAPI app: routes/, models/ (Pydantic), database/ (SQLAlchemy), migrations/ (Alembic), tests/
├── frontend/ React + TypeScript dashboard (Vite, Tailwind CSS, visx charts)
├── experiments/ upload template that also generates the demo data
└── docs/ documentation, screenshots, demo GIF
| Architecture | concepts, components, tech stack, data model |
| Uploading results | connecting a training, large runs, live upload, conventions |
| API reference | endpoints, fields, error codes |
| Development | setup, tests, lint, build, CI, database migrations |
| Troubleshooting | common problems and fixes |
pip install -r backend/requirements-dev.txt
cd backend
pytest # backend tests, each on its own temporary database
cd ../frontend
npm run lint # oxlint
npm run build # type check + production buildCI runs the same checks on pushes to main and on pull requests. Schema changes go through Alembic migrations; see docs/development.md.
- Real controller examples (e.g. SAC and LQR) for the pendulum and the double pendulum
- Live upload in the template (the API already supports it via
PATCH /runs/{id}) - Comparison across experiments
- Editing experiments
- Show
recovery_timein the dashboard (it is already stored and returned by the API)
Out of scope for now, since ControlBench is a local tool: user accounts, authentication and hosted deployment.
Issues and pull requests are welcome, whether bug reports, ideas or experience from using ControlBench with your own controllers. See CONTRIBUTING.md.
MIT © 2026 Maximilian Köhlenbeck




