Reinforcement Learning for Language Agents
$git clone https://github.com/rllm-org/rllmInstalls into the current project.
Install rllm by running `git clone https://github.com/rllm-org/rllm`, then use it for the current task and follow its documentation at https://github.com/rllm-org/rllm.
| 1 | <div align="center"> |
| 2 | |
| 3 | <picture> |
| 4 | <source media="(prefers-color-scheme: dark)" srcset="docs/logo/rllm-github-logo-dark.png"> |
| 5 | <img src="docs/logo/rllm-github-logo-light.png" alt="rLLM" width="360"> |
| 6 | </picture> |
| 7 | |
| 8 | **Agentic RL on any harness, with any backend, on any benchmark.** |
| 9 | |
| 10 | [](https://docs.rllm-project.com/) |
| 11 | [](https://join.slack.com/t/rllmproject/shared_invite/zt-3pyblo6ef-m9kqAoInI8xSyUBkpuOyXA) |
| 12 | [](https://rllm-project.com) |
| 13 | [](https://rllm-project.com/blog) |
| 14 | [](https://x.com/rllm_project) |
| 15 | |
| 16 | <!-- [](https://pypi.org/project/rllm/) --> |
| 17 | |
| 18 | </div> |
| 19 | |
| 20 | rLLM is an open-source framework for training language agents with reinforcement learning. Bring any harness, run it in any sandbox, and switch training backends with one flag — the same agent code drives both eval and training. |
| 21 | |
| 22 | ## Core features |
| 23 | |
| 24 | - **Any harness.** 10+ CLI harnesses (Claude Code, Codex, Terminus-2, mini-swe-agent, opencode, ...) plus Harbor-compatible task dirs. Or wrap your own agent — LangGraph, OpenAI Agents SDK, `openai.OpenAI` — with `@rllm.rollout`. |
| 25 | - **Any sandbox.** Docker, Daytona, Modal, or local — with snapshot + warm-pool acceleration to keep rollouts cheap at training-scale. |
| 26 | - **Multiple training backends, one API.** `verl` (distributed multi-GPU), `tinker` (single-machine), `fireworks` (Fireworks platform). Switch with one flag. |
| 27 | - **60+ integrated benchmarks.** Math, code, MCQ, QA, search, VLM, translation, agentic — Terminal-Bench 2.0, SWE-bench, SkillsBench, AIME, MATH-500, GPQA, and more. `rllm eval <name>` auto-pulls and runs. |
| 28 | - **Multiple training methods.** GRPO, REINFORCE, RLOO, SFT, on-policy distillation, and more. |
| 29 | - **Battle-tested.** State-of-the-art open-source results (DeepScaleR-1.5B, DeepCoder-14B, DeepSWE-32B, FinQA-4B). Adopted by academic labs and industry research teams (see [Community Projects](#community-projects) below). |
| 30 | |
| 31 | Read more on our [documentation site](https://docs.rllm-project.com/). |
| 32 | |
| 33 | ## Installation |
| 34 | |
| 35 | rLLM requires `Python >= 3.11`. You can install it either directly via pip or build from source. |
| 36 | |
| 37 | ```bash |
| 38 | uv pip install "rllm @ git+https://github.com/rllm-org/rllm.git" |
| 39 | ``` |
| 40 | |
| 41 | This installs dependencies for running `rllm` CLI with the `tinker` backend (single-machine, Tinker API). For other backends: |
| 42 | |
| 43 | ```bash |
| 44 | # Distributed multi-GPU training (verl + vLLM/SGLang) |
| 45 | uv pip install "rllm[verl] @ git+https://github.com/rllm-org/rllm.git" |
| 46 | |
| 47 | # Fireworks training platform |
| 48 | uv pip install "rllm[fireworks] @ git+https://github.com/rllm-org/rllm.git" |
| 49 | ``` |
| 50 | |
| 51 | For building from source or Docker, see the [installation guide](https://docs.rllm-project.com/installation). |
| 52 | |
| 53 | ## Quickstart |
| 54 | |
| 55 | ### Option A: CLI (no code needed) |
| 56 | |
| 57 | ```bash |
| 58 | # 1. Configure your model provider |
| 59 | rllm model setup |
| 60 | |
| 61 | # 2. Evaluate on a benchmark |
| 62 | rllm eval gsm8k |
| 63 | |
| 64 | # 3. Train with RL |
| 65 | rllm train gsm8k |
| 66 | ``` |
| 67 | |
| 68 | ### Option B: Python API |
| 69 | |
| 70 | Define a rollout (your agent) and an evaluator (your reward function), then hand them to the trainer: |
| 71 | |
| 72 | ```python |
| 73 | # my_flow.py |
| 74 | from openai import OpenAI |
| 75 | import rllm |
| 76 | from rllm.types import AgentConfig, Episode, Task, Trajectory |
| 77 | |
| 78 | @rllm.rollout |
| 79 | def solve(task: Task, config: AgentConfig) -> Episode: |
| 80 | client = OpenAI(base_url=config.base_url, api_key="EMPTY") |
| 81 | response = client.chat.completions.create( |
| 82 | model=config.model, |
| 83 | messages=[{"role": "user", "content": task.instruction}], |
| 84 | ) |
| 85 | answer = response.choices[0].message.content or "" |
| 86 | return Episode( |
| 87 | trajectories=[Trajectory(name="solver", steps=[])], |