# Agent Lightning

A lightweight reinforcement learning framework for training AI agents using their existing, unmodified harnesses, by proxying model calls and turning the resulting interactions into training data.

Agent Lightning is a lightweight, roughly 3,500-line framework for training AI agents with reinforcement learning while keeping their real harnesses, tools, context and control flow unchanged. Agents interact with the model through an Agent Lightning proxy rather than through code modifications.

Its architecture has three components: a trainer that runs the verl and vLLM libraries, builds training samples and updates the policy; an API gateway that proxies model requests and captures training data; and a rollout controller that runs agents locally or natively as Kubernetes jobs, without an external sandbox service. In one example, training a coding agent on 6,000 samples raised its SWE-bench Verified score from 41.8% to 56.4%.

It is written in Python and released under the MIT license.

Website: https://microsoft.github.io/agent-lightning/
