Agent Lightning
December 17, 2025 ยท View on GitHub
Agent Lightning is the absolute trainer to light up AI agents.
Join our Discord community to connect with other users and contributors.
Features
- Turn your agent into an optimizable beast with ZERO CODE CHANGE (almost)! ๐ค
- Build with ANY agent framework (LangChain, OpenAI Agent SDK, AutoGen, CrewAI, Microsoft Agent Framework...); or even WITHOUT agent framework (Python OpenAI). You name it! ๐ค
- Selectively optimize one or more agents in a multi-agent system. ๐ฏ
- Embraces Algorithms like Reinforcement Learning, Automatic Prompt Optimization, Supervised Fine-tuning and more. ๐ค
How to Read this Documentation
This documentation is organized into the following parts:
- Installation - Get started with Agent Lightning
- How-to Recipes (e.g., Train SQL Agent with RL) - Practical examples of training agents and customizing algorithms.
- Learning More (e.g., Debugging) - Guides on specific topics like debugging or parallelization.
- Algorithm Zoo (e.g., APO) - References for built-in algorithms.
- Deep Dive (e.g., Bird's Eye View) - For a deeper understanding of what Agent-lightning is doing under the hood.
- API References (e.g., Agent) - References for the Agent-lightning Python API.
Resources
- 11/4/2025 Tuning ANY AI agent with Tinker โ Agent-lightning Medium. See also Part 2.
- 10/22/2025 No More Retokenization Drift: Returning Token IDs via the OpenAI Compatible API Matters in Agent RL vLLM blog. See also Zhihu writeup.
- 8/11/2025 Training AI Agents to Write and Self-correct SQL with Reinforcement Learning Medium.
- 8/5/2025 Agent Lightning: Train ANY AI Agents with Reinforcement Learning arXiv paper.
- 7/26/2025 We discovered an approach to train any AI agent with RL, with (almost) zero code changes. Reddit.
- 6/6/2025 Agent Lightning - Microsoft Research Project page.
Community Projects
- DeepWerewolf โ A case study of agent RL training for the Chinese Werewolf game built with AgentScope and Agent Lightning.
- AgentFlow โ A modular multi-agent framework that combines planner, executor, verifier, and generator agents with the Flow-GRPO algorithm to tackle long-horizon, sparse-reward tasks.
- Youtu-Agent โ Youtu-Agent lets you build and train your agent with ease. Built with a modified branch of Agent Lightning, Youtu-Agent has verified up to 128 GPUs RL training on maths/code and search capabilities with steady convergence. Also check the recipe and their blog Stop Wrestling with Your Agent RL: How Youtu-Agent Achieved Stable, 128-GPU Scaling Without Breaking a Sweat.
Citation
If you find Agent Lightning useful in your research or projects, please cite our paper:
@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},
}
License
See the LICENSE file for details.