Quail: run LLM judges as SQL on your own GPU

Carnegie Mellon's Full Stack Data Lab has an open-source engine that runs AI.IF, AI.CLASSIFY and other AI functions in SQL on open models on your own GPUs.

If you grade or label thousands of rows with an LLM judge, every hosted API call shows up on the bill. Quail, an open-source engine from Carnegie Mellon University's Full Stack Data Lab, runs those judges as SQL functions on open models on your own GPU. You can write WHERE AI.IF(...) and AI.CLASSIFY(...) instead of a loop of API calls.

Quail is an Apache DataFusion extension. It needs Python 3.12 and a supported CUDA GPU, and installs with uv pip install quail-engine. The functions include AI.IF (yes/no, for filters and joins), AI.SCORE (0 to 1), AI.CLASSIFY, AI.EXTRACT and AI.MAP. The README's example keeps movie reviews that discuss the ending and labels each as praise or a complaint, running Qwen3 4B on one H100. Quail reads each review once for both functions and classifies only the rows AI.IF keeps. Supported models include Qwen3, Qwen3.5 and LFM2, and Quail Server can run queries on a remote GPU.

The cost case comes from @sh_reya, who posted on Dec 4, 2026 that Quail can run two LLM judges on each of 100k movie reviews for $0.37, "4.7x cheaper than GPT-5 nano," and up to 14x faster than vLLM depending on the query. The post doesn't say how those numbers were measured, or how accurate the small open models are against GPT-5 nano on that task. AGI Hunt's write-up adds that you can run it on Modal without a local GPU.

The same function names already exist in managed warehouses, billed per call. In BigQuery, Querylab.io's guide notes that every row is a Gemini call Vertex AI bills per token, and that the dry run leaves it out. Databricks bills task-specific AI Functions on managed serverless GPUs on top of your query compute. Our reading: Quail swaps that per-token bill for a GPU you run, which pays off when the batches are large and the judge question is narrow enough for a small model. The README lists which GPU each model needs; below H100 class, check that list before you plan around it.

Try it: run the README's review example, then point AI.IF at a few hundred rows your current judge has already labelled. Count where the two disagree before you move the full job over.

Sources