r/huggingface • u/Emergency-Tutor-7 • 10h ago
Models that carry their units, so a rerun cannot silently mean something else
A model checkpoint reproduces a function, not the model. The units, the parameter ranges and the reason a term exists all live in whoever wrote the code, and six months later that context is gone. I have watched a simulation get rerun with a rate in the wrong time base and produce a curve that looked plausible enough to publish.
axiomize is the modeling layer I built around that gap. A model is declared with mandatory units on every parameter and variable, kept in a versioned Model IR, and validated before any numbers come out. Because the checks run on canonical unit scales and not only dimension exponents, a rate declared 1/s while the independent variable is in day fails instead of quietly producing a value 86,400 times off.
The failure is loud by construction. Simulation routes through the same validation as axiomize model --action validate, and a mismatch raises ModelDimensionMismatch with the failing checks instead of returning an array. There is also an audit for the quiet version of the problem: unit_declaration_audit lists every symbol that would default to dimensionless, which is usually where an unlabeled constant is hiding.
What leaves the tool is the part that survives a move between machines. Models export to canonical JSON, Python, YAML, notebooks, SBML Level 3, CellML 2.0, Modelica, GraphML, Graphviz DOT and a SHA-256 portable bundle, and values with units round-trip bit-exactly, asserted in the test suite rather than stated in prose. A run ledger keeps the provenance, so a stored result can be checked before someone reuses it, and axiomize-to-latex turns a standardized report into LaTeX if the output has to become a document.
There are sixteen actions under axiomize model for the lifecycle, including plan, validate, simulate, fit, compare, repair, numerical-verify and export. Numerical verification compares against closed-form theory and separates numerical error from stochastic variability before it claims convergence, which is the only part of the pipeline that can honestly be called verification.
Install is pip install axiomize, or npm install -g axiomize. What it does not do: it does not make a bad model good, it makes a bad model fail loudly, and dimensional checking catches unit errors rather than physics errors. Bayesian sampling needs the full extra with PyMC and JAX, FEM needs FEniCS, and both are reported as unavailable instead of being silently substituted. The worked examples use illustrative parameter ranges, not literature-backed ones. MIT, 1.15.0: https://github.com/Furox-Art/axiomize
