Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
234 lines (216 loc) · 7.47 KB
/
Copy pathpyproject.toml
File metadata and controls
234 lines (216 loc) · 7.47 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
[build-system]
requires = ["hatchling>=1.24"]
build-backend = "hatchling.build"
[project]
name = "miniverl"
dynamic = ["version"]
description = "Auditable single-GPU alignment and distillation with a bounded verl artifact bridge."
readme = "PYPI.md"
requires-python = ">=3.10"
license = { text = "Apache-2.0" }
authors = [{ name = "Daoyuan Li", email = "lidaoyuan2816@gmail.com" }]
keywords = [
"llm",
"on-policy-distillation",
"knowledge-distillation",
"agentic-rl",
"tool-use",
"qlora",
"consumer-gpu",
"single-gpu",
"post-training",
"qwen",
"llm-agents",
"verl",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"typer>=0.12",
"rich>=13.7",
"pydantic>=2.7",
"pyyaml>=6.0",
"jinja2>=3.1",
"platformdirs>=4.2",
"safetensors>=0.4.3",
"filelock>=3.13",
]
[project.optional-dependencies]
train = [
"torch>=2.3",
"transformers>=4.51,<6",
"peft>=0.12",
"accelerate>=0.33",
"numpy>=1.24",
"pyarrow>=15",
]
cuda = ["bitsandbytes>=0.43; platform_system != 'Darwin'"]
dpo = [
"trl==1.8.0",
"datasets>=4.0,<5",
]
# numpy is what the official safetensors reader needs for framework="np". Without
# it the adapter payload can still be validated structurally, but
# `bridge doctor --require-adapter-payload` can never be satisfied, so the extra
# that exists for bridge work has to carry it.
bridge = ["pyarrow>=15", "numpy>=1.24"]
# External alignment benchmarks. Deliberately separate from the core and from
# [train]: a plain `pip install miniverl` must not pull in dataset tooling,
# judge models or a network client. The judge models themselves are ordinary
# transformers checkpoints, so [train] supplies the runtime for them.
alignment-benchmarks = [
"datasets>=4.0,<5",
# IFEval's language:response_language instruction cannot be verified without
# language identification. Absent it, that instruction reports
# not_applicable rather than being guessed or scored zero.
"langdetect>=1.0.9",
]
dev = [
"pytest>=8.0",
"pytest-cov>=5.0",
"jsonschema>=4.21",
"hypothesis>=6.100",
"ruff>=0.6",
"mypy>=1.11",
"types-PyYAML>=6.0",
"build>=1.2",
"twine>=5.1",
"pyarrow>=15",
"mkdocs>=1.6,<2",
"mkdocs-material==9.7.7",
"playwright==1.62.0",
]
[project.scripts]
miniverl = "miniverl.cli:app"
[project.urls]
Homepage = "https://github.com/DaoyuanLi2816/mini-verl"
PyPI = "https://pypi.org/project/miniverl/"
Documentation = "https://daoyuanli2816.github.io/mini-verl/"
Issues = "https://github.com/DaoyuanLi2816/mini-verl/issues"
Repository = "https://github.com/DaoyuanLi2816/mini-verl"
Changelog = "https://github.com/DaoyuanLi2816/mini-verl/blob/main/CHANGELOG.md"
[tool.hatch.version]
path = "src/miniverl/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["src/miniverl"]
# The release toolchain's Twine 6.2 rejects Core Metadata 2.5. Hatchling 1.31
# emits 2.5 by default, so pin the emitted standard to the version that the
# required `twine check` gate can inspect.
core-metadata-version = "2.4"
# The pinned endpoint registry names the exact dataset and evaluator revisions
# the packaged evaluators target, so it has to travel with the wheel: an
# installed `miniverl alignment-suite prepare` reads it. One copy lives in the
# repository under benchmarks/; this maps it next to the module that loads it.
[tool.hatch.build.targets.wheel.force-include]
"benchmarks/external-alignment/registry.yaml" = "miniverl/alignment_external/registry.yaml"
"benchmarks/external-alignment/profile-v1.yaml" = "miniverl/alignment_external/profile-v1.yaml"
"benchmarks/results/alignment-external-v1.json" = "miniverl/evidence/data/alignment-external-v1/result.json"
"benchmarks/schema/alignment-external-result.schema.json" = "miniverl/evidence/data/alignment-external-v1/result.schema.json"
"benchmarks/preregistration/alignment-external-v1.yaml" = "miniverl/evidence/data/alignment-external-v1/preregistration.yaml"
"benchmarks/evidence/alignment-external-v1/jsonnav-selection-records.jsonl" = "miniverl/evidence/data/alignment-external-v1/task-evidence.jsonl"
"src/miniverl/resources/qwen3_0_6b_1_7b_opd.yaml" = "miniverl/resources/qwen3_0_6b_1_7b_opd.yaml"
[tool.hatch.build.targets.sdist]
core-metadata-version = "2.4"
include = [
"/src/miniverl",
"/tests",
"/recipes",
"/examples",
"/benchmarks",
"/docs",
"/paper",
"/scripts",
"/.github",
"/README.md",
"/README.zh-CN.md",
"/PYPI.md",
"/CHANGELOG.md",
"/CONTRIBUTING.md",
"/CODE_OF_CONDUCT.md",
"/SECURITY.md",
"/PROJECT_STATE.md",
"/LICENSE",
"/THIRD_PARTY_NOTICES.md",
"/CITATION.cff",
# The canonical release state; tests/unit/test_release_state.py reads it, so
# an extracted sdist has to carry it.
"/release-state.yaml",
"/mkdocs.yml",
"/pyproject.toml",
]
[tool.ruff]
line-length = 100
target-version = "py310"
extend-exclude = [".venv", "runs", "dist", "build"]
[tool.ruff.lint]
select = ["E", "F", "I", "W", "B", "UP", "C4", "SIM", "RUF", "ARG", "PTH"]
ignore = [
"E501", # long lines are handled by the formatter where reasonable
"B008", # typer Option(...) defaults in signatures are intentional
"RUF001", # ambiguous unicode is intentional in the zh-CN docs / box drawing
"RUF002",
"RUF003",
"RUF022", # __all__ is grouped by concern on purpose; alphabetical hurts reading
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["B018", "ARG001", "ARG002", "ARG005", "PTH"]
"scripts/*" = ["PTH", "SIM105"]
# sqlite3.set_authorizer dictates the callback signature; unused parameters are
# part of the contract, not dead code.
"src/miniverl/environments/sqlite_env.py" = ["ARG002"]
# Typer resolves annotations at runtime; Optional[X] is required for options
# with a None default, so UP045 (prefer `X | None`) must not apply here.
"src/miniverl/cli.py" = ["ARG001", "UP045"]
[tool.ruff.lint.isort]
known-first-party = ["miniverl"]
[tool.pytest.ini_options]
addopts = "-ra --strict-markers --strict-config"
testpaths = ["tests"]
filterwarnings = ["ignore::DeprecationWarning:pkg_resources.*"]
markers = [
"gpu: requires a CUDA GPU (deselected in CPU CI)",
"torch: requires the [train] extra (torch/transformers/peft)",
"network: requires network access (deselected in CI)",
"verl_conformance: imports the exact pinned official verl source",
"slow: takes more than a few seconds",
]
[tool.coverage.run]
branch = true
source = ["miniverl"]
omit = ["*/miniverl/reporting/templates/*"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
"raise AssertionError",
]
[tool.mypy]
plugins = ["pydantic.mypy"]
# No python_version pin: mypy runs on the dev/CI interpreter. Third-party stubs
# (numpy) already use 3.12+ syntax, so pinning 3.10 breaks stub parsing. The
# 3.10 floor is enforced by ruff's target-version plus the CI test matrix.
files = ["src/miniverl"]
strict = false
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = false
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["miniverl.reporting.*"]
disallow_untyped_defs = true