Skip to main content

TabPFN-Rel

PyPI version Python versions License Documentation Discord

TabPFN-Rel applies TabPFN to prediction tasks over relational databases. It follows relationships between tables, builds features with Deep Feature Synthesis, and uses TabPFN to predict outcomes for entities such as customers or sellers.

Documentation · Olist cookbook · Technical report

Try the Olist notebook

The task predicts whether a seller active in the past 30 days will receive no orders in the next 30 days. You can also read the walkthrough in the docs or run the local script.

Installation

Requires Python 3.11 or 3.12. Choose a backend:

pip install "tabpfn-rel[api]"    # Hosted inference
# Or: pip install "tabpfn-rel[local]"  # Local inference; GPU recommended

For hosted inference, authenticate before fitting:

from tabpfn_client import init

init()

For local inference, follow the model access guide.

Run the example as a local script

Prefer a Python script to a notebook? The Olist example includes the same database schema and prediction task as YAML files, and reports held-out ROC-AUC. It runs on your machine with either hosted or local inference.

Download the data and run the script

Clone the repository, then download the data with the Kaggle CLI (requires a Kaggle account and configured credentials):

git clone https://github.com/PriorLabs/tabpfn-rel.git
cd tabpfn-rel
uvx kaggle datasets download -d olistbr/brazilian-ecommerce -p data/olist --unzip
uv sync --extra api --group cpu
uv run --no-sync python -c "from tabpfn_client import init; init()"
OMP_NUM_THREADS=1 uv run --no-sync python examples/olist_seller_churn.py

The default fits one configuration through the hosted API. Add --n-trials 3 to try temporal tuning, or --data-dir /path/to/olist to use an existing download. Hosted fitting and prediction consume API quota.

For local inference, install with uv sync --extra local and run the script with --backend local.

Predict on your own database

The Relational Predictive Interface (RPI) makes TabPFN-Rel easier to use on your own database: define a prediction task, then call fit and predict. RPI is provided by relarena-core, which is installed automatically with TabPFN-Rel.

Define your tables, keys and timestamps in a database YAML file, then define the target and temporal splits in a task YAML file. The task-definition guide describes these formats; the Olist example provides complete files to adapt.

from tabpfn_rel import PredictiveContext, PredictiveQuery, TabPFNRel

context = PredictiveContext.from_yaml("task.yaml", data_dir="data/")
model = TabPFNRel(model="client")
model.fit(context, n_trials=0)
query = PredictiveQuery(entities="all", at_timestamp="test_timestamp")
predictions = model.predict(query)

Use model="local" for local inference. n_trials=0 (the default) fits the default configuration; a positive budget enables temporal tuning. Pass seed and cache_dir to fit to control tuning randomness and feature caching. predict reuses that cache unless given another cache_dir.

model="client" uses TabPFN 3.5 with simple text processing; model="local" uses TabPFN 3.5 with native TF-IDF. Their explicit recipe selectors are:

Backend Selector
Hosted API, simple text client-2026-09-28
Local, native TF-IDF text local-2026-09-28

Prefix the selector with tabpfn-rel- to use it as a RelArena model ID. tabpfn-rel-client-latest and tabpfn-rel-local-latest are RelArena aliases for the current versions; results record the dated ID. To use the previous defaults, explicitly select model="client-2026-08-15" or model="local-2026-08-15".

Both query fields are required. Use at_timestamp="test_timestamp" for the context cutoff or an explicit date for another prediction anchor. The database remains frozen at the context cutoff, including for later anchors, to follow RelArena's fixed-snapshot evaluation protocol and prevent post-cutoff data from entering predictions. See RelArena's temporal-validation protocol.

To benchmark TabPFN-Rel against other methods, see RelArena.

Let a coding agent set it up

The relational-prediction agent skill guides Claude Code or Codex from raw tables and a plain-language question to a scored TabPFN-Rel task. The agent inspects the tables, prepares them without leaking future information, writes both YAML files, checks the labels and compares TabPFN-Rel with simple baselines. It asks you before it changes data or picks the task.

Claude Code:

/plugin marketplace add PriorLabs/tabpfn-rel
/plugin install tabpfn-rel@prior-labs

Codex:

codex plugin marketplace add PriorLabs/tabpfn-rel
codex plugin add tabpfn-rel@prior-labs

Then ask the agent a question about your data, for example "Which of these customers will stop ordering next month?". The skill runs in your Python environment and installs tabpfn-rel[api] and the RelArena baselines there.

Development

uv sync --locked --group cpu
OMP_NUM_THREADS=1 uv run --no-sync pytest
uv run --no-sync pre-commit run --all-files
uv build

Tests cover feature generation, context selection, temporal tuning and prediction without model downloads or hosted API calls.

Metadata

Release files for tabpfn-rel 0.0.6

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

Source distribution (sdist)

Source distribution for tabpfn-rel 0.0.6
File Size Uploaded Provenance
tabpfn_rel-0.0.6.tar.gz 24.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tabpfn-rel 0.0.6
File Interpreter ABI Platform
tabpfn_rel-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 49.9 kB

Release files / tabpfn_rel-0.0.6.tar.gz

Download URL tabpfn_rel-0.0.6.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b7f82589f078789d4c92548fc20261427b8d6712282631673652a5176757aa0e
BLAKE2b-256 checksum
How to use checksums
ca09d063b945f4774c0b7ce53858a7fd72892f491ba17eb84d348ec5e055f85e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Release files / tabpfn_rel-0.0.6-py3-none-any.whl

Download URL tabpfn_rel-0.0.6-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b712ed163e8d3032d70353db09b4027b22f168f9958498b7cd2e843febcb592
BLAKE2b-256 checksum
How to use checksums
3e0873b6ead89fd9884123d4875aa5ea1b7124431ea7c939122b08a03642dd27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.11

Security for tabpfn-rel 0.0.6

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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