Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
192 lines (173 loc) · 7.52 KB
/
Copy pathpyproject.toml
File metadata and controls
192 lines (173 loc) · 7.52 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
[build-system]
requires = ["setuptools>=69"]
build-backend = "setuptools.build_meta"
[project]
name = "whileai"
version = "0.131"
description = "whileai (import whileai as wai): post-training data and evaluation for tool-using LLM agents. Simulate, grade, measure, select, train, export, with the checks from rlhfbook.com."
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.10"
dependencies = ["requests>=2.25.0", "pydantic>=2.0"]
authors = [{name = "Jacob Weiss", email = "jacob@while.ai"}]
keywords = [
"wai", "while", "whileai", "evals", "agent-evals", "llm-evals", "llm-as-a-judge",
"pass-at-k", "held-out", "confidence-interval", "post-training", "open-weights",
"byok", "rlhf",
"rl", "reinforcement-learning", "grpo", "sft", "dpo", "synthetic-data", "agents",
"ai-agents", "tool-use", "evaluation", "simulation", "llm", "claude-code",
"agents-md", "cursor", "codex",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"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",
"Typing :: Typed",
]
[project.urls]
Homepage = "https://while.ai"
Documentation = "https://docs.while.ai"
Repository = "https://github.com/whilehq/whileai-sdk"
Issues = "https://github.com/whilehq/whileai-sdk/issues"
Datasets = "https://huggingface.co/while-ai"
[project.scripts]
# The command is `wai`: three letters, one token, the same name as the
# import alias. `whileai` runs the same entry point for anyone who typed
# the package name; `zp` was retired on 2026-09-21.
wai = "whileai.cli:main"
whileai = "whileai.cli:main"
whileai-simulations = "whileai.simulations.score.quality:main"
[project.optional-dependencies]
dev = ["pytest>=8.0", "pytest-cov>=5.0", "pytest-xdist>=3.6", "ruff>=0.12",
"mypy>=1.16", "types-requests", "ty>=0.0.82", "math-verify>=0.8"]
rl = ["verifiers>=0.3; python_version >= '3.11' and python_version < '3.14'"]
# export_environment(runtime="openenv") needs nothing but the SDK; serving the
# package (whileai.simulations.openenv) needs Meta PyTorch's OpenEnv, which
# brings fastapi, fastmcp and gradio, so it stays an extra.
openenv = ["openenv>=0.5"]
# verify.MathEqual decides with Math-Verify (Kydlicek et al. 2025); imported
# in the constructor, which names this extra when it is missing. No fallback:
# a weaker rule is a reward the policy learns to game. Optional so the base
# install stays two deps; dev carries it so the tests run.
math = ["math-verify>=0.8"]
# wai.hub.push / export(push_to=): the Hub client that authenticates with the
# user's own HF_TOKEN; imported lazily, so the base install stays two deps.
hf = ["huggingface_hub>=0.20"]
# wai.models.Bedrock on AWS credentials (aws configure, AWS_PROFILE, a role): boto3
# signs the Converse calls. A Bedrock API key in AWS_BEARER_TOKEN_BEDROCK
# needs nothing here; the calls then go over requests.
bedrock = ["boto3>=1.35"]
[tool.setuptools]
include-package-data = false
[tool.setuptools.package-data]
whileai = ["py.typed"]
"whileai.simulations" = ["py.typed", "schemas/*.json"]
[tool.setuptools.packages.find]
where = ["."]
include = ["whileai*"]
# behaviors is internal tooling for our own training runs: in the repo,
# never in the wheel.
exclude = ["tests*", "recipes*", "docs*", "specs*",
"whileai.simulations.behaviors*"]
namespaces = false
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["."]
# One worker per core. The suite is 1,600 small tests with no shared state;
# serial it takes about three minutes, on four cores about forty seconds.
# Pass -n0 for a serial run (needed for --pdb and for reading -s output in order).
addopts = "-n auto"
[tool.ruff]
line-length = 100
target-version = "py310"
extend-exclude = ["build", "dist"]
[tool.ruff.lint]
# PLR2004 (magic value in a comparison) is the ruff half of the
# no-hardcoding rule: scripts/check_no_hardcoding.py checks the comment
# form on named constants, PLR2004 catches the bare number in a compare
# whatever shape it sits in. Strings and bytes are exempt (status words,
# role names); numbers are not, so a `2` that is structure carries a
# `# noqa: PLR2004 # <why>`.
select = ["E", "W", "F", "I", "UP", "B", "SIM", "RUF", "PLR2004"]
ignore = [
"E501", # long lines: the formatter owns wrapping; prose in docstrings stays
"RUF001", "RUF002", "RUF003", # typographic dashes and arrows in prose
"RUF012", # mutable class defaults are used deliberately as registries
"SIM115", # open() without a context manager where the handle is returned
"B905", # zip(strict=) everywhere reads worse than the cases it protects
]
[tool.ruff.lint.pylint]
allow-magic-value-types = ["str", "bytes"]
[tool.ruff.lint.per-file-ignores]
# defaults.py documents every constant as `# NAME = value: why`, which
# ERA001 (commented-out code) would read as dead code if it is ever enabled.
"whileai/simulations/defaults.py" = ["ERA001"]
# The package init re-exports the public surface; the re-exports are the point.
"whileai/simulations/__init__.py" = ["F401", "E402"]
"whileai/__init__.py" = ["F401"]
# Examples and the identity generator set sys.path before importing.
"recipes/**" = ["E402", "PLR2004"]
"tests/**" = ["E402", "PLR2004"]
"scripts/**" = ["PLR2004"]
# Skill playbooks are recipes: their check.py thresholds are the lesson, not engine defaults.
"skills/**" = ["PLR2004"]
".github/**" = ["PLR2004"]
# The account, ingest and platform clients outside simulations/ are not
# under the no-hardcoding rule (yet); their numbers are HTTP codes and
# gate limits. Named one by one: a `whileai/*.py` glob would match the
# whole package.
"whileai/auth.py" = ["PLR2004"]
"whileai/init_evals.py" = ["PLR2004"]
"whileai/platform.py" = ["PLR2004"]
"whileai/cli.py" = ["PLR2004"]
[tool.ruff.lint.isort]
known-first-party = ["whileai", "tests"]
[tool.mypy]
python_version = "3.10"
packages = ["whileai"]
ignore_missing_imports = true
check_untyped_defs = true
warn_unused_ignores = true
warn_redundant_casts = true
no_implicit_optional = true
# Debt: these modules hang attributes on function objects at runtime
# (the situation writer is a closure with state). They type-check once
# the writer is a class. Tracked in CHANGELOG under hygiene.
[[tool.mypy.overrides]]
module = [
"whileai.simulations.generate.generator",
"whileai.simulations.generate.scenarios",
"whileai.simulations.run.engine",
]
ignore_errors = true
# ty runs beside mypy in CI (about ten times faster cold); mypy stays the
# gate until ty reaches 1.0. Same shape as the mypy block above: optional
# extras (torch, sympy, verifiers, ...) import lazily inside functions, so
# an unresolved import is an extra that is not installed, not a typo.
[tool.ty.src]
include = ["whileai"]
[tool.ty.environment]
python-version = "3.10"
[tool.ty.rules]
unresolved-import = "ignore"
# The same three modules as the mypy override: attributes hung on function
# objects. Drop this with the mypy override once the writer is a class.
[[tool.ty.overrides]]
include = [
"whileai/simulations/generate/generator.py",
"whileai/simulations/generate/scenarios.py",
"whileai/simulations/run/engine.py",
]
[tool.ty.overrides.rules]
unresolved-attribute = "ignore"
invalid-argument-type = "ignore"
invalid-assignment = "ignore"
call-non-callable = "ignore"
not-subscriptable = "ignore"