Skip to content

About

DuckDB extension for tabular foundation models — zero-shot classification & regression in SQL. Built-in Mitra, TabPFN v2, TabICL v2, and Google TabFM (selectable by name); register your own in SQL. ONNX Runtime CPU/CUDA/ROCm.

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Latest commit

 

History

231 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anofox TabFM

Zero-shot machine learning for tabular data, inside DuckDB

License: MIT DuckDB 1.5.6 | 2.0 Build Claude Code AI skills plugin

This extension runs tabular foundation models, TabPFN-style in-context learners, so classification and regression become a single SQL statement. No Python, no training loop, no MLOps: the model reads your labelled rows as context and predicts the rest.

SELECT customer_id, yhat AS will_churn, yhat_score
FROM tabfm_classify('history', 'churned', test := 'prospects', keep := ['customer_id'], model := 'mitra');

Built for AI pair-programming. anofox-tabfm ships a Claude Code plugin: five skills with the full, checked SQL surface, so Claude writes working tabfm_* queries from a plain-English request. Install with /plugin marketplace add DataZooDE/anofox-tabfm → /plugin install anofox-tabfm@anofox-tabfm.

Built with StableAI LimiX. The limix-2m model is StableAI's LimiX-2M, used under the Stable AI Technology Co., Ltd. License v1.0 (licence). Several models are non-commercial: check the commercial column in Models before you build on one.

Key Features

Predict

  • Classification and regression in one call: tabfm_classify, tabfm_regress
  • Two forms: an explicit train / test pair, or one table whose missing targets are the rows to score
  • Probabilities, not just labels: yhat_score and a proba map per row

23 models, plus your own

  • Built in, selectable by name: Mitra and Mitra-v2, TabDPT v1.2 and v1.3, TabPFN v2 / 2.5 / 2.5-real / 2.6 / 3 / 3.5 / 3.5-Fast, TabICL v2, Causilo, LimiX-2M, Nori-30M, EXAONE Tabular, Kumo-Tabular (small, medium, large), Orion-BiX, Orion-MSP and Google TabFM v1 / 1.1
  • Your own model, registered entirely in SQL with tabfm_register_model
  • One SQL surface: swap model := to compare models on your own data

Generate and impute

  • Synthetic rows that keep the relationships between columns: tabfm_generate
  • Fill NULL cells, conditioned on the rest of each row: tabfm_impute

Evaluate and plot

  • Metrics as SQL aggregates: accuracy, F1, ROC-AUC, log loss, ECE, RMSE, MAE, R², and more
  • Leakage-safe cross-validation: tabfm_cross_validate
  • Plots through anofox-visualization: model comparison, confusion matrix, ROC and calibration curves

Run anywhere

  • CPU on Linux, macOS (arm64) and Windows
  • GPU with one call, CALL tabfm_accelerate(): NVIDIA CUDA, AMD ROCm, Apple MLX

Safe by default

  • No weights shipped: you download each model's weights from Hugging Face yourself
  • Licence gates: a model whose licence needs an acknowledgement will not download without one
  • Errors that say what to run

Table of Contents

Installation

INSTALL anofox_tabfm FROM community;
LOAD anofox_tabfm;

Latest builds: the community build can trail a release by days. The DataZoo repository has it the moment it is out, but its builds are unsigned: start DuckDB with duckdb -unsigned, and install httpfs first (why):

INSTALL httpfs; LOAD httpfs;
SET custom_extension_repository = 'https://get.anofox.com';
INSTALL anofox_tabfm;
LOAD anofox_tabfm;

Check which build you got:

SELECT extension_version FROM duckdb_extensions() WHERE extension_name = 'anofox_tabfm';

Quick Start

-- 1. Weights are fetched over HTTPS, once: mitra is Apache-2.0, ungated, about 303 MB
INSTALL httpfs; LOAD httpfs;
CALL tabfm_download('classification', model := 'mitra');

-- 2. iris, read from Hugging Face, with every fifth species hidden as NULL
CREATE TABLE iris AS
SELECT SepalLengthCm AS sepal_len, SepalWidthCm AS sepal_wid,
       PetalLengthCm AS petal_len, PetalWidthCm AS petal_wid,
       CASE WHEN row_number() OVER () % 5 = 0 THEN NULL ELSE Species END AS species
FROM 'hf://datasets/scikit-learn/iris/**/*.csv';

-- 3. Rows with a species are the context; predict the NULL ones, zero-shot
SELECT sepal_len, petal_len, yhat AS predicted_species, yhat_score
FROM tabfm_classify('iris', 'species', model := 'mitra')
WHERE species IS NULL;

Every predict, generate / impute and weight-lifecycle function takes model :=; cross-validation uses the default model. Downloading does not choose a model for you: with no model := and no SET anofox_tabfm_default_model = 'mitra', a call fails and says how to pick one. Regression needs its own weights: CALL tabfm_download('regression', model := 'mitra');. The full walk-through with output: Getting Started; runnable files in examples/.

Models

Model By Tasks Licence (tabfm_list_models()) Commercial Gated
mitra AWS AutoGluon classify, regress apache-2.0 yes no
mitra-v2 AWS AutoGluon classify, regress apache-2.0 yes no
tabdpt Layer 6 AI classify, regress apache-2.0 yes no
tabdpt-v1-3 Layer 6 AI classify, regress apache-2.0 yes no
tabicl-v2 Inria (soda-inria) classify, regress bsd-3-clause yes no
orion-bix Lexsi Labs classify mit yes no
orion-msp Lexsi Labs classify mit yes no
nori-30m Synthefy regress apache-2.0 yes no
kumo-tabular-small NVIDIA classify, regress openmdw-1.1 (keep the agreement and NVIDIA's notice when you distribute) yes no
kumo-tabular-medium NVIDIA classify, regress openmdw-1.1 yes no
kumo-tabular-large NVIDIA classify, regress openmdw-1.1 yes no
tabpfn-v2 Prior Labs classify, regress apache-2.0 (Prior Labs License v1.1: Apache-2.0 + attribution) yes yes
limix-2m StableAI classify, regress limix-2m-license-v1.0 (Apache-2.0 + attribution: "Built with StableAI LimiX") yes yes
tabpfn-v2-5 Prior Labs classify, regress tabpfn-2.5-license-v1.1 no yes
tabpfn-v2-5-real Prior Labs classify, regress tabpfn-2.5-license-v1.1 no yes
tabpfn-v2-6 Prior Labs classify, regress tabpfn-2.6-license-v1.0 no yes
tabpfn-v3 Prior Labs classify, regress tabpfn-3-license-v1.0 no yes
tabpfn-v3-5 Prior Labs classify, regress tabpfn-3-5-license-v1.0 (no hosted service) no yes
tabpfn-v3-5-fast Prior Labs classify, regress tabpfn-3-5-license-v1.0 (no hosted service) no yes
causilo Nums AI classify, regress causilo-license-v1.0 (hosted, API or SaaS use needs a separate licence) no yes
exaone-tabular LG AI Research classify, regress exaone-nc-1.2 no yes
tabfm-v1 Google classify, regress tabfm-non-commercial-v1.0 no yes
tabfm-v1-1 Google classify, regress tabfm-non-commercial-v1.0 no yes

Gated means the download needs SET anofox_tabfm_accept_hf_license = true; first, your acknowledgement of that licence. Some Hugging Face repositories also need account approval and a token, which is a separate step: Getting Started. Which model to pick, and how they compared: Choosing a model. Sizes, backends and attribution texts: Models and weights.

Memory on the CPU. mitra's row attention grows with the square of the context: about 3 GB per 1,000 context rows at 15 features, so 2,000 rows peak near 7 GB and 4,000 exceed 15 GB, well below the default anofox_tabfm_max_rows (10,000). Sample the context to fit your RAM (#107).

Claude Code skills

Tabular ML is easier when your AI assistant knows the API. anofox-tabfm ships an installable Claude Code plugin: five skills that give Claude every function, named parameter, opts key, output column, model and error message of this release. Ask "predict churn for the prospects from history with a commercially usable model, then cross-validate it" and Claude writes the tabfm_classify and tabfm_cross_validate calls.

/plugin marketplace add DataZooDE/anofox-tabfm
/plugin install anofox-tabfm@anofox-tabfm
Skill Covers
anofox-tabfm-predict tabfm_classify / tabfm_regress: both forms, features, opts, output columns, segments
anofox-tabfm-models the 23 models, licences, the licence gate, the weight lifecycle, your own model, the context cache
anofox-tabfm-evaluate metrics, scoring rules, cross-validation, the _by plotting macros
anofox-tabfm-generate synthetic rows and imputation
anofox-tabfm-gpu CUDA, ROCm and MLX plugins, devices, precision, the ROCm precompile

The skills live in plugins/anofox-tabfm/ and are checked against the built extension on every pull request: each SQL example runs, and each function, setting and model name must exist (how). In this repository, load them directly with claude --plugin-dir ./plugins/anofox-tabfm.

Documentation

Guides

Guide Description
Getting Started Install, download a model, licence gates, a first prediction on iris
Choosing a model Selecting a model, the default, your own model, how the models compared
Evaluate and compare A churn walk-through, cross-validation, plotting the results
GPU acceleration tabfm_accelerate(), checking which device served a query, the ROCm first compile
Generate and impute Synthetic rows and filling NULL cells
Claude Code skills Installing the plugin, what each skill covers, how they stay in sync

API reference

Topic Description
Functions tabfm_classify, tabfm_regress, missing targets, segments, opts, output columns
Models and weights Every model, download / load / unload / remove, the cache, secrets, tabfm_register_model
Generation tabfm_generate, tabfm_impute, options, outputs, cost
GPU acceleration CUDA, ROCm and MLX plugins, the support matrix, precision, platform limits
Settings Every setting with its default, and the opts keys
Troubleshooting Error messages, what they mean, what to run
Evaluation Metrics, cross-validation, scoring rules
Plotting The six _by macros for anofox-visualization

Background

The full index, including design notes and the history of plans and reviews, is docs/README.md.

Document What it is
docs/REAL_MODELS.md Reference: each real model, how it was ported and verified, licences, gated repositories
docs/GENERATE.md Reference: how generation and imputation work, and what binning costs
docs/BUILDING.md Reference: building and testing from source
docs/DYNAMIC_BACKENDS.md, docs/KV_CACHE_DESIGN.md Design: GPU backends as runtime plugins; the context cache
docs/ROCM_SINGLE_EVAL_POS.md, docs/MLX_SPIKE_RESULTS.md Report: how models that read the split from len(y) were given masked ROCm graphs; the MLX spike
docs/README.md History: the plans and reviews behind each feature
CHANGELOG.md Every release

Moved sections. The old README's sections now live here (their links still land on this table):

Old section Now
Quickstart Quick Start, Getting Started
Classification and regression Functions
Generate synthetic data and fill gaps Generate and impute, Generation
The registry, managing weights Choosing a model, Models and weights
Worked example, evaluation, plotting Evaluate and compare, Evaluation, Plotting
Settings Settings
Flavors (CPU / GPU), Status & scope GPU acceleration, GPU
Building docs/BUILDING.md

Status

The extension is calendar-versioned (2026.10.26 is the twenty-sixth of October 2026) and is built and tested on Linux (amd64, arm64), macOS (arm64) and Windows (amd64) against DuckDB 1.5.6, and on DuckDB 2.0. Every model runs a single estimator (n_estimators > 1 is not available yet). What each GPU backend serves: the support matrix.

Development

git clone --recurse-submodules https://github.com/DataZooDE/anofox-tabfm.git
cd anofox-tabfm
GEN=ninja make release      # needs vcpkg: see docs/BUILDING.md
make test_release           # sqllogictests + C++ unit tests (fixture models, no real weights)
make check-docs             # every documented SQL example and name, docs and Claude Code skills

Prerequisites, the GPU plugins and source-build flavors: docs/BUILDING.md.

License

  • This extension's code: MIT, see LICENSE.
  • Model weights: the extension ships only weight-free graphs and never redistributes weights. Each model's weights are your own Hugging Face download, under that model's licence, listed in Models and in tabfm_list_models() (license, commercial, and the notice to keep in attribution). The repository and test fixtures contain zero model weight bytes (fixtures are random-init).
  • Non-commercial models: tabfm-v1, tabfm-v1-1, tabpfn-v2-5, tabpfn-v2-5-real, tabpfn-v2-6, tabpfn-v3, tabpfn-v3-5, tabpfn-v3-5-fast, exaone-tabular and causilo. causilo's licence also requires a separate licence for hosted, API or SaaS use.
  • Bundled graphs: the Kumo-Tabular graphs encode NVIDIA's architecture, which OpenMDW-1.1 counts as part of the Model Materials, so the binary carries that agreement and NVIDIA's notice; see THIRD_PARTY_NOTICES.md.
  • Attribution: tabpfn-v2 is under the Prior Labs License v1.1 (Apache-2.0 plus attribution). limix-2m is under the Stable AI Technology Co., Ltd. License v1.0 (Apache-2.0 plus Section 10): if you make available a product or service that incorporates it, link the licence and display "Built with StableAI LimiX"; a model derived from its weights must start its name with "LimiX". Details: docs/REAL_MODELS.md.

Licences are as published by each project at the time of writing; this is not legal advice.

Telemetry

Sends anonymous usage telemetry (extension load and per-function call counts: no data, no queries, no identifiers beyond a hashed machine id) to PostHog EU, matching the other anofox extensions. CI environments are auto-detected and telemetry is disabled there. Opt out any time with export DATAZOO_DISABLE_TELEMETRY=1 or SET anofox_telemetry_enabled = false;. What is collected: TELEMETRY.md.

Feedback

If anofox_tabfm misbehaves — a model that will not load, a prediction that looks wrong, a device it will not use — please open an issue. Hardware, drivers and hub availability differ in ways we cannot reproduce here, so a report with your setup is the fastest path to a fix. Errors from the model functions end with that link.

If it saved you time, a star on the repo helps other people find it.

The first time you load the extension in an interactive terminal each day, a small banner says the same thing. It never prints when output is piped, in notebooks, or in CI. Silence it with SET datazoo_banner = false; or DATAZOO_NO_BANNER=1.

About

DuckDB extension for tabular foundation models — zero-shot classification & regression in SQL. Built-in Mitra, TabPFN v2, TabICL v2, and Google TabFM (selectable by name); register your own in SQL. ONNX Runtime CPU/CUDA/ROCm.

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages