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().- Wrapped TabPFN as an MLflow
PythonModel - Registered it to Unity Catalog with a
championalias - 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
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:Step 3: Define the Wrapper and Signature
TheTabPFNWrapper 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
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 areDataType.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.
champion:
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().
- Classification (raw Python)
- Classification (JSON strings)
- Regression
_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 requestprobas so we can compute ROC-AUC alongside accuracy and F1.
Evaluate Results
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 Serving → tabpfn-endpoint.Calling the Endpoint
Once the endpoint is live, you can reach it from Python, REST, or SQL:- Python (MLflow Deployments)
- REST API
- SQL (ai_query)
How the Input Format Works
Understandingtask_config is key to using the endpoint effectively. It controls both what TabPFN does and how it does it.
Output Types
- Classification
- Regression
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 tochampion 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.