TabPFN can be used in two ways - depending on your workflow and compute setup.Whether you’re experimenting locally, integrating into a pipeline, or deploying at scale, there’s a path that fits.
Best for: researchers, ML practitioners, and engineers with local GPU or cluster access.TabPFN is available as an open-source Python package on GitHub. It provides the full model locally, giving you complete control over inference and experimentation.
Copy
pip install tabpfn
Copy
from tabpfn import TabPFNClassifiermodel = TabPFNClassifier()model.fit(X_train, y_train)preds = model.predict(X_test)
GPU recommended (e.g., NVIDIA T4 at minimum) or A100/H100 for optimal inference speed.
Best for: data teams and developers who want TabPFN’s performance without managing infrastructure.The Prior Labs API provides cloud-hosted access to TabPFN-2.5 - we handle all GPU compute, scaling, and model versioning.You can use it either through a REST API or our Python SDK.
You must sign up and generate an API key before making any requests. Requests without valid authentication headers will be rejected.
First, define your dataset paths and authentication details. This allows you to reuse them across fit and predict calls.
Copy
import os, json, requests# Define your file pathstrain_path = "train.csv" # path to your training datasettest_path = "test.csv" # path to your test dataset# Get your API key from the environmentapi_key = os.getenv("PRIORLABS_API_KEY")headers = {"Authorization": f"Bearer {api_key}"}
Next, upload your training dataset to the /v1/fit endpoint. The API automatically preprocesses the data.
Once fitted your model using in-context learning, send your test dataset to the /v1/predict endpoint using the returned model_id. You’ll receive predictions and/or probabilities in JSON format.
import tabpfn_clientfrom tabpfn_client import TabPFNClassifier, TabPFNRegressor# Authenticate using your Prior Labs tokentabpfn_client.set_access_token("YOUR_API_KEY")# Use TabPFN like any scikit-learn modelmodel = TabPFNClassifier()model.fit(X_train, y_train)# Get predictionspreds = model.predict(X_test)