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

# Microsoft Foundry

> Access TabPFN in your secure Azure environment.

<Note>
  This page describes the TabPFN-2.5 deployment on Azure AI Foundry. A TabPFN-3 listing is rolling out shortly — contact [sales@priorlabs.ai](mailto:sales@priorlabs.ai) if you need access in advance.
</Note>

Access TabPFN directly from Azure AI Foundry with Azure-native endpoints and authentication. Usage is billed through your Azure subscription and you are charged by Azure only for the compute resources needed to host TabPFN models.

## Prerequisites

* An active Azure subscription with access to [Azure AI Foundry](https://ai.azure.com/explore/models)
* Azure quota for VM SKUs with GPU
* TabPFN deployed as an endpoint in your Foundry project

<Note>
  For a full list of supported VM SKUs please visit the TabPFN Microsoft Foundry Model Card.
</Note>

## Getting Started

1. Navigate to the Azure AI Foundry [Model Catalog](https://ai.azure.com/explore/models)
2. Search for TabPFN and select [TabPFN-2.5](https://ai.azure.com/catalog/models/TabPFN-2.5)
3. Click **Use this model** and follow the guided setup
4. Once deployed, note your endpoint URL and API key from the deployment details page

<iframe className="w-full aspect-video rounded-xl" src="https://www.loom.com/embed/e87bcd53e66b419d897c9757f89a6913" loading="lazy" title="Setting up TabPFN on Azure AI Foundry" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

<Note>
  Microsoft Foundry hosts each TabPFN version as a separate model. When a new TabPFN version is released, it will appear as a distinct model in the catalog and must be deployed independently - existing deployments will not be updated automatically.
</Note>

## Usage Guide

TabPFN on Azure Foundry exposes a single `POST /predict` HTTP endpoint. You send training data, labels, and test data in one request and get predictions back immediately - without any model training.

First, make sure you have the installed the dependencies required for sending inference requests using an HTTP library. In this example, we use the `requests` Python package.

```bash theme={null}
pip install requests numpy pandas
```

## Examples

<Tabs>
  <Tab title="Class probabilities">
    Get a probability distribution over classes for each test row.

    ```python theme={null}
    import requests

    response = requests.post(
        "https://<your-endpoint>.<region>.inference.ml.azure.com/predict",
        headers={
            "Content-Type": "application/json",
            "Authorization": "Bearer <your-api-key>",
        },
        json={
            "task_config": {
                "task": "classification",
                "predict_params": {"output_type": "probas"},
            },
            "X_train": [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]],
            "y_train": [0, 1, 0],
            "X_test": [[2.0, 3.0], [4.0, 5.0]],
        },
    )

    result = response.json()
    print(result["prediction"])
    # [[0.12, 0.88], [0.55, 0.45]]
    ```

    `prediction` is a 2D array — one inner list per test row, one probability per class.
  </Tab>

  <Tab title="Class labels">
    Get a single predicted class label for each test row.

    ```python theme={null}
    import requests

    response = requests.post(
        "https://<your-endpoint>.<region>.inference.ml.azure.com/predict",
        headers={
            "Content-Type": "application/json",
            "Authorization": "Bearer <your-api-key>",
        },
        json={
            "task_config": {
                "task": "classification",
                "predict_params": {"output_type": "preds"},
            },
            "X_train": [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]],
            "y_train": [0, 1, 0],
            "X_test": [[2.0, 3.0], [4.0, 5.0]],
        },
    )

    result = response.json()
    print(result["prediction"])
    # [1, 0]
    ```

    `prediction` is a 1D array — one class per test row.
  </Tab>

  <Tab title="Regression">
    Get a single predicted value for each test row.

    ```python theme={null}
    import requests

    response = requests.post(
        "https://<your-endpoint>.<region>.inference.ml.azure.com/predict",
        headers={
            "Content-Type": "application/json",
            "Authorization": "Bearer <your-api-key>",
        },
        json={
            "task_config": {
                "task": "regression",
                "predict_params": {"output_type": "mean"},
            },
            "X_train": [[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]],
            "y_train": [10.0, 11.0, 9.5],
            "X_test": [[2.0, 3.0], [4.0, 5.0]],
        },
    )

    result = response.json()
    print(result["prediction"])
    # [10.2, 10.7]
    ```

    `prediction` is a 1D array if default `mean` output type is used — one prediction per test row.
  </Tab>
</Tabs>

### Endpoint

Authenticate using the **Primary key** from your deployment's page in Azure AI Foundry. To access the model settings, navigate to your TabPFN deployment in Azure AI Foundry:

1. Go to [Azure AI Foundry](https://ai.azure.com/build/deployments/model) and select the Foundry project where TabPFN was deployed.
2. In the left-hand menu, select **My assets** → **Models + Endpoints**.
3. Open the **Model deployments** tab and click on **TabPFN**.

![TabPFN Model Deployment](https://storage.googleapis.com/prior-labs-tabpfn-public/images/tabpfn_foundry_deployment.png)

```bash theme={null}
POST https://<your-endpoint>.<region>.inference.ml.azure.com/predict
Content-Type: application/json
Authorization: Bearer <your-api-key>
```

### Request

<ParamField body="X_train" type="number[][] | object" required>
  Training features. Accepts a row-oriented 2D array `[[f1, f2], [f1, f2], ...]`.
</ParamField>

<ParamField body="y_train" type="number[]" required>
  Training labels or targets. One value per training row.
</ParamField>

<ParamField body="X_test" type="number[][] | object" required>
  Test features to predict for. Same format as `X_train`, without the target.
</ParamField>

<ParamField body="task_config" type="object">
  Controls the model's behavior.

  <Expandable title="task_config fields">
    <ParamField body="task" type="string" required>
      `"classification"` or `"regression"`.
    </ParamField>

    <ParamField body="tabpfn_config" type="object">
      Model parameters. Safe to omit — defaults are applied server-side.
      See the source for supported fields:
      [classification](https://github.com/PriorLabs/TabPFN/blob/main/src/tabpfn/classifier.py#L203),
      [regression](https://github.com/PriorLabs/TabPFN/blob/main/src/tabpfn/regressor.py#L211).
    </ParamField>

    <ParamField body="predict_params" type="object">
      Controls output shape. See [Output types](#output-types) below.
    </ParamField>
  </Expandable>
</ParamField>

## Output types

### Classification

TabPFN natively outputs class probabilities, giving you calibrated uncertainty estimates from a single model with no extra configuration.

| Output type          | Shape        | Description                        |
| -------------------- | ------------ | ---------------------------------- |
| `probas` *(default)* | `number[][]` | One probability list per test row  |
| `preds`              | `number[]`   | Predicted class label per test row |

### Regression

TabPFN models can provide full predictive distribution rather than just point estimates, so you can extract quantiles or summary statistics with a single inference call.

| Output type        | Shape        | Description                                 |
| ------------------ | ------------ | ------------------------------------------- |
| `mean` *(default)* | `number[]`   | Predicted mean per test row                 |
| `median`           | `number[]`   | Predicted median per test row               |
| `mode`             | `number[]`   | Predicted mode per test row                 |
| `quantiles`        | `number[][]` | One list per quantile                       |
| `full`             | `object`     | All outputs (mean, median, quantiles, etc.) |
| `main`             | `object`     | Main outputs only                           |

***

## Errors

| Code  | Cause                                                                         |
| ----- | ----------------------------------------------------------------------------- |
| `400` | Missing required fields or invalid JSON                                       |
| `415` | Content-Type is not `application/json`                                        |
| `422` | Validation error — e.g. `y_train` has multiple columns, invalid `output_type` |
