Skip to main content

Overview

TabPFN is a tabular foundation model that makes accurate predictions in a single forward pass - no dataset-specific training, no hyperparameter search, no separate model artifact per target variable. The promise: one registered model that handles both classification and regression across any tabular dataset.

Less Operational Complexity

Manage one model instead of many. No per-dataset training runs, no hyperparameter searches, no separate artifacts per outcome.

Higher Productivity

Use a single model for classification and regression across any tabular dataset - from a notebook or SQL ai_query().
By the end of this tutorial you will have:
  • Wrapped TabPFN as an MLflow PythonModel
  • Registered it to Unity Catalog with a champion alias
  • Tested it locally on classification and regression tasks
  • Run an end-to-end example on the Lending Club loan dataset
  • Deployed it to a GPU-accelerated Mosaic AI Model Serving endpoint
For the full list of supported TabPFN parameters (estimators, output types, configuration options) see the TabPFN GitHub repository. For broader context on TabPFN and Databricks, read the Databricks blog post.

Prerequisites

  • A Databricks workspace with Unity Catalog enabled
  • Access to a serverless GPU environment with at least an NVIDIA A10G GPU
  • A TabPFN token from Prior Labs
TabPFN runs inference via PyTorch, so a GPU significantly speeds up predictions - especially on larger datasets. In the notebook toolbar, select Serverless with a GPU-enabled instance (A10G or better). Serverless handles provisioning and scaling automatically.

Step 1: Install Dependencies

Run the following in your Databricks notebook cell:

Step 2: Configure Your TabPFN Token

TabPFN model weights are gated and require authentication. Store your token as a Databricks secret so it never lives in plain text in your notebook. Run these commands in the Databricks CLI:
Then reference the secret in your notebook:

Step 3: Define the Wrapper and Signature

The TabPFNWrapper is a custom mlflow.pyfunc.PythonModel. It is the heart of this integration and handles three concerns:
  • Dual-format input - accepts both raw Python objects (from notebooks) and JSON strings (from SQL ai_query())
  • Task routing - classification or regression, controlled by task_config
  • Flexible output - class labels, probabilities, or regression predictions based on output_type
All input columns use DataType.string so the same endpoint works from Python, REST, and SQL without any changes to the registered model. The _maybe_parse_json() helper transparently handles both formats at predict time.

Define the Model Signature

The model signature tells MLflow (and Unity Catalog) the expected input and output shapes. All columns are DataType.string to support both raw Python and JSON-serialized inputs from SQL ai_query().
The output_schema is required for Unity Catalog registration. Using DataType.string is the right choice here because the wrapper can return either a flat list (for preds) or a nested list (for probas/regression quantiles), and the serving layer serializes the result to JSON regardless.

Step 4: Register to Unity Catalog

Log the model with MLflow and register it under a fully qualified Unity Catalog path (catalog.schema.tabpfn). The input_example uses json.dumps() to match the all-string signature - the wrapper deserializes at predict time via _maybe_parse_json(). After registration, we tag the latest version with a "champion" alias. The serving endpoint references this alias, so you can promote future versions without touching the endpoint config.
Once logged, tag the latest version as champion:
Using the champion alias decouples your serving endpoint from version numbers. When you retrain or update TabPFN, simply reassign the alias - the endpoint continues to route requests without any configuration change.

Step 5: Test Locally

Before deploying, verify the registered model works end-to-end from the notebook. The same model handles both raw Python objects and JSON strings - just load it and call .predict().
The wrapper’s _maybe_parse_json() transparently handles both formats - no code changes required between calling from a notebook and calling from a REST endpoint.

Step 6: End-to-End Example - Lending Club Loan Data

Let’s run a real-world classification task: predicting loan default (Good vs Bad) on the Lending Club Q2 2018 dataset. This dataset ships with every Databricks workspace at /databricks-datasets/, so you can run this without any additional data download.

Load and Prepare the Data

Run Predictions

Pass the full dataset through the registered MLflow model in a single call. We request probas so we can compute ROC-AUC alongside accuracy and F1.

Evaluate Results

No fine-tuning, no feature engineering pipeline, no hyperparameter search - TabPFN fits and predicts in a single forward pass.

Step 7: Deploy to Mosaic AI Model Serving

Deploy the registered model to a GPU-accelerated serving endpoint. The TabPFN token is securely passed via Databricks Secrets - it is never stored in the endpoint configuration.
create_endpoint returns immediately and initializes the endpoint asynchronously. Monitor the status in your Databricks console under Servingtabpfn-endpoint.

Calling the Endpoint

Once the endpoint is live, you can reach it from Python, REST, or SQL:

How the Input Format Works

Understanding task_config is key to using the endpoint effectively. It controls both what TabPFN does and how it does it.

Output Types


Promoting a New Model Version

When you want to update the model (e.g. after a new TabPFN release), simply re-run the registration cell and reassign the alias. The endpoint keeps routing to champion with no configuration change needed.

Next Steps

TabPFN GitHub

Explore all supported parameters, estimator options, and output types.

Databricks Blog

Learn how TabPFN accelerates business transformation on Databricks.

MLflow PythonModel Docs

Understand the mlflow.pyfunc.PythonModel interface used by the wrapper.

Mosaic AI Model Serving

Configure autoscaling, traffic splitting, and monitoring for your endpoint.