Who it is forA data analyst with a large text table and a CUDA GPU, who needs a yes or no judgment on every row.
The problemAsking a question of every row in a text column by hand or with one-off scripts is slow and hard to repeat.
The outcomeA filtered result table where each row passed an LLM yes or no check written as a SQL AI.IF condition.
What you need first
- Python 3.12
- An NVIDIA CUDA GPU from the supported list (for example H100 SXM)
- uv installed to run the pip install command
- A table of text rows (for example reviews with an id and a body column)
Steps
- Run
uv pip install quail-engineto install the package (the import name is Quail). - Build a table with an id column and a text column, then register it with Quail.DocumentProvider.from_table(table, id_col="id").
- Create Quail.EngineConfig with a supported model and device, for example model="qwen3-4b-fp8" and device="h100-sxm".
- Open a Quail.Session, then run session.sql with a WHERE AI.IF(PROMPT('Your question\n\n{0}', r.body)) clause and dialect="bq".
- Call .collect() on the result and print it to check the matching rows.
Prompt for your agent
Use the Python package quail-engine (import quail) in the repo fsdatalab/quail to filter the table <table_name> with a BigQuery-style AI.IF question about column <text_column>. Return the matching id values as a table. Verify that the number of returned rows is less than or equal to the input row count.
Caveat. Quail needs Python 3.12 and a CUDA GPU from its supported model and device list, so it will not run on a CPU-only laptop.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for fsdatalab/quail and "Filter table rows with an LLM question in SQL"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer