No slash command · from anofox-tabfm
Zero-shot classification and regression in SQL with the anofox_tabfm DuckDB extension (tabular foundation models: TabPFN, Mitra, TabICL, TabDPT, LimiX and more). Use when predicting a label or a number for table rows from labelled example rows without training a model, writing `tabfm_classify` / `tabfm_regress` calls (train/test pair or one table with NULL targets), choosing features or `opts`, keeping a row key with `keep`, reading `yhat` / `yhat_score` / `proba`, scoring per segment, or bounding memory with `query_batch`.
Ships in anofox-tabfm. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Extension: anofox_tabfm v2026.12.05 | DuckDB: v1.5.6 / v2.0 | Dual naming: tabfm_* and anofox_tabfm_* (identical)
A tabular foundation model is an in-context learner: it reads your labelled rows as context and predicts the rest in one forward pass. There is no fit step, no training loop and no saved model: each call sees exactly the rows you hand it.
CALL tabfm_download('<task>', model := '<id>') once (regression is a separate download). Downloading
does not select a model: pass model := '<id>' in every call or SET anofox_tabfm_default_model.
Picking a model and the licence gate: the anofox-tabfm-models skill.features := [...].
Every column except the target is a feature by default, so exclude leakage columns
('(SELECT * EXCLUDE (leak) FROM t)').keep := [...], not in the features. Without it, an id column is a feature (noise to
the model); with features := [...] it is dropped from the output. keep := ['id'] returns the column
unchanged with every row and never shows it to the model, so the result joins back on it. A kept column
may exist in test only, and must not also be in features.test relation may keep its target column (a labelled holdout): its values are ignored, never
reach the model, and come back as NULL. Join the actuals back by key.data and test are strings: a table name or a '(SELECT ...)' subquery, with quotes inside the
subquery doubled (''north''). Not a bare relation.NULL, and NaN in a
FLOAT/DOUBLE target. In the train / test form such rows of data are ignored (neither context nor
output). ±Infinity in the
target is an error naming the column (CASE WHEN isfinite(y) THEN y END). Feature cells may be anything:
NULL, NaN and infinities are imputed.anofox_tabfm_max_rows (10000 rows per call or group) and
anofox_tabfm_max_features (500). The per-model max_rows / max_features in tabfm_list_models() are
recommendations only; max_classes (usually 10) is enforced.UNION ALL one call per segment.
Never a LATERAL join per row: it repeats the whole context for every row.opts values are strings: MAP{'seed': '42'}, not MAP{'seed': 42}. An unknown key is an error
listing the valid ones.tabfm_classify / tabfm_regresstabfm_classify(data, target [, test] [, features] [, opts] [, model] [, keep])
tabfm_regress (data, target [, test] [, features] [, opts] [, model] [, keep])
| argument | type | meaning |
|---|---|---|
data | VARCHAR | table name or '(SELECT ...)': the labelled context (and, without test, the rows to score) |
target | VARCHAR | the column to predict |
test | VARCHAR | optional table name or subquery: the rows to score (the train / test form); a target column in it is ignored |
features | VARCHAR[] | optional; default every column except the target. A name that matches no column is an error (matching is case-insensitive) |
opts | MAP(VARCHAR, VARCHAR) | optional, see below |
model | VARCHAR | the model id; default anofox_tabfm_default_model |
keep | VARCHAR[] | optional pass-through columns (row keys): returned unchanged, never features, any type; may exist in test only. Not also in features |
Explicit train / test, like clf.fit(X_train, y_train).predict(X_test): only the test rows come back.
SELECT customer_id, yhat AS will_churn, yhat_score
FROM tabfm_classify('history', 'churned', test := 'prospects', keep := ['customer_id'], model := 'mitra');
SELECT home_id, sqft, bedrooms, yhat AS predicted_price
FROM tabfm_regress('sold_homes', 'price', test := 'listings', keep := ['home_id'], model := 'mitra');
Single relation: the rows whose target is NULL are scored; every row comes back, and the context rows
carry in-context fitted values (in-sample, a sanity check only). For tabfm-v1, tabfm-v1-1, tabicl-v2 and
kumo-tabular-* they cost a second pass over the context rows: when you read only WHERE NOT is_training,
pass opts := MAP{'context_values': 'false'} to skip it (the scored rows are identical either way).
CREATE TABLE customers_masked AS
SELECT * REPLACE (CASE WHEN id % 4 = 0 THEN NULL ELSE churned END AS churned) FROM customers;
SELECT id, churned, yhat, yhat_score, is_training
FROM tabfm_classify('customers_masked', 'churned', keep := ['id'], model := 'mitra')
WHERE NOT is_training;
Features, options and a subquery:
SELECT customer_id, age, plan, usage_gb, yhat, proba -- the features, plus what keep names
FROM tabfm_classify(
'(SELECT * FROM history WHERE signup_year >= 2024)', 'churned',
test := 'prospects',
features := ['age', 'plan', 'usage_gb'],
keep := ['customer_id'],
opts := MAP{'seed': '7', 'softmax_temperature': '0.9'},
model := 'mitra');
The scored relation's feature columns (all of its columns when features is omitted, only the listed
ones otherwise), the keep columns, the target column (NULL on scored rows), plus:
| column | type | meaning |
|---|---|---|
yhat | the target's type | predicted label (classify) or value (regress) |
yhat_score | DOUBLE | top-class probability; NULL for regression |
is_training | BOOLEAN | true for a context row (single-relation form); false for every scored row |
proba | MAP(VARCHAR, DOUBLE) | label → probability; classification with output_mode = 'detail', the default for tabfm_classify |
proba keys are the labels as VARCHAR
('true' / 'false' for a BOOLEAN target), which is what the probability metrics expect
(anofox-tabfm-evaluate skill). Read one probability with proba['yes'].
opts keys (predict)| key | values | default | meaning |
|---|---|---|---|
seed | integer | 42 | RNG seed |
output_mode | compact, detail | detail for classify | compact drops proba |
softmax_temperature | positive number | 0.9 | temperature on the class probabilities |
query_batch | positive integer | all at once | score the test rows N per forward pass. Every pass re-runs the whole context (except tabfm_classify/tabfm_regress with tabicl-v2 on the CPU, which encodes it once), so it multiplies compute by about ceil(test rows / N): use it only against an out-of-memory, with the largest N that fits |
task | auto, classification, regression | set by the function | leave it to tabfm_classify / tabfm_regress |
n_estimators | 1 | 1 | ensembles are not available yet; above 1 is an error |
context_rows | integer | '' | accepted, no effect today |
context_values | true, false | true | single-relation form: compute the context rows' fitted values (a second pass for the models that need one); query rows are unchanged either way |
model | model id | same as model := |
There is no dist output mode yet: tabfm_regress returns point predictions.
SELECT * FROM tabfm_classify(
'(SELECT * FROM customers WHERE region = ''north'')', 'churned', keep := ['id', 'region'], model := 'mitra')
UNION ALL
SELECT * FROM tabfm_classify(
'(SELECT * FROM customers WHERE region = ''south'')', 'churned', keep := ['id', 'region'], model := 'mitra');
keep the segment column (constant within a call, so useless as a feature) and the key. Each branch is one
forward pass over its segment; for many segments generate the UNION ALL (e.g. with string_agg over the
distinct segment values) rather than writing it by hand, and materialise a filtered source once.
mitra on the CPU peaks at about 1 GB with 1,000 context rows
at 15 features, 2 GB at 2,000 and 5.5 GB at 4,000, while anofox_tabfm_max_rows allows 10,000.
opts := MAP{'query_batch': 'N'} scores the test rows in batches with the same answers, but re-runs the
whole context per batch (except tabicl-v2 on the CPU): a last resort against an OOM, not a speed-up
(mitra, 1,000 + 1,000 rows: 2.4x the CPU time at query_batch 250, 5.2x at 100).
SET anofox_tabfm_max_memory = '16GB' refuses a call when the process is already that large, or when a
pass of exactly the same rows x features was measured to cross it; a shape not seen before is unguarded,
so it cannot stop the first large call of a new size from being OOM-killed.SET anofox_tabfm_max_rows = 20000; (and check the model's recommended
max_rows), or sample the context: '(SELECT * FROM big USING SAMPLE 5000 ROWS (reservoir, 42))'.tabicl-v2 on the CPU: its
encoded context is cached and reused from the third identical call on (details in the models skill).
A GPU runs without the cache, so with a GPU plugin installed pin SET anofox_tabfm_device = 'cpu'; for
this pattern. The cache key is the support rows in order, and a plain table or filter scanned on several
threads comes back in a new order each call and never hits (measured: 0 hits in 5 calls; with
ORDER BY a key, hits from the third call, 20x faster). Always ORDER BY the context, and confirm
hits with SELECT model, context_hits, context_misses FROM tabfm_models() WHERE loaded;.SELECT customer_id, yhat
FROM tabfm_classify('(SELECT * FROM history ORDER BY customer_id)', 'churned',
test := 'prospects', keep := ['customer_id'], model := 'tabicl-v2',
opts := MAP{'query_batch': '128'});
-- 0. once per machine (needs httpfs): CALL tabfm_download('classification', model := 'mitra');
SET anofox_tabfm_default_model = 'mitra';
-- 1. a deterministic split
CREATE TABLE ctx AS SELECT * FROM customers WHERE hash(id) % 10 < 7;
CREATE TABLE hold AS SELECT * FROM customers WHERE hash(id) % 10 >= 7;
-- 2. predict the held-out rows; their labels are ignored, and keep := ['id']
-- brings the key back without making it a feature
CREATE TABLE pred AS
SELECT h.id, h.churned AS actual, p.yhat, p.yhat_score, p.proba
FROM tabfm_classify('ctx', 'churned', test := 'hold', keep := ['id']) p
JOIN hold h USING (id);
-- 3. measure (anofox-tabfm-evaluate)
SELECT tabfm_accuracy(actual, yhat) AS acc,
tabfm_roc_auc(actual::VARCHAR, proba, avg := 'ovr') AS auc
FROM pred;
| You see | Do this |
|---|---|
N models are registered (...) and none is selected | add model := '<id>' or SET anofox_tabfm_default_model = '<id>'; |
has no downloaded weights for task '<task>' | CALL tabfm_download('<task>', model := '<id>'); |
the context relation and the `test` relation must expose the same feature columns | drop or add the column, or features := [...] |
features := [...] names '<x>', which matched no column | fix the name |
keep := [...] names '<x>', which matched no column | fix the name |
keep := [...] names '<x>', but '<x>' is the target | drop it from keep: the target is always in the output |
'<x>' is in both features := [...] and keep := [...] | name it in only one: keep to pass it through, features to model it |
predict group exceeds anofox_tabfm_max_rows | sample the context, or SET anofox_tabfm_max_rows = <n>; |
'<model>' supports at most N classes | fewer classes, or decompose (one-vs-rest); when it adds '<target>' is DOUBLE: to predict a quantity use tabfm_regress, do that |
task 'regression' requires a numeric target | cast the target, or use tabfm_classify |
model '<id>' does not support task '<task>' | e.g. orion-bix is classify-only, nori-30m and nori-1-5 regress-only |
unknown option '<key>' | the message lists the valid keys |
... is refused rather than risking an OOM kill | a smaller context, CALL tabfm_unload();, or as a last resort query_batch |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub datazoode/anofox-tabfm --plugin anofox-tabfm5 skills in this plugin
/anofox-tabfm-evaluateEvaluating and comparing predictions with the anofox_tabfm DuckDB extension: classification metrics (accuracy, precision, recall, F1, ROC-AUC, log loss, ECE, confusion matrix), regression metrics (RMSE, MAE, R², MAPE, MedAE), proper scoring rules for predictive distributions (CRPS, log score, interval score), leakage-safe k-fold cross-validation, and the `_by` macros that feed anofox-visualization plots. Use when measuring how good a prediction is, comparing models with `tabfm_cross_validate` or `tabfm_fold_assign`, writing `tabfm_f1` / `tabfm_roc_auc` / `tabfm_rmse` aggregates, or plotting ROC, calibration, confusion-matrix or model-comparison charts with `tabfm_classification_metrics_by` and friends.
/anofox-tabfm-generateSynthetic tabular data and missing-value imputation with the anofox_tabfm DuckDB extension: `tabfm_generate` samples new rows that keep the relationships between columns, `tabfm_impute` fills NULL cells conditioned on the rest of each row, both zero-shot from a tabular foundation model. Use when creating synthetic or augmented rows, upsampling a rare segment, filling NULLs in a table, choosing generation options (seed, temperature, bins, column_order, rounds), or checking the fidelity and limits of generated data.
/anofox-tabfm-gpuGPU acceleration and device control for the anofox_tabfm DuckDB extension: NVIDIA CUDA and AMD ROCm (both served by the ggml GPU plugin) and Apple MLX backend plugins loaded at runtime, device discovery, per-model backend support, precision modes and GPU memory. Use when making predictions faster on a GPU, running `tabfm_accelerate` / `tabfm_download_runtime`, reading `tabfm_devices()` / `tabfm_backends()`, setting `anofox_tabfm_device`, `anofox_tabfm_gpu_precision` or `anofox_tabfm_ep_path`, checking which device actually served a query, or troubleshooting a GPU that is not used.
/anofox-tabfm-modelsChoosing, downloading and managing models for the anofox_tabfm DuckDB extension: the 27 built-in tabular foundation models (Mitra, TabPFN 2 / 2.5 / 2.6 / 3 / 3.5, TabICL v2, TabDPT, LimiX-2 and 2M, Kumo-Tabular, Inpriora, EXAONE, Nori, Orion, Causilo, Google TabFM), their licences and commercial use, the licence gate, Hugging Face tokens, and registering your own ONNX model. Use when picking a model, running `tabfm_download` / `tabfm_load` / `tabfm_unload` / `tabfm_remove`, reading `tabfm_list_models()` or `tabfm_models()`, setting `anofox_tabfm_default_model` or `anofox_tabfm_accept_hf_license`, calling `tabfm_register_model`, tuning the context cache, or checking whether a model may be used commercially.
Other plugins' skills for the same job