> ## 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.

> ## Agent Instructions
> TabPFN-3 and later versions support up to 1,000,000 rows, subject to feature count and checkpoint/API limits.
> For large datasets, use per-estimator subsampling, e.g. inference_config={"SUBSAMPLE_SAMPLES": 100_000}, in TabPFNClassifier or TabPFNRegressor from tabpfn or tabpfn_client.
> Pass raw pandas DataFrames to fit and predict. Categorical strings/categories, raw text, and missing feature values are handled automatically; no manual integer/one-hot encoding, imputation, scaling, or outlier removal is needed.

# Model selection and persistence

> Select model versions and save or restore a hosted classifier.

> [!NOTE]
>
> Looking for usage documentation? Check out [Classification](https://docs.priorlabs.ai/capabilities/classification.md) and [KV cache](https://docs.priorlabs.ai/capabilities/kv-cache.md).

## `TabPFNClassifier.list_available_models`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/estimator.py#L102)

Return the model names accepted as `model_path`.

```python theme={null}
TabPFNClassifier.list_available_models() -> list[str]
```

**Returns**

| Type | Description |
| - | - |
| `list[str]` | — |

***

## `TabPFNClassifier.create_default_for_version`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/estimator.py#L107)

Construct an estimator that uses the given version of the model.

Any kwargs will override the default settings, except for `model_path`.

```python theme={null}
TabPFNClassifier.create_default_for_version(
    version: ModelVersion | str,
    **overrides,
) -> Self
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `version` | `ModelVersion \| str` | Required | The model version to use. |
| `**overrides` | — [`TabPFNClassifier` options](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/configuration#constructor) | — | Constructor arguments other than `model_path`. |

**Returns**

| Type | Description |
| - | - |
| `Self` | The constructed estimator. |

**Raises**

`ValueError`

If `version` is not a known model version.

***

## `TabPFNClassifier.save_model`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/persistence.py#L220)

Save the fitted model so it can be loaded later without re-fitting.

The fit itself lives on the TabPFN server; what is saved is a small,
human-readable record: the id the server assigned to the fit
(`model_id_`), the estimator's hyperparameters, a classifier's class
labels and the training-set size. No training data is included, nor
`api_mode` and `client_options`, which describe how the client talks to
the server: the loading process sets its own.

[`load_model()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/model-selection-and-persistence#load-model) turns the record back into a fitted estimator, in a
later run or on another machine. Fitted models are only visible to the
account that created them, so the loading process has to authenticate
with the same account, and they stay usable for as long as the training
data remains on the server (see [`UserDataClient`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/user-data#user-data-client) to delete it).

A model [`submit_fit()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#submit-fit) left pending is saved too, as a pending fit, so
that a later run can load it and [`wait_for_fit()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#wait-for-fit). So is a pending
prediction, one [`submit_predict()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#submit-predict) started or [`predict()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#predict) stopped
waiting for: a later run can load the model and [`wait_for_predict()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#wait-for-predict),
for at least a day after the prediction completes, while the server
keeps its result.

```python theme={null}
TabPFNClassifier.save_model(
    path: str | Path | None = None,
) -> dict[str, Any]
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `path` | `str \| Path \| None` | `None` | Where to write the record as JSON. Nothing is written when omitted. |

**Returns**

| Type | Description |
| - | - |
| `dict[str, Any]` | The record as a JSON-serialisable dict, whether or not `path` was given, so it can also be kept elsewhere (a database, an experiment tracker) and handed to [`load_model()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/model-selection-and-persistence#load-model) directly. |

**Raises**

`NotFittedError`

If the model has no fit, completed or pending.

***

## `TabPFNClassifier.load_model`

[ View source ](https://github.com/PriorLabs/tabpfn-client/blob/ce678cec44dc715f4d835a44990a8f5f115b7acc/src/tabpfn_client/persistence.py#L279)

Re-create a fitted estimator from a record written by [`save_model()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/model-selection-and-persistence#save-model).

The estimator comes back with the saved hyperparameters and fitted
state, ready to [`predict()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#predict) without calling [`fit()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#fit), and with the
default `api_mode` and `client_options`: set them on the loaded
estimator to change them. A record from tabpfn-client 0.6 that holds
`api_mode` loads too, without it. No request is made
here; the first [`predict()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#predict) authenticates (like [`fit()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#fit) would) and
raises [`FittedModelNotFoundError`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/exceptions#fittedmodelnotfounderror) if the server no longer has the model.

A record of a fit that was still pending when it was saved comes back
pending, as [`submit_fit()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#submit-fit) left it: call [`wait_for_fit()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#wait-for-fit) before
[`predict()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#predict). A record that holds a pending prediction comes back
holding it, for [`wait_for_predict()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/fitting-and-prediction#wait-for-predict).

```python theme={null}
TabPFNClassifier.load_model(
    source: str | Path | dict[str, Any],
) -> Self
```

**Parameters**

| Parameter | Type | Default | Description |
| - | - | - | - |
| `source` | `str \| Path \| dict[str, Any]` | Required | The path of a file written by `save_model(path)`, or the dict it returned. |

**Returns**

| Type | Description |
| - | - |
| `Self` | A fitted estimator of this class, or a pending one if the record holds a pending fit. |

**Raises**

`ValueError`

If `source` is not a record written by [`save_model()`](https://docs.priorlabs.ai/api-reference/python/tabpfn-client/classifier/model-selection-and-persistence#save-model),
holds a model of the other task (a regression model loaded into
a classifier), or has parameters this class does not accept,
for instance because a newer tabpfn-client saved it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.