Precision AI Pace
Pace is a logger with progress reporting whose output a scheduler or dashboard can read.
It reads like any good logger in a terminal, and every progress line also carries a short,
machine-readable trailer from which a scheduler can estimate when the job will finish.
- One way to log across projects: the same levels, format and progress bars everywhere.
- Progress for real ML work: loops, manual counters, timed steps, phases, PyTorch Lightning and Hugging Face training.
- Completion estimates: the terminal shows time remaining, and a scheduler or dashboard gets the same estimate from the job's logs.
- No dependencies in the core, and Python 3.11 or later, so it fits into existing training images.
Installation
pip install precisionai-pace
Usage
from precisionai.pace import capture_logging, logger, progress, track
capture_logging() # route PyTorch's and Transformers' standard logging through Pace
logger.info("Loading model")
logger.success("Model ready")
for batch in track(loader, description="Inference", unit="batch"):
infer(batch)
with progress(total=len(requests), description="Evaluation", unit="request") as run:
for future in as_completed(futures):
consume(future.result())
run.advance()
Also available: timed, phase and plan for multi-stage jobs, root=True to mark
the scope that stands for the whole job, and completed= with resumed=True to resume
from a checkpoint. Settings come from logger.configure(...) or PACE_* environment
variables, so a scheduler can change them without code changes.
In a terminal, progress is one bar that redraws in place. In a container or a log file it
is a rate-limited line like this one:
2026-11-03T17:36:42Z PROGRESS Train 1840/5000 36.8% 2.4 step/s · ~21m57s [pace train c=1840 t=5000 e=763.1 q=57 r=6bfc3dd5 root]
The part before [pace ...] is for people. The bracketed trailer is a stable format
that only grows, described in docs/design.md; a program that reads it
should use parse_line, LineSplitter and JobForecast (see
Reading Pace output).
Documentation
| Page |
Read it for |
| Getting started |
Install, first log lines, first progress loop, terminal vs container output. |
| Running on a cluster or scheduler |
The five steps for a job that runs in a container or under a scheduler, the adopt-pace skill, and what running real jobs taught. |
| Logging |
Levels, exception, configure and precedence, capture_logging, colour, encodings, ranks. |
| Progress |
track, progress, timed, phase, plan, nesting, resuming, root scope, emission rates, the terminal bar. |
| Examples |
One runnable script per style of logging and progress: loops, epochs, resuming, phases, ranks, reading the output. |
| Framework integrations |
The PyTorch Lightning and Hugging Face Transformers callbacks. |
| Migrating |
From print, tqdm, Loguru and logging. |
| Configuration |
Every PACE_* variable and its configure equivalent. |
| Reading Pace output |
For programs that read logs: parsing, de-duplication, estimates, conformance fixtures. |
| FAQ |
Short answers. |
| Specification |
The line format and the forecasting rules. |
The HTML build of these pages (and the module reference) is produced with Sphinx:
cd docs
make html # HTML docs → docs/_build/html/index.html
make latexpdf # PDF → docs/_build/latex/documentation.pdf
Dependencies: pip install -r docs/requirements.txt
Compatibility
Pace follows semantic versioning. From 1.0:
- Python API: stable. It is everything in
precisionai.pace.__all__ and in the
__all__ of each public submodule (core, scopes, capture, protocol,
forecast, lightning, transformers, tqdm, version).
- The
[pace ...] trailer: permanent, and it only grows. No key or word is ever
removed or redefined, readers ignore keys and words they do not know, and there is no
version marker.
PACE_* variables and configure() options: names and accepted values are stable.
ForecastConfig: field names are stable. Defaults and the estimation algorithm may
change in a minor release.
- Not covered: the readable text before the trailer, the estimate numbers,
_-prefixed names and modules, and the adopt-pace skill's verify.py.
A deprecated name keeps working, with a DeprecationWarning, for at least one minor
release before it is removed. Dropping a Python version that has reached end of life
happens in a minor release. The detail is in
Specification: compatibility.
Development
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pre-commit install
python -m pytest
Coverage must remain at or above 90%, enforced by pytest and the pre-commit hook.
CI runs the tests on Python 3.11 through 3.14.
Project layout
precisionai/pace/ # the package (core: standard library only)
docs/ # Sphinx (HTML + LaTeX/PDF), including design.md
skills/adopt-pace/ # Claude Code skill that adds Pace to a repository
examples/ # runnable examples
tests/ # mirrors the package structure
See CLAUDE.md for the coding standard.
Releasing
Push a tag matching v*.*.* (e.g. v1.0.0) to trigger .github/workflows/release.yml,
which runs the test suite, builds the sdist and wheel, publishes to PyPI via trusted
publishing, and creates a GitHub Release. The version comes from the git tag via
setuptools-scm. Update CHANGELOG.md before tagging.
Security
To report a security vulnerability, see SECURITY.md. Do not open a public issue.
Contributing
See CONTRIBUTING.md for setup and PR guidelines, and
CODE_OF_CONDUCT.md for community expectations.
License
Apache 2.0 © Precision AI