Skip to main content

ZeroGrad: one Python interface to tabular foundation models

PyPI CI License: Apache 2.0 Open in Colab

Tabular foundation models

The usual way to predict something from a table (churn, fraud, default, demand) is to train a model for that problem: pick an algorithm, tune it, validate it, retrain it when the data changes.

Tabular foundation models work differently. They are pretrained once, on millions of synthetic datasets, to learn in context: you give them your labeled rows as context and they predict new rows in a single forward pass, with no training and no hyperparameters. On small and medium tables they are competitive with tuned gradient boosting.

Several research groups have released them: TabPFN (Prior Labs), TabICL (Inria), Mitra (Amazon), TabDPT (Layer 6) and others. Each comes with its own package, checkpoints, preprocessing and license.

What ZeroGrad does

ZeroGrad puts them behind one interface. The same two calls, create and predict, work with every model, on your machine or on the ZeroGrad platform. On top of that:

  • A championship instead of a guess. Which model is best depends on the data. ZeroGrad scores every model on the same holdout of your rows and keeps the best one as the champion, with the comparison in a table.
  • Licenses you can see. Some models allow commercial use and some do not. zerograd.list_models() shows each license and where the weights come from; non-commercial models stay off unless you enable them by name.
  • Local or cloud, same code. Locally, nothing leaves your machine. With remote=True the same capability runs on the platform, with versions, scheduled championships, monitoring and batch pipelines.

Quickstart

pip install zerograd
from zerograd import ZeroGrad

zg = ZeroGrad()                                        # local: runs on your machine
cap = zg.create("churn", examples=history, target="churned")
cap.evaluation                                         # every model on the same holdout; the champion is marked
cap.predict(new_customers)                             # prediction, score and probability per class

A ZeroGrad championship in the terminal

Open source under Apache 2.0. Try it without installing anything, in Colab:

Notebook What it shows
Six use cases The whole SDK in one run: churn, house prices, cross-validation and thresholds, anomalies, clustering, and outcomes on the platform with a key Open in Colab
Quickstart Model catalog, a championship on breast cancer data, predictions, saving, and a context curve on Adult Open in Colab
Titanic A championship you check against your own holdout, one-row predictions, how much history you need, multiclass Open in Colab
Evaluate and decide Cross-validation at random, by customer and by date, a threshold by the cost of each mistake, column importance, scikit-learn Open in Colab
Without a target Anomalies with the columns why, imputation, synthetic rows scored by detection AUC, clustering with profiles Open in Colab

Install

pip install zerograd                  # local engine with TabPFN v2 and TabICLv2
pip install "zerograd[all]"           # adds Mitra-v2 and TabDPT

Python 3.10+. A GPU helps but is not required: on CPU, histories up to a few thousand rows take seconds to minutes. Weights download from each model's official Hugging Face repository the first time you use it and are cached there (HF_HOME); ZeroGrad hosts none. Importing zerograd or building ZeroGrad() downloads nothing.

zerograd.download(["tabpfn-v2"])          # fetch now instead of on first use, e.g. before a demo without wifi
zerograd.cached_weights()                 # what is on disk, how big, and whether ZeroGrad downloaded it
zerograd.remove_weights()                 # delete what ZeroGrad downloaded; the next run fetches it again
zerograd.config(auto_remove_weights=True) # or ZEROGRAD_AUTO_REMOVE_WEIGHTS=1: delete this session's downloads at exit

ZeroGrad keeps a list of the files it downloaded, so remove_weights never touches weights another project put in your Hugging Face cache. With auto-remove on, the files go when the Python process ends normally (a script finishing, a notebook kernel shutting down or restarting), not if it is killed.

What models are there?

import zerograd

zerograd.list_models()                                  # every model: tasks, license, commercial use, installed
zerograd.list_models(task="classification", commercial=True)
zerograd.list_tasks()                                   # every task and which models do it
zerograd.list_models().to_frame()                       # as a DataFrame

In a notebook these render as tables with a badge for commercial and non-commercial use. In this version:

Model Name License Commercial use Default
TabPFN v2 tabpfn-v2 Prior Labs License (Apache 2.0 + attribution) yes yes
TabICLv2 tabicl-v2 BSD-3-Clause yes yes
Mitra-v2 mitra-v2 Apache 2.0 yes yes, with pip install "zerograd[mitra]"
TabDPT tabdpt Apache 2.0 yes yes, with pip install "zerograd[tabdpt]"
Mitra mitra Apache 2.0 yes by name
FoMo-0D fomo-0d MIT yes anomaly detection
ZEUS zeus Apache 2.0 yes clustering

The full list, with sources and the models that are off by default, is in MODELS.md. This version runs classification (binary and multiclass, up to 10 classes) and regression (locally, with TabPFN v2, TabICLv2 and TabDPT), plus four tasks with no target: anomaly detection, imputation, synthetic data and clustering. zerograd.list_tasks() shows which models run each task.

Benchmark

We ran 12 OpenML classification datasets and 6 regression datasets, 3 seeds each. The champion is picked on the training rows only, and every number below comes from a 20% test split that nothing saw during selection. The baseline is scikit-learn's HistGradientBoosting with default settings, and regression also gets Ridge as a linear baseline.

champion against HistGradientBoosting (wins / ties / losses)
ROC AUC 11 / 0 / 1 (mean 0.894 against 0.866)
Log loss 12 / 0 / 0 (0.323 against 0.454)
Brier score 12 / 0 / 0
Accuracy 10 / 1 / 1
Regression RMSE 6 / 0 / 0 (and 6 / 0 / 0 against Ridge)

The one loss is churn, by 0.004 of ROC AUC: TabPFN v2 alone would have won it, but the championship picked another model on the training rows. Per-dataset tables for every model are in benchmarks/RESULTS.md, and python benchmarks/run.py reproduces them.

What the SDK can do

Everything below is explained, with code, in the docs.

  • Championship: every model scored on the same holdout of your rows, with the champion and baselines in one table.
  • Predictions: a DataFrame or a single row in, the prediction, score and probabilities out.
  • Classification and regression: binary and multiclass (up to 10 classes), or numeric targets, picked automatically.
  • Context size: find how many rows of history you need, trading a little quality for much faster predictions.
  • Evaluation: cross-validation at random, by group or by time, thresholds chosen by the cost of each mistake, and column importance.
  • scikit-learn: ZeroGradClassifier and ZeroGradRegressor work in pipelines, grid search and cross_val_score.
  • No target: anomaly detection with the columns why, imputation, synthetic data and clustering.
  • Privacy: find and drop sensitive columns, or pseudonymize them with a local vault, before anything leaves your machine.
  • Save and open: cap.save() writes one file and zerograd.load() opens it again.
  • Bring your own model: plug any model into the championship with zerograd.register_model.
  • The ZeroGrad platform: with remote=True the same code runs on the platform, with versions, scheduled championships, monitoring and batch pipelines.

Licenses and attribution

The SDK is Apache 2.0. Each model has its own license, shown by zerograd.list_models(), and you are responsible for complying with it (TERMS.md). If you build a product with TabPFN v2, its license asks you to show "Built with PriorLabs-TabPFN"; cap.attribution tells you when the champion needs it.

Some newer models are released under non-commercial licenses. They are off by default, can be enabled one by one by name for research and evaluation, and never run on the ZeroGrad platform. See MODELS.md and TERMS.md.

Development

pip install -e ".[dev]"
pytest                                        # fast tests, no models, no network
ZEROGRAD_REAL_MODELS=1 pytest tests/test_real_models.py   # the real models (downloads weights)

Security

See SECURITY.md. Releases are published from GitHub Actions with PyPI trusted publishing.

License

Apache License 2.0. See LICENSE and NOTICE. The models have their own licenses: MODELS.md.

Metadata

Release files for zerograd 0.2.2

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

Source distribution (sdist)

Source distribution for zerograd 0.2.2
File Size Uploaded Provenance Actions
zerograd-0.2.2.tar.gz 135.6 kB With provenance Details for zerograd-0.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zerograd 0.2.2
File Interpreter ABI Platform Actions
zerograd-0.2.2-py3-none-any.whl Python 3 none any Details for zerograd-0.2.2-py3-none-any.whl

Total release size: 269.7 kB

Release files / zerograd-0.2.2.tar.gz

Download URL zerograd-0.2.2.tar.gz
Size 135.6 kB
Tags Source
SHA-256 checksum
How to use checksums
86645d235165841027d4304caf5159d40034af63c5a7aade1eaad964fbb760e8
BLAKE2b-256 checksum
How to use checksums
b765cfce7c2a85eb256b709ac9109e7cf4d5640eeb05e8630ee4db33f935f4f3
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 14, 2026.

Transparency log

Release files / zerograd-0.2.2-py3-none-any.whl

Download URL zerograd-0.2.2-py3-none-any.whl
Size 134.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ada8b163284cc0ddd59f0c3da096f7f3ed86e495c27362ec2ed93ff8dfaf2a38
BLAKE2b-256 checksum
How to use checksums
2b159782e2a78246c50daae1cc3f3969969f4eb120cbd0038bc76bc777037f3c
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 14, 2026.

Transparency log

Security for zerograd 0.2.2

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 zerograd-0.2.2.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 14, 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.

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