Skip to main content

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

  • 🪶 ~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.

⚡ 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:

  • 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.

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 opencode@microsoft.com 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentlightning-1.0.1.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentlightning-1.0.1-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

Details for the file agentlightning-1.0.1.tar.gz.

File metadata

  • Download URL: agentlightning-1.0.1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentlightning-1.0.1.tar.gz
Algorithm Hash digest
SHA256 dfbb003815c567ca15ee21d697e45688516253c77bc578e70a68a25a5070a466
MD5 180046be94377a6e0e3b1dff7c7e7b66
BLAKE2b-256 a85a99f4f1e6b37d7a93115a7d44ff2350ef311ba5c8109851f19db0290cccfa

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentlightning-1.0.1.tar.gz:

Publisher: pypi-release.yml on microsoft/agent-lightning

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentlightning-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: agentlightning-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 59.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for agentlightning-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66f64dcdce48e65d1455a8404880b25db92a7f8a66867e71972facdb6adfe2ef
MD5 c57dc463307fdba770e8318b8ba62df3
BLAKE2b-256 53ae71d9acb08bf6328e047d4980a69956fb49e08630fe4d4ece226461600706

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentlightning-1.0.1-py3-none-any.whl:

Publisher: pypi-release.yml on microsoft/agent-lightning

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

1 file

0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page