Agent Lightning is a compact framework for training AI agents with real harnesses unchanged. It combines a trainer, API gateway, and rollout controller for rollout-driven RL.
Overview
Agent Lightning is a lightweight agentic reinforcement-learning framework for training agents against real benchmarks and harnesses. The v1.0 redesign keeps the core to roughly three thousand five hundred lines of Python and treats simplicity as a design goal.
Training keeps agents on their existing tools, context, control flow, and environments by routing model calls through an Agent Lightning proxy without code changes. The architecture has three parts: a Trainer that runs verl and vLLM, builds training samples, and updates policy; an API Gateway that proxies model requests and captures training data; and a Rollout Controller that runs agents locally or as Kubernetes Jobs.
Native Kubernetes support lets rollouts run as Jobs without external sandbox services. Documentation covers installation with a verl GPU stack, quick local runs, trainer and gateway configuration, controller settings for local and Kubernetes runners, and asynchronous training with pause and drain behavior.
Published examples include math reasoning with AutoGen and MCP tools, grade-school math, ScienceWorld tasks, Search-R1 retrieval agents, sandbox agents with computer and code tools, and coding-agent pipelines with repository tests. Reported results cover improvements on Search R1, LLM-in-Sandbox, and coding-agent benchmarks using pure RL.
Key features
- Compact core Python codebase
- Train through proxy without harness changes
- Trainer with verl and vLLM
- API Gateway for model proxy and traces
- Local and Kubernetes rollout controller
- Asynchronous rollout collection
- End-to-end coding-agent training pipeline
- GRPO and score-centering presets
Use cases
- Coding agents tuned on SWE-bench-style tasks
- Multi-turn search and retrieval agents
- Math reasoning with tool-using agents
- Sandbox agents with code execution tools
- Kubernetes-scale agent rollouts