Skip to main content

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

pip install "vibe-check-ml[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. To work on the code, clone the repository and run pip install -e ".[dev,viz]". The unrelated PyPI package vibecheck also installs a module named vibecheck, so do not install both in one environment.

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.

One test field before and after diffusion with the surrogate over it, and predicted against true test values

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, or value of a flag, 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.

True pressure field of the worst Darcy test sample Predicted pressure field of the same sample, on the same colour scale Percent error of the prediction for the same sample

Documentation

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

The current version, 0.1.1, was released on 2026-11-30. The public API may change before 1.0. See CHANGELOG.md.

Citing

Cite the archived software with doi:10.5281/zenodo.24697057, which covers every version; version 0.1.0 alone is doi:10.5281/zenodo.24697058. CITATION.cff holds the full citation.

License

MIT. See LICENSE.

Metadata

Release files for vibe-check-ml 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vibe-check-ml 0.1.1
File Size Uploaded Provenance Actions
vibe_check_ml-0.1.1.tar.gz 568.5 kB With provenance Details for vibe_check_ml-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vibe-check-ml 0.1.1
File Interpreter ABI Platform Actions
vibe_check_ml-0.1.1-py3-none-any.whl Python 3 none any Details for vibe_check_ml-0.1.1-py3-none-any.whl

Total release size: 628.5 kB

Release files / vibe_check_ml-0.1.1.tar.gz

Download URL vibe_check_ml-0.1.1.tar.gz
Size 568.5 kB
Tags Source
SHA-256 checksum
How to use checksums
01bbe9eb94bf535662fdec7c9a7a2ca6b630bc09ac7c0f4eb07dc51ec29e7f09
BLAKE2b-256 checksum
How to use checksums
ce75d7ed66877013d3b9fd06c0f12078cc7153ea9d911d15755c47db47b45405
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 log

Release files / vibe_check_ml-0.1.1-py3-none-any.whl

Download URL vibe_check_ml-0.1.1-py3-none-any.whl
Size 60.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6547a390edffe9845f3ee95fa859bad2a1c23eb6f8bcd11ce88b8efd6a79627e
BLAKE2b-256 checksum
How to use checksums
5b8af796dab70c0dc3c17535a8a43e25484625795d2a5ea1c72cbb34b873e994
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 log

Security for vibe-check-ml 0.1.1

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.

Select from 2 files

Attestation for vibe_check_ml-0.1.1.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 log

A 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page