agent-lightning README

The project's README from github.com/microsoft/agent-lightning. As one markdown file: README.md.

Agent Lightning v1.0

3,500-Line Lightweight Agentic RL Framework for Training Agents with Real Harnesses!

Documentation  ·  Technical Report  ·  MIT License

Agent Lightning was completely refactored in v1.0. For legacy releases earlier than v1.0, see this branch.

⚡ Key Features

⚡ Installation

The following is an example installation on a CUDA 13.0 machine:

cd <this-repo>
uv sync
bash scripts/setup_verl.sh 0.8.0 cu130

See the Installation Guide for details.

⚡ Architecture

Agent Lightning v1.0 architecture

Agent Lightning v1.0 keeps the training architecture simple with three lightweight components:

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.

Agent Lightning v1.0 benchmark comparison

⚡ Documentation

Section Content
Installation Base environment and verl GPU stack
Quick Start Local first run and end-to-end flow
Basics Components, rollouts, events, and trajectories
Trainer Configuration verl integration and trace aggregation
API Gateway Configuration Gateway and model proxy settings
Controller Configuration Local and Kubernetes runners
Asynchronous Training Collocated async collection and pause/drain

⚡ Examples

Example Description
Calc-X POC math reasoning example with AutoGen and MCP calculator tools, requiring only one GPU.
GSM8K POC grade-school math reasoning example.
ScienceWorld Interactive science tasks in a text-based environment.
Search-R1 Multi-turn retrieval and reasoning agent.
LLM-in-Sandbox General agent with computer and code execution tools.
Coding Agent Coding agent trained with repository tests.

⚡ Articles

⚡ Community Projects

⚡ Citation

If you use Agent Lightning v1.0 in your research or projects, please cite the technical report:

@misc{he2026agentlightningv10harnessed,
  title={Agent Lightning v1.0: Towards Harnessed Agentic RL},
  author={Zhiyuan He and Siwei Zhang and Zhiwen Zhou and Yuqing Yang and Yu Kang and Yuge Zhang and Luna K. Qiu and Tin Yan Tsui and Jiahang Xu and Chong Luo},
  year={2026},
  eprint={2608.17528},
  archivePrefix={arXiv},
  primaryClass={cs.AI},
  url={https://arxiv.org/abs/2608.17528},
}

For the original Agent Lightning paper, please use:

@misc{luo2025agentlightningtrainai,
      title={Agent Lightning: Train ANY AI Agents with Reinforcement Learning},
      author={Xufang Luo and Yuge Zhang and Zhiyuan He and Zilong Wang and Siyun Zhao and Dongsheng Li and Luna K. Qiu and Yuqing Yang},
      year={2025},
      eprint={2508.03680},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2508.03680},
}

⚡ Contributing

This project welcomes contributions and suggestions. Start by reading the Contributing Guide for recommended contribution points, environment setup, branching conventions, and pull request expectations. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

⚡ Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

⚡ Responsible AI

This project has been evaluated and certified to comply with the Microsoft Responsible AI Standard. The team will continue to monitor and maintain the repository, addressing any severe issues, including potential harms, if they arise.

⚡ License

Agent Lightning v1.0 is released under the MIT License.

agent-lightning (microsoft/agent-lightning)

Searching Database…

这是什么?Agent Lightning 是微软开发的开源强化学习训练框架,几乎不需要改动智能体自身的代码,就能用强化学习训练你现有的任何 AI 智能体。
这是智能体本身,还是用来训练智能体的框架?它是训练框架,不是智能体。它通过一个代理位于你现有的智能体和大语言模型之间,把智能体的模型调用转换为强化学习训练数据,而智能体自身的工具和控制流程保持不变。
我要怎么把它跑起来?准备一台支持 CUDA 的 GPU 机器,然后按照安装指南操作。Trainer 运行 verl 和 vLLM,API Gateway 代理智能体的模型请求,Rollout Controller 则在本地或以 Kubernetes Jobs 的形式启动你的智能体。
用它训练智能体,我需要重写智能体吗?不需要,这正是它的核心设计目标。你的智能体保留原有的 harness(运行框架)、工具和控制流程,只是把模型调用改为经过 Agent Lightning 代理,而不是直接调用模型。
它在编程智能体上取得了什么效果?只用 6K 条训练样本,使用 Agent Lightning 训练的 Qwen3.5-9B 编程智能体端到端工作流,将 SWE-bench Verified 的成绩从 41.8% 提升到 56.4%,提高了 14.6 个百分点。
框架自带哪些示例任务?框架附带了多个 POC 示例,涵盖 Calc-X 数学推理、GSM8K、ScienceWorld 科学任务、Search-R1 多轮检索、LLM-in-Sandbox 工具使用,以及一个基于代码仓库测试训练的完整编程智能体。
为什么代码库保持得这么精简?项目把简洁作为首要原则,整个框架只有约 3500 行代码,让训练架构易于理解和扩展。
三个核心组件分别是什么?Trainer 运行 verl 和 vLLM 来构建训练样本并更新策略,API Gateway 代理模型请求并捕获训练数据,Rollout Controller 则在本地或以 Kubernetes Jobs 的形式运行智能体。
What are similar projects?OpenClaw-RL, DeepAnalyze, reef, ART, minimind, halo, verl, open-r1
Creator
microsoft
Size
48.9 MB
Stars
18.7K
Age
1y
Commits · 90 Days