1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154[build-system]
requires = ["setuptools>=65", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "trinity-rft"
version = "0.5.1"
authors = [
{name="Trinity-RFT Team", email="trinity-rft@outlook.com"},
]
description = "Trinity-RFT: A Framework for Training Large Language Models with Reinforcement Fine-Tuning"
readme = "README.md"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
]
requires-python = ">=3.10,<3.13"
dependencies = [
"verl==0.7.0",
"ray[default]>=2.50.0",
"tensordict",
"wandb",
"omegaconf",
"sqlalchemy",
"psycopg2-binary",
"networkx",
"latex2sympy2_extended",
"math_verify>=0.8.0",
"ninja",
"fire",
"streamlit",
"flask",
"requests",
"tensorboard",
"openai",
"jsonlines",
"sortedcontainers",
"word2number",
"matplotlib",
"transformers>=4.51.0,<5.0.0",
"datasets>=4.0.0",
"typer>=0.20.1",
]
[project.scripts]
trinity = "trinity.cli.launcher:main"
[project.optional-dependencies]
vllm = [
"vllm>=0.10.2,<=0.16.0,!=0.11.0,!=0.12.0",
# v0.11 has bug when prefix-caching is enabled so we exclude it
# v0.12 has a huge performance regression so we exclude it
# v0.10.2 is the most stable version, but we allow up to 0.16.0 for new features
]
data = [
"py-data-juicer>=1.4.3"
]
agent = [
"agentscope>=1.0.12"
]
rm_gallery = [
"rm-gallery>=0.1.5"
]
dev = [
"pre-commit>=2.17.0",
"black>=23.7.0",
"flake8>=6.1.0",
"flake8-docstrings>=1.6.0",
"isort>=5.12.0",
"mypy>=1.7.0",
"pytest>=8.0.0",
"pytest-json-ctrf",
"parameterized",
"viztracer",
]
megatron = [
"megatron-core[mlm]==0.15.0",
# if you found "undefined symbol" error in transformer engine
# reinstall it with --no-build-isolation and `--no-cache-dir` flag
# "transformer_engine[pytorch]==2.10.0",
# Install mbridge from main branch (unreleased version)
# "mbridge @ git+https://github.com/ISEEKYAN/mbridge.git@20e9ffbbe72ae7b1df83bfe1bc3c11f7382f2612",
]
tinker = [
"tinker>=0.10.0; python_version >= '3.11'",
]
doc = [
"sphinx<9.0.0",
"sphinx-autobuild",
"sphinx-book-theme",
"myst-parser",
"sphinxcontrib-apidoc",
"sphinx-multiversion",
"sphinxcontrib-mermaid",
]
mm = [
"qwen-vl-utils",
"transformers>=4.54.0",
"blobfile",
]
flash_attn = [
"flash-attn==2.8.1"
]
[tool.setuptools.packages.find]
where = ["."]
include = ["trinity*"]
exclude = ["tests*", "docs*", "scripts*"]
[tool.setuptools.package-data]
my_package = ["*.md", "*.rst"]
[tool.black]
line-length = 100
target-version = ["py310", "py311", "py312"]
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.github
| \.vscode
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| build
| dist
)/
'''
[tool.isort]
known_third_party = ["wandb"]
[tool.uv.extra-build-dependencies]
flash-attn = ["torch", "numpy"]
[project.entry-points."vllm.general_plugins"]
vllm_patch = "trinity.common.models.vllm_patch:vllm_patch"
[project.urls]
"Homepage" = "https://github.com/agentscope-ai/Trinity-RFT"
"Documentation" = "https://agentscope-ai.github.io/Trinity-RFT/"