ART

OpenPipeApache-2.0活跃维护

用 GRPO 强化学习给多步 Agent 做在线训练,让 Qwen、Llama 等模型在真实任务里边干边学,提升实际表现。

Agent Reinforcement Trainer: train multi-step agents for real-world tasks using GRPO. Give your agents on-the-job training. Reinforcement learning for Qwen3.6, GPT-OSS, Llama, and more!

v0.5.24发布于 2026-11-04 22:54 UTC10,850star +2 / 7 天1,015fork同步于 2026-11-10 05:29 UTC

怎么上手

由 README 提炼,执行前请确认
pip install openpipe-art
硬件要求按 README 说明

服务端需运行在带 GPU 的机器上,客户端任意能跑 Python 的机器即可;README 未说明具体显存需求与 GPU 型号。

需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 GRPO 给多步 Agent 做在线强化学习训练的开源框架,让模型从任务经验中变可靠

用 GRPO 强化学习给多步 Agent 做在线训练,让 Qwen、Llama 等模型在真实任务里边干边学,提升实际表现。

核心能力

  • 用 GRPO 从轨迹奖励中训练多步 Agent
  • 客户端与服务端分离,客户端兼容 OpenAI 接口
  • 服务端用 vLLM 跑最新 LoRA 做推理
  • 按 Trajectory 收集消息并赋 reward 后分组训练
  • 训练完自动保存 LoRA 并热加载回 vLLM

容易踩的坑

训练服务端需单独部署在有 GPU 的机器上,客户端本身不训练;模型需为 vLLM/HuggingFace-transformers 或 Unsloth 兼容的因果语言模型,Gemma 3 暂不支持;训练期间推理会被阻塞。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.5.24
  1. v0.5.24最新正式版2026-11-04 · 2026-11-04 22:54 UTC

    Release Highlights

    • Weave 0.54.0 or later is now required. Weave 0.53.9 and earlier fail in weave.init() with AttributeError: 'OTLPSpanExporter' object has no attribute '_session' once opentelemetry-exporter-otlp-proto-http 1.45 is installed. Installing ART now upgrades an older Weave instead of keeping it.
    • KL reference adapters no longer leak into saved checkpoints. With a KL penalty, the Unsloth backend left the reference LoRA loaded, so later checkpoints saved in the same process, including other models' checkpoints, contained it. Saving and loading now drop unused adapters, and load_lora_adapter raises if the file is missing any LoRA weight.
    • Megatron trainer attention runs on SM120 (RTX PRO 6000 Blackwell) through a Triton fallback.
    • Native GDN context parallelism (CP>1) keeps rank transitions in FP32.

    What's Changed

    • fix(unsloth): keep KL reference adapters out of saved checkpoints (#1161)
    • fix(deps): require weave>=0.54.0 for OpenTelemetry 1.45 exporters (#1159), with the release smoke test updated in #1162
    • feat(megatron): support SM120 trainer attention fallback (#1156)
    • fix: preserve FP32 precision in native GDN context-parallel rank transitions (#1155)

    Full Changelog: https://github.com/OpenPipe/ART/compare/v0.5.23...v0.5.24

  2. v0.5.232026-10-26 · 2026-10-26 23:55 UTC
    查看更新说明

    Release Highlights

    • Model.delete_checkpoints works with polars 2.x. It averaged every history.jsonl column per step, and polars 2 raises on the string recorded_at column (InvalidOperationError: mean operation not supported for dtype str). It now averages only the checkpoint metric (#1150).

    What's Changed

    • fix: average only the metric in delete_checkpoints (#1150)

    Full Changelog: https://github.com/OpenPipe/ART/compare/v0.5.22...v0.5.23

  3. v0.5.222026-10-26 · 2026-10-26 21:37 UTC
    查看更新说明

    Release Highlights

    • Model metrics now log to the model's W&B entity. In 0.5.21, a model created with an explicit entity that differed from the API key's default entity logged model.log() metrics to a run under the default entity instead (#1134).

    What's Changed

    • feat: support opt-in multi-adapter MoE LoRA waves (#1139)
    • fix: bound context-parallel admission and memory accounting (#1138)
    • fix: support vLLM 0.31 inference history hooks (#1136)
    • feat: support dense canonical multi-adapter LoRA (#1135)
    • fix: open W&B runs under the model's entity (#1134)
    • feat: add art.megatron support for Stark's Tinker-compatible trainer (#1133)

    Full Changelog: https://github.com/OpenPipe/ART/compare/v0.5.21...v0.5.22

  4. v0.5.212026-10-20 · 2026-10-20 06:22 UTC
    查看更新说明

    Release Highlights

    • Dynamo rollout token metadata. ART now reads Dynamo's nvext.engine_data alongside vLLM's token metadata, and trainable models' openai_client() requests it automatically. ServerlessBackend users whose rollouts are served by W&B Inference no longer hit Trainable Choice is missing vLLM prompt_token_ids/token_ids (#934).
    • RL training stability. Zero-variance GRPO updates are skipped (#1118), policy importance ratios are bounded before exponentiation (#1113), TIS is skipped when original logprobs are unavailable (#1116), and several logprob and gradient paths now use FP32 (#1105, #1112, #1117).
    • Trainer. Versioned trainer graphs and logical-rank APIs (#925), with the pre-#925 trainer execution restored behind API-name aliases (#1107); many trainer-rank memory planning fixes; Megatron SFT packing with shared prefix trees (#905); compact logprobs and token-aligned expert routing (#1050).
    • Models. Qwen 3.5 9B Megatron support (#896) and Qwen3.5 adapter loading fixes (#959).
    • Docs moved to Astro (#1129).

    What's Changed

    • fix: drain full trajectory batches after completion bursts (#1124)
    • Migrate docs to Astro and deploy main to CoreWeave (#1129)
    • fix: preserve FP32 target gradients in Megatron TE cross entropy (#1117)
    • fix: use population std for native Tinker advantages (#1115)
    • fix: isolate legacy Tinker branch contexts (#1114)
    • fix: skip TIS when original logprobs are unavailable (#1116)
    • fix: bound policy importance ratios before exponentiation (#1113)
    • fix: stabilize Unsloth logprobs in fp32 (#1112)
    • fix: skip zero-variance GRPO updates (#1118)
    • fix(trainer-rank): keep head row normalization outside the statistics checkpoint (#1120)
    • revert: restore pre-#925 trainer execution with API-name aliases (#1107)
    • ci: pin uv to 0.12.24 so Prek reuses its prebuilt cache (#1119)
    • fix(trainer-rank): combine cross-entropy target and softmax gradients in FP32 (#1105)
    • fix: remove unused datrie from tinker dependencies (#1104)
    • fix(trainer-rank): honor oversized model output placement (#1099)
    • perf: avoid numeric type tuples in compact decoding (#1097)
    • perf: reuse alignment across chat history masks (#1098)
    • test: separate builder expiry from signal escalation (#1095)
    • fix: bound image builder lifetime and request resources (#1094)
    • fix(ci): verify prospective manual GPU validation reuse (#1093)
    • fix(trainer-rank): retain HybridEP planner replay dimensions ([#1088](ht
  5. v0.5.192026-08-14 · 2026-08-14 03:49 UTC
    查看更新说明

    Release Highlights

    What's Changed

    • Harden distributed checkpoint finalization (#793)
    • Harden checkpoint slot and collective isolation (#792)
    • Add topology-portable TrainerRank checkpoints (#790)
    • Revert topology-portable trainer checkpoints (#789)
    • Fix GPU prewarm on hypervisor nodes (#788)
    • Add compact and tensorized trajectory representations (#786)
    • Remove deprecated auto trajectory aliases (#785)
    • Add topology-portable trainer checkpoints (#784)
    • Add Llama 3 Megatron model support (#783)
    • Split divergent token histories by default (#782)
    • perf: Submit Tinker training requests in the same clock cycle (#781)
    • chore: Upgrade Tinker SDK to 0.23 (#780)
    • Simplify trajectory capture scopes (#779)
    • Refactor trainer rank package API (#777)
    • Fix ART runtime compatibility with vLLM 0.25 (#776)
    • Add protocol-native trajectory histories and tokenization (#773)
    • Expose assistant-turn selection for file SFT (#772)
    • Support final-assistant SFT on ServerlessBackend (#771)
    • fix: Parse Qwen3.5 tool calls with the model-native grammar (#770)
    • Add composable trajectory token flags (#768)
    • Stabilize pipeline RL throughput controls (#767)
    • Separate pipeline freshness from runtime tuning (#766)
    • Lazy-load exchange tokenization dependencies (#765)
    • Fix silent loss in legacy trajectory serialization (#764)
    • fix: complete TrainerRank model runtime integration (#763)
    • Preserve complete trajectories in Parquet (#762)
    • ci: select TrainerRank GPU validation by branch (#761)
    • ci: allow manual TrainerRank GPU validation (#760)
    • Optimize end-to-end Pipeline RL throughput (#758)
    • Upgrade ty to 0.0.59 (#757)
    • Add protocol-aware trajectory capture and tokenization (#756)
    • Support W&B 0.28 and vLLM 0.24 DSV4 LoRA (#754)
    • ci: add manual TrainerRank GPU validation (#748)
    • Publish TrainerRank checkpoint slots (#747)
    • test: run Megatron tree coverage in CI (#746)
    • Add DeepSeek V4 Flash support for ART Megatron (#745)
    • Add ART Megatron support for GPT OSS (#744)
    • Add final-assistant SFT mode (#743)
    • Fix Gemma4 MoE Triton flex stage config (#742)
    • feat: add TrainerRank API (#740)
    • feat: unify shared-prefix Megatron execution

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    PRs-Welcome PyPI version Train Agent

    Join Discord Documentation

    🚀 W&B Training: Serverless RL

    W&B Training (Serverless RL) is the first publicly available service for flexibly training models with reinforcement learning. It manages your training and inference infrastructure automatically, letting you focus on defining your data, environment and reward function—leading to faster feedback cycles, lower costs, and far less DevOps.

    ✨ Key Benefits:

    • 40% lower cost - Multiplexing on shared production-grade inference cluster
    • 28% faster training - Scale to 2000+ concurrent requests across many GPUs
    • Zero infra headaches - Fully managed infrastructure that stays healthy
    • Instant deployment - Every checkpoint instantly available via W&B Inference
    # Before: Hours of GPU setup and infra management
    # RuntimeError: CUDA error: out of memory 😢
    
    # After: Serverless RL with instant feedback
    from art.serverless.backend import ServerlessBackend
    
    model = art.TrainableModel(
      project="voice-agent",
      name="agent-001",
      run_name="agent-001",
      base_model="Qwen/Qwen3.6-27B"
    )
    
    backend = ServerlessBackend(
        api_key="your_wandb_api_key"
    )
    model.register(backend)
    # Edit and iterate in minutes, not hours!
    

    📖 Learn more about W&B Training →

    ART Overview

    ART is an open-source RL framework that improves agent reliability by allowing LLMs to learn from experience. ART provides an ergonomic harness for integrating GRPO into any python application. For a quick hands-on introduction, run one of the notebooks below. When you're ready to learn more, check out the docs.

    📒 Notebooks

    Agent TaskExample NotebookDescriptionComparative Performance
    ART•E [Serverless]🏋️ Train agentQwen 3.8 27B learns to search emails using RULER benchmarks
    2048 [Serverless]🏋️ Train agentQwen 3.8 27B learns to play 2048 benchmarks
    ART•E LangGraph🏋️ Train agentQwen 2.5 7B learns to search emails using LangGraph[Link coming soon]
    MCP•RL🏋️ Train agentQwen 2.5 3B masters the NWS MCP server[Link coming soon]
    Temporal Clue🏋️ Train agentQwen 2.5 7B learns to solve Temporal Clue[Link coming soon]
    Tic Tac Toe🏋️ Train agentQwen 2.5 3B learns to play Tic Tac Toe benchmarks
    Codenames🏋️ Train agentQwen 2.5 3B learns to play Codenames benchmarks
    AutoRL [RULER]🏋️ Train agentTrain Qwen 2.5 7B to master any task[Link coming soon]
    Distillation (SFT)🏋️ Train modelDistill text-to-SQL from Qwen 3 235B to Qwen 3.8 27B[Link coming soon]
    Summarizer (SFT + RL)🏋️ Train modelTrain a document summarizer with SFT warmup then RL[Link coming soon]
    SFT from a dataset🏋️ Train modelFine-tune Qwen 3.8 27B on text-to-SQL from a dataset[Link coming soon]

    Serverless notebooks use ART main (pinned to 88d3df2) and Qwen/Qwen3.8-27B. Benchmark charts show results from their original runs.

    📰 ART News

    Explore our latest research and updates on building SOTA agents.

    📖 See all blog posts →

    Why ART?

    • ART provides convenient wrappers for introducing RL training into existing applications. We abstract the training server into a modular service that your code doesn't need to interface with.
    • Train from anywhere. Run the ART client on your laptop and let the ART server kick off an ephemeral GPU-enabled environment, or run on a local GPU.
    • Integrations with hosted platforms like W&B, Langfuse, and OpenPipe provide flexible observability and simplify debugging.
    • ART is customizable with intelligent defaults. You can configure training parameters and inference engine configurations to meet specific needs, or take advantage of the defaults, which have been optimized for training efficiency and stability.

    Installation

    ART agents can be trained from any client machine that runs python. To add to an existing project, run this command:

    pip install openpipe-art
    

    🤖 ART•E Agent

    Curious about how to use ART for a real-world task? Check out the ART•E Agent blog post, where we detail how we trained Qwen 2.5 14B to beat o3 at email retrieval!

    🔁 Training Loop Overview

    ART's functionality is divided into a client and a server. The OpenAI-compatible client is responsible for interfacing between ART and your codebase. Using the client, you can pass messages and get completions from your LLM as it improves. The server runs independently on any machine with a GPU. It abstracts away the complexity of the inference and training portions of the RL loop while allowing for some custom configuration. An outline of the training loop is shown below:

    1. Inference

      1. Your code uses the ART client to perform an agentic workflow (usually executing several rollouts in parallel to gather data faster).
      2. Completion requests are routed to the ART server, which runs the model's latest LoRA in vLLM.
      3. As the agent executes, each system, user, and assistant message is stored in a Trajectory.
      4. When a rollout finishes, your code assigns a reward to its Trajectory, indicating the performance of the LLM.
    2. Training

      1. When each rollout has finished, Trajectories are grouped and sent to the server. Inference is blocked while training executes.
      2. The server trains your model using GRPO, initializing from the latest checkpoint (or an empty LoRA on the first iteration).
      3. The server saves the newly trained LoRA to a local directory and loads it into vLLM.
      4. Inference is unblocked and the loop resumes at step 1.

    This training loop runs until a specified number of inference and training iterations have completed.

    🧩 Supported Models

    ART should work with most vLLM/HuggingFace-transformers compatible causal language models, or at least the ones supported by Unsloth. Gemma 3 does not appear to be supported for the time being. If any other model isn't working for you, please let us know on Discord or open an issue on GitHub!

    🤝 Contributing

    ART is in active development, and contributions are most welcome! Please see the CONTRIBUTING.md file for more information.

    📖 Citation

    @misc{hilton2025art,
      author = {Brad Hilton and Kyle Corbitt and David Corbitt and Saumya Gandhi and Angky William and Bohdan Kovalevskyi and Andie Jones},
      title = {ART: Agent Reinforcement Trainer},
      year = {2025},
      publisher = {GitHub},
      journal = {GitHub repository},
      howpublished = {\url{https://github.com/openpipe/art}}
    }
    

    ⚖️ License

    This repository's source code is available under the Apache-2.0 License.

    🙏 Credits

    ART stands on the shoulders of giants. While we owe many of the ideas and early experiments that led to ART's development to the open source RL community at large, we're especially grateful to the authors of the following projects:

    Finally, thank you to our partners who've helped us test ART in the wild! We're excited to see what you all build with it.