Skip to main content
OpenMLAudit Banner

openml-audit

Because a model that works in your notebook is a ticking time bomb in prod.

Build Status License: MIT PyPI Version Python Versions


OpenMLAudit CLI Demo
(See examples/demo/demo.sh to reproduce this exact run locally)

The Problem

A model that looks fine in a notebook can still cause real damage in production. Amazon's recruiting model penalized resumes containing the word "women's". Zillow's Offers pricing model drifted out of step with the market and contributed to an $881M write-down. The EU AI Act and GDPR Article 22 now attach real fines to exactly this kind of failure.

Most monitoring tools are either heavy SaaS platforms that want you to upload your proprietary data, or academic Python wrappers that choke your inference latency to death.

OpenMLAudit is a local, open-source engine. It hooks into your PyTorch model at the C++ level so tensor capture happens off your main inference thread, and provides a dead-simple CLI to audit offline CSVs for bias, drift, and leakage.

How it compares

Feature openml-audit SaaS platforms (WhyLabs/Arthur) Academic tools (AIF360, Evidently)
Data Privacy 100% Local / On-prem Cloud / Data leaves your VPC Local
Overhead < 50µs (C++ Ring Buffer) Network latency Heavy Python overhead
Compliance Output EU AI Act / FDA SaMD Markdown Proprietary Dashboards JSON / HTML blobs
Pricing Free (MIT) $$$ Enterprise Free

What it actually does

  • Tensor hooking (optional) — a C++ PyTorch extension (csrc/tensor_capture.cpp) intercepts forward-pass tensors, detaches them from autograd, and hands them to a background thread through a bounded ring buffer. The device-to-host copy is synchronous (so GPU memory is freed immediately), but the analysis happens fully off-thread.
  • Drift detection — KS tests, Wasserstein distance, and a hardened PSI implementation (clamped bin edges, no silent out-of-range failures).
  • Fairness checks — demographic parity, equalized odds (via fairlearn), and the EEOC four-fifths rule. Fails loud if your selection rate is dangerously skewed.
  • Reproducibility — exact row-level data leakage checks using deterministic SHA-256 byte hashing, catching train/test contamination instantly.
  • Regulatory reporting — spits out a non-technical Markdown compliance report citing the EU AI Act, GDPR Art. 22, and FDA SaMD guidance.

Install

No bloated dependencies unless you want them. PyTorch is optional.

pip install openml-audit            # pure metrics, CLI, reports (no PyTorch needed)
pip install "openml-audit[torch]"   # + live tensor hooking; compiles the C++ extension
pip install "openml-audit[cli]"     # + PyYAML for config-file-driven runs

Note: If PyTorch is present during install, the C++ tensor-capture extension compiles automatically. Otherwise, it gracefully falls back to a thread-safe pure-Python queue.

Command line

You don't even need to touch Python to audit a model. Just point it at your CSVs.

# Bias: audit a CSV of model predictions against a protected attribute
openml-audit run --data predictions.csv --y-true label --y-pred pred --protected sex --bias --report

# Drift: compare a training reference against production traffic
openml-audit run --reference reference.csv --current production.csv --drift --report

# Train/test leakage check: find exact duplicate rows
openml-audit run --data train.csv --test-data test.csv --reproducibility

Python API (Live Monitoring)

If you need live production hooking, use the MonitorEngine:

import torch
import torch.nn as nn
from openml_audit import MonitorEngine

model = nn.Sequential(nn.Linear(128, 64), nn.ReLU(), nn.Linear(64, 1))

# Registers non-blocking forward hooks on the model
audit = MonitorEngine(model, framework="pytorch")

device = "cuda" if torch.cuda.is_available() else "cpu"
model = model.to(device)
inputs = torch.randn(32, 128, device=device)

# The hook grabs the tensor, copies it to host, and hands it to a background C++ queue
outputs = model(inputs) 

audit.cleanup()

Performance

We measured 10,000 forward passes with and without the monitor attached (benchmark.py).

The absolute overhead stays under 50µs per call. That's the threshold that actually matters for inference-serving latency budgets. Memory usage stays completely flat across the run.

[1] LATENCY OVERHEAD (10,000 forward passes)
+---------------+-----------+------------+---------------+--------------+
|    Metric     | Baseline  | Monitored  | Overhead (ms) | Overhead (%) |
+===============+===========+============+===============+==============+
| Mean Latency  | 0.0067 ms |  0.0436 ms |    +0.0369 ms |     +550.75% |
| p99 Latency   | 0.0140 ms |  0.0745 ms |    +0.0605 ms |     +432.14% |
+---------------+-----------+------------+---------------+--------------+

[2] MEMORY OVER 10,000+ ITERATIONS
  Memory stays flat across the run (RAM slope: 0.0326 MB per 1,000 iterations).

Case Study

We ran the bias checker against a real Logistic Regression model trained on the UCI Adult Census dataset. It immediately caught a 50%-vs-5% selection-rate gap and automatically generated a compliance report.

Read the walkthrough at docs/CASE_STUDY.md or run it yourself via python examples/case_study_adult_bias.py.


Open-source, MIT licensed, built for production use.

Release files for openml-audit 1.0.0

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

Source distribution (sdist)

Source distribution for openml-audit 1.0.0
File Size Uploaded
openml_audit-1.0.0.tar.gz 64.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openml-audit 1.0.0
File Interpreter ABI Platform
openml_audit-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 91.0 kB

Release files / openml_audit-1.0.0.tar.gz

Download URL openml_audit-1.0.0.tar.gz
Size 64.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6afe8c8b0a43875a1cbfcbd99b9d85cba5e43e7ec20b1ccb1dc16a1bc593eafc
BLAKE2b-256 checksum
How to use checksums
d69a292bc2fe5b3be1e937ee2494f6b197d04959d2f54409d4473bc61e0be6c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / openml_audit-1.0.0-py3-none-any.whl

Download URL openml_audit-1.0.0-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a34a40a43eeb42e62a5b634ef45ce8c7687ffff71dbb0410b131b800da11c7d8
BLAKE2b-256 checksum
How to use checksums
28c5936a3a4c107b50240d442fe35d23e5e4e149acf514aadfcacc6ee4bfe916
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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