Import the API collection into Bruno, Postman, or Insomnia to try all examples locally.
Download CollectionWhen you send more than 2,048 context rows to POST /api/predict and TCR routing is enabled on the server, SAP-RPT routes the request through the SAP AI Core Tabular Context Registry (TCR). Instead of the server reducing your data to fit the model, the full context is made available to TCR and TCR selects the context rows at source. When TCR routing is not enabled, large requests use the direct path and are downsampled in memory.
This lets you work with much larger datasets - up to 100,000 context rows - while letting TCR select the context rows at source.
API only: Large-dataset routing applies to the
POST /api/predictendpoint. Web UI uploads are capped at 2,048 rows, so they never reach this threshold.
Below 2,048 context rows, every row is sent to the model, so there is nothing to select. Above 2,048, the model can only read 2,048 context rows at a time, so a subset has to be chosen. There are two ways that subset can be chosen:
If you want to avoid random downsampling, keep your request on the TCR path (the default above 2,048 rows when TCR routing is enabled on the server) rather than forcing the direct path.
Routing is based on the number of context rows in your request:
| Context rows | Path |
|---|---|
| At or below 2,048 | Sent directly to the model - no selection needed. |
| Above 2,048 | Routed through TCR (when TCR routing is enabled on the server), which selects context at source. Otherwise the direct path is used and context is downsampled in memory. |
The 2,048-row value is the routing threshold. Query rows (rows containing [PREDICT]) are never counted toward this threshold and are never dropped.
You can override the automatic decision per request with the optional X-Predict-Route header:
| Header value | Behavior |
|---|---|
| (omitted) | Automatic routing based on context size (the default described above). |
tcr | Force the TCR path, even for small datasets. |
direct | Force the in-memory direct path, even for large datasets. |
Invalid values are rejected. See Prediction routing errors for the error codes.
When a request is routed through TCR, context selection happens at source rather than in the server, so the response reflects that:
samplingMetadata is omitted (it describes the direct prediction path).contextRows reports the fetched context count and the requested TCR selection settings. Requests that send context rows inline return only prediction and delay.TCR routing is a server-side configuration. The response shape reveals which path was taken: samplingMetadata is present on the direct path and omitted on the TCR path.
The TCR path returns two different response shapes depending on how you supply context:
| TCR request type | Response fields |
|---|---|
| Remote data source | prediction, delay, source, contextRows |
| Inline rows | prediction, delay only |
See Response Format for the full field descriptions.
Errors specific to the TCR path are listed under Large-dataset prediction errors. Errors from the X-Predict-Route header are listed under Prediction routing errors.
| Limit | Value |
|---|---|
| Routing threshold | 2,048 context rows |
| Max context rows accepted (input) | 100,000 |