Deploy TabPFN v2 | (Just Updated) Tabular Prediction API, No Training, API Key Pre-Set

TabPFN v2 tabular prediction API: classify and regress tables, no training

Deploy TabPFN v2 | (Just Updated) Tabular Prediction API, No Training, API Key Pre-Set

Just deployed

Deploy and Host TabPFN v2 (Tabular Prediction API) on Railway

A tabular prediction API classifies or forecasts values in a table over plain HTTP, with no model to train. This template serves TabPFN v2, Prior Labs' pretrained tabular foundation model, on CPU with PyTorch behind one authenticated HTTP API. The weights are inside the image, an API key is generated at deploy, and no GPU is needed.

Built with PriorLabs-TabPFN.

About Hosting TabPFN v2

TabPFN v2 is a transformer pretrained on millions of synthetic tables (Hollmann et al., Nature, January 2025). You hand it a small labelled table and the rows you want scored, and it answers in one forward pass: no training loop, no hyperparameters to tune, missing values and categorical columns handled for you. It suits tables of up to a few thousand rows, which is where gradient-boosted trees usually need tuning. This template runs Prior Labs' own tabpfn package (v10.2.0, the newest release) with the TabPFN-2 classifier and regressor checkpoints, behind a small FastAPI server.

POST /v1/predict takes JSON: task (classification or regression), X_train (a list of rows; each value a number, a string for a categorical column, or null), y_train (one target per row), X_test (the rows to score), and optionally quantiles (regression, for example [0.1, 0.5, 0.9]), n_estimators (1 to 16, default 4) and seed. Classification returns classes, predictions and a probabilities row per scored row; regression returns predictions and, when asked, a list per quantile. GET /v1/models lists the model and the limits in force. Every response carries X-Built-With: PriorLabs-TabPFN.

The weights are in the image, so nothing downloads at boot. /health answers 503 while the checkpoints load and warm, then 200 (about 3 seconds). One prediction runs at a time and up to 3 requests may wait; a fourth answers 429 with Retry-After: 30. A request that cannot finish within 240 seconds answers 504 before Railway's edge cuts the connection at about five minutes. Tables over 1,000 training rows, 1,000 scored rows, 100 columns, 120,000 cells or 10 classes answer 413 before any work is done. Data is held in memory for one request and never logged or written to disk.

Measured on Railway, 8 vCPU, wall-clock over the public URL with the default 4 estimators, random numeric data (2026-11-24):

RequestSeconds
100 training rows, 20 scored, 5 columns, classification0.4
1,000 training rows, 200 scored, 20 columns, classification4.7
1,000 training rows, 200 scored, 10 columns, regression2.5
1,000 training rows, 1,000 scored, 50 columns, classification21.7
1,000 training rows, 1,000 scored, 60 columns, 16 estimators (the most the limits allow)96

Memory peaked at 0.87 GB across those requests (Railway's per-minute metric, so a short spike could be higher), and CPU use reached the 8 vCPU the service gets by default; the entrypoint sizes PyTorch's thread pool from the container's CPU quota.

Limits. Tables only: no text, images or time-series forecasting. At most 10 classes. The default limit is 1,000 training rows, the size TabPFN-2 is documented for on CPU; raise MAX_TRAIN_ROWS yourself at the cost of speed and memory. A test value of a categorical column that never appeared in the training rows is treated as missing. Predictions come from a statistical model and can be wrong; do not use them alone for decisions that affect people.

Licence and permitted use. The wrapper and the tabpfn package are Apache-2.0. The weights Prior-Labs/TabPFN-v2-clf and Prior-Labs/TabPFN-v2-reg are not gated (read 2026-11-24) and carry the Prior Labs License 1.1, "a derivative of the Apache 2.0 license with a single modification: the added Paragraph 10". Its grant reads "a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work", so commercial use is allowed. Paragraph 10 requires attribution: "You shall (A) provide a copy of this License with any such materials; and (B) prominently display 'Built with PriorLabs-TabPFN' on each related website, user interface, blogpost, about page, or product documentation." The licence text ships in the image at /licenses/PriorLabs-TabPFN-v2-LICENSE, and this page and every API response carry the attribution; if you put your own interface or documentation in front of this API, display "Built with PriorLabs-TabPFN" there too. Only the TabPFN-2 weights are licensed this way: Prior Labs' newer TabPFN-2.5, 2.6, 3 and 3.5 weights are non-commercial and gated, and this template never loads them.

Agent contract

  • Public URL: https://RAILWAY_PUBLIC_DOMAIN (the generated domain of the tabpfn service)
  • Private URL: http://tabpfn.railway.internal:8080
  • Credentials: the API_KEY variable of the tabpfn service
  • Auth: Authorization: Bearer $API_KEY on every route except GET /health; no key or a wrong key answers 401
  • Health: GET /health returns 200 once the model is loaded (503 while loading, a few seconds)
# needs: RAILWAY_PUBLIC_DOMAIN, API_KEY (variables of the tabpfn service), curl
# signup: none - the API has no user accounts, only the API_KEY bearer
R="https://$RAILWAY_PUBLIC_DOMAIN"
BODY='{"task":"classification","X_train":[[1,"a"],[2,"b"],[3,"a"],[4,"b"],[5,"a"],[6,"b"]],"y_train":["no","yes","no","yes","no","yes"],"X_test":[[2.5,"a"],[5.5,"b"]]}'
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/health")" = 200 ]; do n=$((n+1)); [ "$n" -le 60 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/health"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -X POST "$R/v1/predict" -H "Content-Type: application/json" -d "$BODY"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -X POST "$R/v1/predict" -H "Authorization: Bearer not-the-key" -H "Content-Type: application/json" -d "$BODY"
curl -s -X POST "$R/v1/predict" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d "$BODY"; echo

A fresh deploy prints health: 200, write without key: 401, write wrong key: 401, and then JSON with "model":"tabpfn-v2", "built_with":"PriorLabs-TabPFN", "classes":["no","yes"] and "predictions":["no","yes"]. For regression send "task":"regression" with numeric y_train and add "quantiles":[0.1,0.9] for intervals. A malformed table, a y_train of the wrong length or an unknown field value answers 422.

Why Deploy TabPFN v2 on Railway?

Railway hosts your infrastructure so you do not have to deal with configuration, and lets you scale it vertically and horizontally. Host your servers, databases, AI agents and more on Railway.

  • Your data stays in your container; no GPU bill, no per-prediction fee.
  • Seconds per prediction for tables of a few hundred to a thousand rows, measured on Railway at 8 vCPU.
  • No training step: send the table and the rows to score in one request.
  • Nothing to configure: weights in the image, key generated at deploy.

Common Use Cases

  • A prediction tool for AI agents: an agent POSTs a small CSV-shaped table and gets calibrated class probabilities back in seconds.
  • Quick baselines: score churn, lead quality, fraud flags or demand on a few hundred labelled rows before building a pipeline.
  • Regression with intervals: forecast a numeric column from a handful of features and get quantiles alongside the mean.

Dependencies for TabPFN v2 Hosting

  • A service with 2 GB of RAM or more and 8 vCPU for the speeds above.
  • No volume: the service keeps no state.

Deployment Dependencies


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

Tracklayer
1