AI

Predicting tabular data with SAP-RPT-1 over the REST API

Boidra Expert4 min read

Most foundation models generate text. SAP-RPT-1 is different: it is a foundation model built for tabular data. You hand it a table with a missing value marked as [PREDICT], and it fills that value in, whether the task is regression or classification. Think of it as a general-purpose predictor that works directly on rows and columns without you training a bespoke model.

This post shows how to call SAP-RPT-1 through its REST API: what you need in place, how authorization works, the request payloads for both row-based and column-based input, and the current limits to keep in mind.

Prerequisites

Deploying the SAP-RPT-1 model

First, confirm which foundation models exist in your AI Core instance. You can list them with:

GET {{AI-API-URL}}/v2/lm/scenarios/foundation-models/models
Listing foundation models in SAP AI Core
Foundation models available in AI Core

If you have your own AI Core instance, you can deploy the RPT-1 model and use the endpoints below. If you just want to experiment without deploying anything, SAP offers a hosted SAP-RPT-1 playground at rpt.cloud.sap.

Authorization

Requests need a bearer token. You can use a token generated from the SAP-RPT-1 playground or one you have generated yourself for your deployment.

Inferencing over the REST API

Reference: Example payloads for inferencing SAP-RPT-1

Limitations

Keep your input within these bounds:

Constraint Limit
Maximum rows 2,073 rows per request
Maximum columns 50 columns per request
Maximum cell length 1,000 characters
Maximum column name length 100 characters

Endpoint

POST {{$DEPLOYMENT_URL}}/api/predict

Headers

Header Value
Authorization Bearer $AUTH_TOKEN
AI-Resource-Group Your resource group
$DEPLOYMENT_URL The deployment URL for your model

How prediction works

You mark the cell you want predicted with the placeholder [PREDICT]. Here is an example table where the target cell sits in COLUMN3, row 6:

ID COLUMN1 COLUMN2 COLUMN3
1 dummy1_1 dummy1_2 dummy1_3
2 dummy2_1 dummy2_2 dummy2_3
3 dummy3_1 dummy3_2 dummy3_3
4 dummy4_1 dummy4_2 dummy4_3
5 dummy5_1 dummy5_2 dummy5_3
6 dummy6_1 dummy6_2 [PREDICT]
7 dummy7_1 dummy7_2 dummy7_3
8 dummy8_1 dummy8_2 dummy8_3

The API accepts your table in one of two shapes: by rows or by columns.

Request body - by rows (regression)

Each record is an object. The prediction_config declares which column holds the target, the placeholder to look for, and the task type.

{
  "prediction_config": {
    "target_columns": [
      {
        "name": "COLUMN3",
        "prediction_placeholder": "[PREDICT]",
        "task_type": "regression"
      }
    ]
  },
  "index_column": "ID",
  "rows": [
    { "ID": 1, "COLUMN1": "dummy1_1", "COLUMN2": "dummy1_2", "COLUMN3": "dummy1_3" },
    { "ID": 2, "COLUMN1": "dummy2_1", "COLUMN2": "dummy2_2", "COLUMN3": "dummy2_3" },
    { "ID": 3, "COLUMN1": "dummy3_1", "COLUMN2": "dummy3_2", "COLUMN3": "dummy3_3" },
    { "ID": 4, "COLUMN1": "dummy4_1", "COLUMN2": "dummy4_2", "COLUMN3": "dummy4_3" },
    { "ID": 5, "COLUMN1": "dummy5_1", "COLUMN2": "dummy5_2", "COLUMN3": "dummy5_3" },
    { "ID": 6, "COLUMN1": "dummy6_1", "COLUMN2": "dummy6_2", "COLUMN3": "[PREDICT]" },
    { "ID": 7, "COLUMN1": "dummy7_1", "COLUMN2": "dummy7_2", "COLUMN3": "dummy7_3" },
    { "ID": 8, "COLUMN1": "dummy8_1", "COLUMN2": "dummy8_2", "COLUMN3": "dummy8_3" }
  ],
  "data_schema": {
    "ID":      { "dtype": "string" },
    "COLUMN1": { "dtype": "string" },
    "COLUMN2": { "dtype": "string" },
    "COLUMN3": { "dtype": "string" }
  }
}
SAP-RPT-1 prediction by rows response
Prediction response for the by-rows payload

A note on confidence: with this synthetic, uncorrelated dummy data the response comes back with a NULL confidence - the model has nothing meaningful to latch onto, so it cannot express confidence in the prediction. On real data with genuine relationships between columns you would expect a confidence value alongside the prediction.

Request body - by columns (classification)

Instead of a list of records, you pass each column as an array of values. Note the switch to "task_type": "classification" here.

{
  "prediction_config": {
    "target_columns": [
      {
        "name": "COLUMN3",
        "prediction_placeholder": "[PREDICT]",
        "task_type": "classification"
      }
    ]
  },
  "index_column": "ID",
  "columns": {
    "ID": [1, 2, 3, 4, 5, 6, 7, 8],
    "COLUMN1": [
      "dummy1_1", "dummy2_1", "dummy3_1", "dummy4_1",
      "dummy5_1", "dummy6_1", "dummy7_1", "dummy8_1"
    ],
    "COLUMN2": [
      "dummy1_2", "dummy2_2", "dummy3_2", "dummy4_2",
      "dummy5_2", "dummy6_2", "dummy7_2", "dummy8_2"
    ],
    "COLUMN3": [
      "dummy1_3", "dummy2_3", "dummy3_3", "dummy4_3",
      "dummy5_3", "[PREDICT]", "dummy7_3", "dummy8_3"
    ]
  },
  "data_schema": {
    "COLUMN1": { "dtype": "string" },
    "COLUMN2": { "dtype": "string" },
    "COLUMN3": { "dtype": "string" }
  }
}

Request body - Parquet file

SAP-RPT-1 also supports Parquet-based input for larger datasets. (Coming soon - this section is a work in progress.)

Wrapping up

SAP-RPT-1 is a genuinely different kind of foundation model: point it at a table, mark the gaps with [PREDICT], and it fills them, with no feature engineering and no training loop. The REST API gives you two equally valid ways to send data (by rows or by columns), and switching between regression and classification is just a field in prediction_config.

Start in the playground to get a feel for it, then move to your own AI Core deployment once you are ready to run predictions against real data, where those confidence scores actually start to mean something.

ShareXLinkedIn

Keep reading