vibe-check
Reliability checks for machine-learning surrogates in scientific software.
A surrogate (an emulator, neural operator, or learned solver component) is
usually judged by its average test error. That number can hide problems: the
model may be extrapolating outside its training data, the preprocessing may
have leaked test data, or the outputs may break a physical constraint.
vibe-check takes a predict function (or saved predictions) and your data
splits, runs twelve checks, and writes a report that someone who did not
train the model can read.
This work is supported by the US Research Software Sustainability Institute (URSSI) via grant G-2022-19347 from the Sloan Foundation.
Install
The package is not on PyPI yet. Clone the repository and install it in place:
git clone https://github.com/imalsky/vibe-check.git
cd vibe-check
pip install -e ".[viz]"
The core needs only numpy. The viz extra adds matplotlib for report figures.
The distribution is named vibe-check-ml; the module you import is vibecheck.
Example
examples/quickstart.py is the smallest complete run: a linear least-squares
surrogate for 1-D diffusion. It maps an initial field on a 64-point periodic
grid to the field the heat equation produces at a later time, with observation
noise on the targets. The solution operator of the heat equation is a matrix,
so least squares is a fair surrogate for it. The script needs numpy and
matplotlib.
The check itself is one call. predict is the fitted surrogate, and the
metadata names the input scaler the model used, a throughput budget, and the
fact that the 64 outputs are a 1-D field:
report = vc.check(
predict,
X_train=u0_train, y_train=ut_train,
X_test=u0_test, y_test=ut_test,
metadata={
"normalization": {"mean": u0_train.mean(0), "std": u0_train.std(0)},
"speed": {"min_throughput": 1e4},
"error_field": {"is_field": True}, # the 64 output values are a 1-D field
"make_figures": True,
},
)
print(report)
report.to_markdown("report.md")
report.to_html("report.html")
report.to_json("report.json")
The script prints one line per check (SKIP means the check did not get the
inputs it needs, and the line names them) and an overall status that says
how many checks ran. It writes report.md, report.html, and
report.json, and draws the figure below. On the left, one test field
diffuses from u(x, 0) to u(x, T) and the surrogate lies over it. On the
right, predicted against true across the whole test set.
What it checks
| check | what it detects |
|---|---|
leakage.normalization |
input or target scaler statistics fit on test or full data instead of train only |
leakage.split_overlap |
duplicate or near-duplicate rows across train, validation, and test |
distribution.coverage |
test inputs outside the training domain, with a coverage map |
distribution.drift |
drift between the train, validation, and test marginals |
error.pointwise |
RMSE and skill per output channel, predicted vs true, residuals |
error.field |
true, predicted, and percent-error maps for spatial fields, and error by wavenumber band |
error.by_input |
where in input space the error concentrates: the worst quantile bin against the rest |
calibration.coverage |
stated uncertainty vs observed coverage of 1, 2, and 3 sigma intervals, and the tails beyond 3 sigma |
constraints.physical |
conservation, positivity, monotonicity, symmetry, bounds |
model.determinism |
outputs that change between calls or with the batch size: dropout or batch-norm left in training mode |
export.roundtrip |
whether an exported model reproduces the in-memory one |
speed.inference |
batch throughput and single-input latency against a stated budget |
Worked examples
Four small trained surrogates with committed reports, one per common shape of scientific ML model:
examples/robertson: Robertson stiff chemical kinetics, a state-to-state MLP (report).examples/lorenz: the Lorenz system, an MLP that predicts the next several states (report).examples/fno_burgers: a Fourier neural operator on 1-D Burgers, a spatial-field model (report).examples/darcy_2d: a 2-D Fourier neural operator on Darcy flow, a 2-D field model with a positivity constraint (report).
examples/README.md says how to run them. The Darcy report's worst test
sample, as error.field draws it: the true pressure field, the predicted
field on the same colour scale, and the percent error.
Documentation
docs/TUTORIAL.md: from a trained model to a report, how to turn on more checks, and how to gate CI.docs/RECIPES.md: wrapping PyTorch, JAX, scikit-learn, and ONNX models aspredict, field-shaped arrays, and running from saved predictions.docs/VALIDATION_CONTRACT.md: the interface every check follows and themetadatakeys each one reads.docs/CASE_STUDY_normalization_leakage.md: how a scaler fit on the full dataset inflates test accuracy, with a runnable demo.docs/RELEASING.md: the release checklist.
Related tools
deepchecks and
Evidently test tabular data and
models in pandas. uncertainty-toolbox
scores predictive uncertainty and MAPIE
builds conformal intervals. PDEBench
and The Well benchmark PDE
surrogates on their own datasets, and
diagnostics_for_physics
audits the physical structure of learned PDE time-steppers. None of them
takes a bare predict function with numpy splits and reports leakage,
coverage, calibration, constraints, export, and speed together; that is
the gap vibe-check fills.
Status
Version 0.1.0 is prepared but not yet tagged or published. The public API may
change before 1.0. See CHANGELOG.md.
License
MIT. See LICENSE.
Metadata
Release files for vibe-check-ml 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vibe_check_ml-0.1.0.tar.gz | 560.6 kB | With provenance | Details for vibe_check_ml-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vibe_check_ml-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for vibe_check_ml-0.1.0-py3-none-any.whl |
Total release size: 614.8 kB
Release files / vibe_check_ml-0.1.0.tar.gz
| Download URL | vibe_check_ml-0.1.0.tar.gz |
|---|---|
| Size | 560.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac5b99b361405430b908de91ea45ca85ac80e6c8259120221fbb1b444692148d
|
|
BLAKE2b-256 checksum How to use checksums |
79639d555facd408f2d702473e8f917f2c1b898928122f4ab132afdbdd650c27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / vibe_check_ml-0.1.0-py3-none-any.whl
| Download URL | vibe_check_ml-0.1.0-py3-none-any.whl |
|---|---|
| Size | 54.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a24c86e555bfeeb76d104d8b861d6720cdff1fa597da8287d762ca1c9694ad9
|
|
BLAKE2b-256 checksum How to use checksums |
210757a40cdc1a325c7a7275f18230ac67f5e49f009e881854f84c56e3e32121
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for vibe-check-ml 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for vibe_check_ml-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.