18,935
stars
+47+61+371
1,720
forks
–
watchers
–
prs
–
issues
–
releases
–
discussions
README
3,500-Line Lightweight Agentic RL Framework for Training Agents with Real Harnesses! Documentation · Technical Report · WeChat Group (微信群) · MIT License Agent Lightning was completely refactored in v1.0. For legacy releases earlier than v1.0, see this branch. ⚡ News - [2026/11] We release a Score Centering example for math reasoning, with GRPO and score centering presets, INT8 inference, and an INT4 Attention KV cache. - [2026/10] Read our AGL-SKILL: Coding Harnesses as Agentic Optimizers technical report on using coding harnesses to optimize other agents across five benchmarks. - [2026/09] We release a new coding agent example based on an MoE model. Pure RL improves Qwen3.5-35B-A3B on SWE-bench Verified from 47.8% to 61.6% after training it on only 1.8K training examples! - [2026/08] Agent Lightning Skill is released. It helps a coding agent improve another AI agent against a benchmark. - [2026/08] Agent Lightning v1.0 technical report is released! - [2026/08] We open source Agent Lightning v1.0! ⚡ Key Features - 🪶 ~3,500 lines of code: We treat simplicity as the first principle. - 🧩 Train with real agent harnesses: Agents interact with the model through the Agent Lightning v1.0 proxy with ZERO changes, while keeping tools, context, control flow, and environments in the loop. - ☸️ Native Kubernetes support: Run agents directly as Kubernetes Jobs without relying on external sandbox services. - 💻 Full coding agent training example: Using only 6K training samples, an end-to-end Qwen3.5-9B workflow improves SWE-bench Verified from 41.8% to 56.4%, a gain of 14.6 percentage points. We release the full pipeline, including data cleaning, reward-hacking prevention, and training scripts. Update: We release a new coding agent training example based on Qwen3.5-35B-A3B. Pure RL improves Qwen3.5-35B-A3B on SWE-bench Verified from 47.8% to 61.6% after only 1.8K training examples, a gain of 13.8 percentage points. ⚡ Installation The following is an example installation on a CUDA 13.0 machine: bash cd uv sync bash scripts/setup_verl.sh 0.8.0 cu130 See the Installation Guide for details. ⚡ Architecture Agent Lightning v1.0 keeps the training architecture simple with three lightweight components: - Trainer: Runs verl and vLLM, builds training samples, and updates the policy. - API Gateway: Proxies model requests and captures training data. - Rollout Controller: Runs agents locally or as Kubernetes Jobs. The Trainer creates rollouts, the Controller launches agents, and the Gateway turns interactions into training data, while agents continue to run with their real harnesses. ⚡ Results We evaluate Agent Lightning v1.0 across several practical training domains, including Search R1, LLM-in-Sandbox, and Coding Agent. Pure RL delivers substantial improvements across all three domains, as shown below. ⚡ Documentation | Section | Content | |---------|---------| | Installation | Base environment