98 lines
3.6 KiB
TOML
98 lines
3.6 KiB
TOML
[build-system]
|
|
requires = ["hatchling", "hatch-vcs"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "renderers"
|
|
# Derived from git tags by hatch-vcs (see [tool.hatch.version] below).
|
|
# Untagged commits get PEP 440 dev versions like ``0.1.8.dev3+g4c877be4``
|
|
# so any commit is uniquely installable; tagged commits get clean
|
|
# release versions like ``0.1.8``.
|
|
dynamic = ["version"]
|
|
description = "Chat template renderers — deterministic message-to-token conversion for LLM training"
|
|
readme = "README.md"
|
|
license = "Apache-2.0"
|
|
license-files = ["LICENSE"]
|
|
requires-python = ">=3.10,<3.14"
|
|
dependencies = [
|
|
"numpy",
|
|
"openai>=1.108.1",
|
|
"tiktoken",
|
|
"jinja2",
|
|
"transformers>=4.50.0",
|
|
# Used by GptOssRenderer to render and parse harmony tokens. Vendoring
|
|
# OpenAI's reference implementation keeps us byte-identical with vLLM
|
|
# (which also uses it) and saves us mirroring a 330-line Jinja template.
|
|
"openai-harmony>=0.0.8",
|
|
# Crusoe's Rust BPE tokenizer; ~10x faster encode vs HF's tokenizers.
|
|
# ``load_tokenizer`` patches it in by default for every supported model
|
|
# except a small denylist (DeepSeek-V3 family). The patch is bracketed
|
|
# around ``from_pretrained``, so subsequent ``AutoTokenizer`` calls
|
|
# outside the renderers package stay vanilla.
|
|
"fastokens>=0.2.0",
|
|
# ``BaseRendererConfig`` inherits from ``pydantic_config.BaseConfig`` so
|
|
# the typed-config surface stays uniform with prime-rl / verifiers config
|
|
# bases. Transitively brings pydantic, which ``renderers.configs`` also
|
|
# imports directly.
|
|
"prime-pydantic-config>=0.3.0.dev83",
|
|
]
|
|
|
|
[tool.hatch.version]
|
|
source = "vcs"
|
|
# Tags look like ``renderers-v0.1.8`` (prefix matches the publish.yml
|
|
# release contract); strip the prefix to get a PEP 440 version. The
|
|
# regex accepts any PEP 440-valid suffix after the prefix so we can
|
|
# tag pre-releases like ``renderers-v0.2.0rc1`` later if needed.
|
|
tag-pattern = '^renderers-v(?P<version>.+)$'
|
|
# Used when building from a context without VCS metadata (e.g. an
|
|
# sdist consumed by a downstream that doesn't ship .git). Real
|
|
# builds from a checkout get the resolved version; this fallback
|
|
# only fires when the resolver has nothing to go on.
|
|
fallback-version = "0.0.0"
|
|
|
|
[tool.hatch.build.hooks.vcs]
|
|
# Write the resolved version to a Python file so it can be inspected
|
|
# at runtime via ``renderers.__version__`` without re-parsing the
|
|
# wheel metadata.
|
|
version-file = "renderers/_version.py"
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["renderers"]
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pillow>=12.2.0",
|
|
"pre-commit",
|
|
"pytest>=7.0.0",
|
|
"pytest-asyncio>=0.21.0",
|
|
"ruff",
|
|
"torch>=2.11.0",
|
|
"torchvision>=0.26.0",
|
|
"ty>=0.0.1a29,<0.0.22",
|
|
]
|
|
|
|
[tool.uv]
|
|
exclude-newer = "7 days"
|
|
# fastokens 0.2.0 was published on 2026-05-17 and contains the
|
|
# ``unpatch_transformers`` fix (crusoecloud/fastokens#32) needed for
|
|
# MiniMax-M2's slow→fast tokenizer conversion path. Exempting it from
|
|
# the project-wide 7-day cutoff lets the lockfile pick it up immediately
|
|
# while the rest of the dependency graph stays gated.
|
|
exclude-newer-package = { fastokens = false, "prime-pydantic-config" = false }
|
|
|
|
[tool.ty.environment]
|
|
python-version = "3.13"
|
|
|
|
[tool.ty.rules]
|
|
# Pre-existing diagnostics in v0.1.5 source — downgrade to advisory so CI
|
|
# surfaces them without blocking. Tighten back to error as we clean up.
|
|
unknown-argument = "warn"
|
|
redundant-cast = "ignore"
|
|
unresolved-import = "warn"
|
|
invalid-argument-type = "warn"
|
|
unresolved-attribute = "warn"
|
|
invalid-key = "warn"
|
|
unsupported-operator = "warn"
|
|
invalid-return-type = "warn"
|
|
invalid-assignment = "warn"
|