You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[2025-05][[Release Notes](https://github.com/modelscope/Trinity-RFT/releases/tag/v0.1.0)] Trinity-RFT v0.1.0 released, plus [technical report](https://arxiv.org/abs/2505.17826).
31
-
*[2025-04] Trinity-RFT open sourced.
32
-
33
-
34
21
## 💡 What is Trinity-RFT?
35
22
36
-
Trinity-RFT is a flexible, general-purpose framework for reinforcement fine-tuning (RFT) of large language models (LLMs). It supports a wide range of applications and provides a unified platform for RL research in the [era of experience](https://storage.googleapis.com/deepmind-media/Era-of-Experience%20/The%20Era%20of%20Experience%20Paper.pdf).
23
+
Trinity-RFT is a flexible, general-purpose framework for reinforcement fine-tuning (RFT) of large language models (LLMs). It provides three independent modules for users with different needs:
37
24
38
-
The RFT process is modularized into three core components:
<imgsrc="https://img.alicdn.com/imgextra/i2/O1CN01H3UbpF1yP7E1OCLbi_!!6000000006570-2-tps-1334-638.png"alt="The high-level design of Trinity-RFT"width="800" />
46
37
47
-
48
-
49
-
## ✨ Key Features
38
+
Trinity-RFT unifies the above three modules and provides the following key features:
50
39
51
40
***Flexible RFT Modes:**
52
41
- Supports synchronous/asynchronous, on-policy/off-policy, and online/offline training. Rollout and training can run separately and scale independently across devices.
53
42
54
43
<imgsrc="https://img.alicdn.com/imgextra/i3/O1CN01E7NskS1FFoTI9jlaQ_!!6000000000458-2-tps-1458-682.png"alt="RFT modes supported by Trinity-RFT"width="600" />
55
44
56
-
***Agent Framework Compatible Workflows:**
57
-
- Supports both concatenated and general multi-turn agentic workflows. Automatically collects training data from model API clients (e.g., OpenAI) and is compatible with agent frameworks like AgentScope.
45
+
***General Agentic-RL Support:**
46
+
- Supports both concatenated and general multi-turn agentic workflows. Able to directly train agent applications developed using agent frameworks like AgentScope.
- Enables pipeline processing of rollout and experience data, supporting active management (prioritization, cleaning, augmentation) throughout the RFT lifecycle.
*[2025-05][[Release Notes](https://github.com/modelscope/Trinity-RFT/releases/tag/v0.1.0)] Trinity-RFT v0.1.0 released, plus [technical report](https://arxiv.org/abs/2505.17826).
70
+
*[2025-04] Trinity-RFT open sourced.
73
71
74
-
## 🛠️ What can I use Trinity-RFT for?
75
-
76
-
***Train agent applications with RL and minimal migration cost**[[Tutorial]](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/trinity_programming_guide.html#workflows-for-rl-environment-developers)
77
-
- Implement agent-environment interaction logic in a single workflow class ([example1](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/example_multi_turn.html), [example2](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/example_step_wise.html)),
78
-
- Or import workflows from agent frameworks like AgentScope ([example](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/example_react.html)).
79
-
80
-
***Rapid RL algorithm design and validation**[[Tutorial]](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/trinity_programming_guide.html#algorithms-for-rl-algorithm-developers)
***Custom datasets and data pipelines for RFT**[[Tutorial]](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/trinity_programming_guide.html#operators-for-data-developers)
84
-
- Design task-specific datasets and build data pipelines for cleaning, augmentation, and human-in-the-loop scenarios ([example](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/example_data_functionalities.html)).
85
72
86
73
---
87
74
88
75
## Table of contents
89
76
90
77
91
-
-[Getting started](#getting-started)
78
+
-[Quick Start](#quick-start)
92
79
-[Step 1: installation](#step-1-installation)
93
80
-[Step 2: prepare dataset and model](#step-2-prepare-dataset-and-model)
94
81
-[Step 3: configurations](#step-3-configurations)
@@ -101,7 +88,7 @@ The RFT process is modularized into three core components:
101
88
102
89
103
90
104
-
## Getting started
91
+
## Quick Start
105
92
106
93
107
94
> [!NOTE]
@@ -110,18 +97,16 @@ The RFT process is modularized into three core components:
110
97
111
98
### Step 1: installation
112
99
113
-
#### Prerequisites
114
-
115
100
Before installing, make sure your system meets the following requirements:
116
101
117
102
-**Python**: version 3.10 to 3.12 (inclusive)
118
103
-**CUDA**: version 12.4 to 12.8 (inclusive)
119
104
-**GPUs**: at least 2 GPUs
120
105
121
106
122
-
#### Option A: Install from Source (Recommended)
107
+
#### From Source (Recommended)
123
108
124
-
This method gives you full control and is best if you plan to customize or contribute to the project.
109
+
If you plan to customize or contribute to Trinity-RFT, this is the best option.
125
110
126
111
##### 1. Clone the Repository
127
112
@@ -132,81 +117,71 @@ cd Trinity-RFT
132
117
133
118
##### 2. Set Up a Virtual Environment
134
119
135
-
Choose one of the following options to create an isolated environment:
120
+
Choose one of the following options:
136
121
137
122
###### Using Conda
123
+
138
124
```bash
139
125
conda create -n trinity python=3.10
140
126
conda activate trinity
127
+
128
+
pip install -e ".[dev]"
129
+
pip install -e ".[flash_attn]"
130
+
# if you encounter issues when installing flash-attn, try:
# Run the container, replacing <path_to_your_data_and_checkpoints> with your actual path
210
185
docker run -it \
211
186
--gpus all \
212
187
--shm-size="64g" \
@@ -216,9 +191,7 @@ docker run -it \
216
191
trinity-rft:latest
217
192
```
218
193
219
-
💡 **Note**: Replace `<path_to_your_data_and_checkpoints>` with the actual path on your machine where datasets and model checkpoints are stored.
220
-
221
-
> If you'd like to integrate with **Megatron-LM**, check out our [example setup guide for Megatron](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/example_megatron.html).
194
+
> For training with **Megatron-LM**, please refer to [Megatron-LM Backend](https://modelscope.github.io/Trinity-RFT/en/main/tutorial/example_megatron.html).
0 commit comments