> ## Documentation Index
> Fetch the complete documentation index at: https://docs.priorlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with TabPFN in minutes.

<Card title="Try TabPFN on your data" icon="hat-wizard" horizontal href="https://ux.priorlabs.ai/playground">
  Get predictions from our most advanced model, TabPFN-3-Plus, no setup required.
</Card>

## How to Use TabPFN

TabPFN can be used in two ways, depending on your workflow and compute setup. Use the API for our hosted service and for production use. For testing and if you have GPUs, install the open-source package from Hugging Face.

<div className="table-container-dc3e57e5">
  | OSS Package                         | API Access                                       |
  | ----------------------------------- | ------------------------------------------------ |
  | Full control, local inference       | Managed infrastructure, no setup                 |
  | Requires GPU, Python and PyTorch    | Only Internet Access Needed, Python not required |
  | Best for research & experimentation | Best for production & teams                      |
</div>

#### OSS Package

Recommended for researchers, ML practitioners, and engineers with GPU availability. TabPFN is available as an open-source Python package on [GitHub](https://github.com/PriorLabs/TabPFN) with the checkpoint for non-commercial use hosted on [HuggingFace](https://huggingface.co/Prior-Labs/tabpfn_3). It provides the model locally, giving you full control over your data and experimentation.

```bash theme={null}
pip install tabpfn
```

To get access to the latest features and our [TabPFN-3](/models#tabpfn-3) model, please upgrade the package to the latest version:

```bash theme={null}
pip install --upgrade tabpfn
```

<Card title="GitHub" icon="github" horizontal href="https://github.com/PriorLabs/tabpfn">
  Check out our TabPFN open-source GitHub repository.
</Card>

Use the [TabPFNClassifier](https://github.com/PriorLabs/tabpfn/blob/main/src/tabpfn/classifier.py) just like any scikit-learn estimator:

```python theme={null}
from tabpfn import TabPFNClassifier
model = TabPFNClassifier()
model.fit(X_train, y_train)
preds = model.predict(X_test)
```

<Warning>
  The first time you use the model, a browser window will open for you to log in and accept the model license. For more information, see the [detailed instructions](/how-to-access-gated-models).
</Warning>

<Note>
  GPU recommended (e.g., NVIDIA T4 at minimum) or A100/H100 for optimal inference speed.
</Note>

#### TabPFN API

Recommended for data teams and developers who want TabPFN’s performance **without managing infrastructure**. The Prior Labs API provides cloud-hosted access to TabPFN and manages GPU compute, scaling, and model versioning. You can use it either through a REST API or the Python SDK.

#### Using the Python SDK (API Client)

```bash theme={null}
pip install tabpfn-client
```

<Card title="GitHub" icon="github" horizontal href="https://github.com/PriorLabs/tabpfn-client">
  Check out our `tabpfn-client` open-source GitHub repository for a detailed getting-started guide and examples.
</Card>

Instantiate the hosted [TabPFNClassifier](https://github.com/PriorLabs/tabpfn-client/blob/main/tabpfn_client/estimator.py) for API-backed predictions:

<CodeGroup>
  ```python Classification theme={null}
  from tabpfn_client import TabPFNClassifier

  # Use TabPFN like any scikit-learn model
  model = TabPFNClassifier()
  model.fit(X_train, y_train)

  # Get predictions
  preds = model.predict(X_test)
  ```

  ```python Regression theme={null}
  from tabpfn_client import TabPFNRegressor

  # Use TabPFN like any scikit-learn model
  model = TabPFNRegressor()
  model.fit(X_train, y_train)

  # Get predictions
  preds = model.predict(X_test)
  ```
</CodeGroup>

##### Authentication

To authenticate you can run a prediction, which will prompt you to sign in if needed. To log in programmatically, follow these steps:

```python theme={null}
import tabpfn_client
token = tabpfn_client.get_access_token()
```

To log in on another machine using your access token and skip the interactive flow, use:

```python theme={null}
tabpfn_client.set_access_token(token)
```

#### Using the REST API

<Warning>
  You must **sign up and generate an API key** before making any requests. Requests without valid authentication headers will be rejected. For more information, visit the [API Reference](/api-reference/getting-started).
</Warning>

<Note>
  The `/v1/fit` and `/v1/predict` multipart endpoints used in this quickstart will remain available for a short period of time. New integrations should use the `/tabpfn/*` JSON flow — see [API getting started](/api-reference/getting-started) for the full walkthrough.
</Note>

First, define your dataset paths and authentication details. This allows you to reuse them across fit and predict calls.

```python theme={null}
import os, json, requests

# Define your file paths
train_path = "train.csv"   # path to your training dataset
test_path = "test.csv"     # path to your test dataset

# Get your API key from the environment
api_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.

<CodeGroup>
  ```python Classification theme={null}
  payload = {"task": "classification"}
  files = {
      "data": (None, json.dumps(payload), "application/json"),
      "dataset_file": (train_path, open(train_path, "rb")),
  }
  fit_response = requests.post(
      "https://api.priorlabs.ai/v1/fit",
      headers=headers,
      files=files,
  )
  model_id = fit_response.json().get("model_id")
  print(f"☑️ Model trained: {model_id}")
  ```

  ```python Regression theme={null}
  payload = {"task": "regression"}
  files = {
      "data": (None, json.dumps(payload), "application/json"),
      "dataset_file": (train_path, open(train_path, "rb")),
  }
  fit_response = requests.post(
      "https://api.priorlabs.ai/v1/fit",
      headers=headers,
      files=files,
  )
  model_id = fit_response.json().get("model_id")
  print(f"☑️ Model trained: {model_id}")
  ```
</CodeGroup>

Once fitted, you can send your test dataset to the `/v1/predict` endpoint using the returned `model_id`. You’ll receive predictions and/or probabilities in JSON format.

<CodeGroup>
  ```python Classification theme={null}
  payload = {
      "task": "classification",
      "model_id": model_id,
      "params": {
        "output_type": "preds"  # choose 'probas' for returning probabilities
      }
  }
  files = {
      "data": (None, json.dumps(payload), "application/json"),
      "dataset_file": (test_path, open(test_path, "rb")),
  }
  predict_response = requests.post(
      "https://api.priorlabs.ai/v1/predict",
      headers=headers,
      files=files,
  )
  print("☑️ Predictions:")
  print(json.dumps(predict_response.json(), indent=2))
  ```

  ```python Regression theme={null}
  payload = {
      "task": "regression",
      "model_id": model_id,
      "params": {
        "output_type": "mean"
      }
  }
  files = {
      "data": (None, json.dumps(payload), "application/json"),
      "dataset_file": (test_path, open(test_path, "rb")),
  }
  predict_response = requests.post(
      "https://api.priorlabs.ai/v1/predict",
      headers=headers,
      files=files,
  )
  print("☑️ Predictions:")
  print(json.dumps(predict_response.json(), indent=2))
  ```
</CodeGroup>

<CardGroup cols={1}>
  <Card title="API Reference" icon="book" horizontal href="/api-reference/getting-started">
    You can follow the step-by-step onboarding instructions in the [API Reference](/api-reference/getting-started), which also includes detailed endpoint descriptions and authentication examples.
  </Card>
</CardGroup>

## Selecting the model version

By default you'll get the latest TabPFN model. However, you can also specify a particular version.

See the details of the [available models](/models).

### OSS Package

1. Ensure your installation is up to date: `pip install -U tabpfn`
2. Instantiate the classifier or regressor:

```python theme={null}
from tabpfn import TabPFNClassifier, TabPFNRegressor
from tabpfn.constants import ModelVersion

# Set the version of the TabPFNClassifier to 2.6 instead of using the default 3
classifier = TabPFNClassifier.create_default_for_version(ModelVersion.V2_6)

# Set the version of the TabPFNRegressor to 2.6 instead of using the default 3
regressor = TabPFNRegressor.create_default_for_version(ModelVersion.V2_6)
```

### API via Python SDK

1. Ensure your installation is up to date: `pip install -U tabpfn-client`
2. Instantiate the classifier or regressor:

<CodeGroup>
  ```python title="Classifier" theme={null}
  from tabpfn_client.estimator import TabPFNClassifier
  from tabpfn_client.constants import ModelVersion

  # Set the version of the TabPFNClassifier to 2.6 instead of using the default 3
  classifier = TabPFNClassifier.get_default_for_version(ModelVersion.V2_6)
  ```

  ```python title="Regressor" theme={null}
  from tabpfn_client.estimator import TabPFNRegressor
  from tabpfn_client.constants import ModelVersion

  # Set the version of the TabPFNRegressor to 2.6 instead of using the default 3
  regressor = TabPFNRegressor.get_default_for_version(ModelVersion.V2_6)
  ```
</CodeGroup>

Alternatively, a variety of models can be selected using the `model_path` option:

```python theme={null}
from tabpfn_client import TabPFNClassifier

# View the models available
print(TabPFNClassifier().list_available_models())

# Create a classifier or regressor using a particular model
classifier = TabPFNClassifier(model_path="v2.5_real")
```

### API via REST

The model is selected using the `model_path` argument in the payload. The default model paths are as follows:

<div className="table-container-nowrap">
  |                | TabPFN-3                               | TabPFN-2.6                                 | TabPFNv2                                       |
  | -------------- | -------------------------------------- | ------------------------------------------ | ---------------------------------------------- |
  | Classification | `tabpfn-v3-classifier-v3_default.ckpt` | `tabpfn-v2.6-classifier-v2.6_default.ckpt` | `tabpfn-v2-classifier-finetuned-zk73skhh.ckpt` |
  | Regression     | `tabpfn-v3-regressor-v3_default.ckpt`  | `tabpfn-v2.6-regressor-v2.6_default.ckpt`  | `tabpfn-v2-regressor.ckpt`                     |
</div>

For example, the payload to specify the TabPFN-3 regression model is

```json theme={null}
{
	"task": "regression",
	"config": {
    "model_path": "tabpfn-v3-regressor-v3_default.ckpt"
  }
}
```

The TabPFN (v1) model is only available through the OSS package, via the [tag on GitHub](https://github.com/PriorLabs/TabPFN/releases/tag/v1.0.0).

<Card title="FAQ" icon="question-circle" horizontal href="/faq">
  Have questions? Check out the FAQ for answers to common topics about GPUs, limits, API usage, and more.
</Card>
