Skip to content

iPDb

iPDb is a database engine, built on DuckDB, that adds a native relational prediction operator to SQL. It lets you run inference — against tabular/GNN models, local LLMs, or remote LLM APIs — directly inside your queries, right alongside joins, filters, and aggregates.

-- semantic SQL: predict with a large language model
SELECT p.name, r.review_text
FROM Product AS p
JOIN Review AS r ON p.product_id = r.product_id
WHERE LLM o4mini PROMPT 'is the {sentiment VARCHAR} of the {{review_text}} positive or negative' = 'negative';

iPDb is the reference implementation for the paper "iPDB -- Optimizing SQL Queries with ML and LLM Predicates".

Why iPDb

  • Inference as a first-class relational operator. PREDICT and LLM behave like any other SQL construct — they can appear as a table source, a scalar expression, a join predicate, or a GROUP BY key — and compose with the rest of the query.
  • Query-aware execution. Because the optimizer understands PREDICT/LLM calls, it can push filters through them, avoid running inference on rows that a LIMIT will discard, and reorder joins around expensive inference calls. See Execution Model.
  • Pluggable backends. Run tabular/GNN models via ONNX, local LLMs via llama.cpp, or any OpenAI-compatible remote LLM API — all through the same SQL surface.
  • It's still DuckDB. Everything you already know about DuckDB (the CLI, SQL dialect, Python/other client APIs, file formats) works unchanged. iPDb only adds to it.

Where to go next

Citing iPDb

@misc{ipdb2026arxiv,
      title={iPDB -- Optimizing SQL Queries with ML and LLM Predicates},
      author={Udesh Kumarasinghe and Tyler Liu and Chunwei Liu and Walid G. Aref},
      year={2026},
      eprint={2601.16432},
      archivePrefix={arXiv},
      primaryClass={cs.DB},
      url={https://arxiv.org/abs/2601.16432},
}