agent-lightning
The absolute trainer to light up AI agents.
Agent Lightning trains AI agents with their real toolchains instead of sandboxed stand-ins
Microsoft's roughly 3,500 line framework feeds reinforcement learning straight into live agent harnesses through a proxy, so tools, context and control flow stay in the loop with almost no code changes.
What the framework is built to do
Agent Lightning is a lightweight reinforcement learning framework for AI agents, and the team behind it treats simplicity as the first principle, keeping the whole project to around 3,500 lines of code. The core idea is that agents should be trained against the harnesses they actually run in, not against stripped down replicas. A proxy sits between the agent and the model, capturing every interaction as training data while the agent continues to use its real tools, its real context, its real control flow and its real environments. The README states plainly that this works with zero changes to the agent code itself. That matters because most agent training setups force you to rewrite the agent to fit a research environment, which quietly discards the messy details that make agents useful in production. By leaving the harness untouched, the framework keeps the gap between training and deployment small. The project was fully refactored for version 1.0, and older releases before that version live on a separate branch. The license is MIT, which lets anyone build on the code commercially or privately.
How the three components fit together
The training architecture stays small on purpose and splits into three lightweight pieces. The Trainer runs verl and vLLM, builds the training samples from captured interactions and updates the policy. The API Gateway proxies model requests and records the data that the rollouts generate. The Rollout Controller launches agents either on the local machine or as Kubernetes Jobs. Microsoft points out that native Kubernetes support means agents run directly as Jobs without relying on an external sandbox service, which removes a whole class of infrastructure dependencies. In practice the Trainer creates the rollouts, the Controller starts the agents, and the Gateway turns the agent model interactions into training records, while the agents keep running on their genuine harnesses. The documentation covers each piece in its own section, from a first installation that sets up the verl GPU stack to asynchronous training where collection and updates are collocated with a pause and drain mechanism. The published examples include Calc-X, a math reasoning proof of concept that needs only one GPU, plus GSM8K, ScienceWorld, Search-R1, LLM-in-Sandbox and a coding agent trained with repository tests.
What the reported numbers show
The project reports results across several practical training domains, including Search R1, LLM-in-Sandbox and a coding agent, and states that pure reinforcement learning delivers gains in all three. The most concrete result is the full coding agent example: using only 6,000 training samples, an end to end Qwen3.5-9B workflow raised SWE-bench Verified from 41.8 percent to 56.4 percent, a gain of 14.6 percentage points. The team releases the complete pipeline for that result, including the data cleaning steps, reward hacking prevention and the training scripts, so the claim can be reproduced rather than taken on trust. The documentation sits at microsoft.github.io/agent-lightning and a technical report is posted to arXiv under the identifier 2608.17528. A long list of community articles and blog posts, from vLLM to Medium writeups, tracks how the approach evolved through 2025 and into 2026. The repository is maintained by Microsoft and carries the stable 1.0 line as the current recommended starting point for new work.
Editorial conclusion
Agent Lightning ships under the MIT license and the current recommended entry point is the 1.0 line, with full documentation at microsoft.github.io/agent-lightning and a technical report archived at arXiv 2608.17528.
Community notes