Jev in SQL: Classify Text Columns in DuckDB and MotherDuck With Typed Answers

TypeSafe's Jev scores a fixed list of answers instead of writing text. MotherDuck classified 100,000 complaints in 82 seconds for $0.50, and DuckDB extensions turn plain-English conditions into WHERE clauses.

Jev in SQL: Classify Text Columns in DuckDB and MotherDuck With Typed Answers

Most tables have a text column hiding a question nobody has answered: is this customer angry, what is this complaint asking for, which team should handle this ticket? The usual options are to label data and train a classifier, or to send every row to a chat LLM and parse what comes back. Jev, a model TypeSafe AI released on 15 September 2026, offers a third: it returns a typed answer and a probability instead of a paragraph [1]. Within days, DuckDB community extensions and a MotherDuck function put it inside plain SQL [1:1] [2].

Why it matters

Jev turns classification into a SQL function. You pass a row of text, a question and the allowed answers, and get back a boolean, a label or a score, plus a confidence value, that DuckDB can filter, group and sort like any other column [1:2] [2:1]. For analytics engineers that means no training pipeline, no embeddings and no parsing of LLM output, for questions you can answer from a fixed list.

What Jev is

TypeSafe calls Jev a “System One” model, after Kahneman’s fast, intuitive thinking. A chat LLM writes its answer token by token; Jev reads the text once and scores the answers you allowed [2:2]. It never generates a sentence, and it cannot invent an answer outside your list [1:3] [2:3]. There are three question shapes, each matching something SQL already has [1:4] [2:4]:

  • Yes/no conditions that return a probability, for WHERE.
  • Choice among labels, for GROUP BY.
  • Score on an ordered scale, for ORDER BY.

TypeSafe quotes 70 to 500 ms latency and $0.042 per million input tokens, with output tokens free, and questions in one request are evaluated in parallel [1:5].

What happened

MotherDuck’s benchmark. MotherDuck’s prompt_jev() classified 100,000 consumer complaints from the CFPB into seven requested-outcome categories in 82.2 seconds. On 10,000 of the same rows, gpt-5-nano through prompt() took 6 minutes 9 seconds, against 12.5 seconds for Jev, roughly 30 times faster. On cost, the launch benchmark put Jev at $0.50 per 100,000 rows, against $1.58 for gpt-5-nano and $37.58 for GPT-5.6 Terra: about 1% of the frontier model’s bill [2:5].

DuckDB extensions. The first SQL integration was pg-jev for Postgres, which turns a plain-English condition into a WHERE clause. DuckDB ports followed within days, built independently with different choices about batching and caching [1:6]. A jev extension is in the community repository for DuckDB 1.5.5 and 1.5.6; most others must be built and loaded as unsigned extensions [1:7].

How it works

DuckDB hands extensions rows in chunks of up to 2,048, which suits batched API calls. One extension groups each chunk by question, skips duplicate rows and sends batches across concurrent threads, retrying rate-limit and server errors [1:8]. Batching matters: another reports a 0.211-second median for 100 rows sent in batches of 25, against 16.8 seconds one row at a time, from a single local run [1:9].

Because jev() returns a boolean, it composes with ordinary SQL. Put a cheap condition such as age > 40 in the same WHERE clause and it runs first, so rejected rows are never sent to the API. A LIMIT stops the scan early, and a per-statement row cap limits spend [1:10].

In MotherDuck, the question and choices must be constants. To keep a taxonomy in a table, load it into a DuckDB variable and pass getvariable('request_labels'), which is resolved before the query runs [2:6].

How far to trust the labels

MotherDuck’s walkthrough is careful here [2:7]:

  • Confidence. Across the 100,000 rows, mean confidence was 0.83; 65.8% of rows scored 0.8 or above and 10.9% fell below 0.5. Low-confidence rows are a natural review queue.
  • Agreement. On 300 rows also labeled by GPT-5 and Claude Opus 5.5, the two LLMs agreed on 218. Jev matched them on 90.4% of those rows, and on 96.9% of the ones where its confidence was at least 0.8.
  • Payoff. Once the label is a column, analysis is cheap: grouping all 100,000 complaints by request and refund outcome ran in 0.9 seconds.

What data and AI engineers should do

  • Use it for repeated, bounded decisions: complaint intent, product family, “did they ask for a refund?”. Use an LLM to design the categories, as MotherDuck did with 40 sampled rows, then Jev to apply them [2:8].
  • Design the label list carefully. Jev only returns your options, so poor options give you neatly typed poor answers [2:9].
  • Put cheap filters first and cap rows per statement to control cost [1:11].
  • Test batch size. pg-jev’s documentation reports accuracy dropping above roughly 20 to 25 rows per request [1:12].
  • Check data handling. Every integration sends row text to TypeSafe’s API [1:13] [2:10].

Limitations and open questions

Jev is in early access behind a waitlist, the DuckDB extensions are days old and mostly unsigned, and most performance numbers come from their own authors [1:14]. MotherDuck’s 82-second run and its 40-second news-article benchmark are different tasks, and neither will transfer directly to your table [2:11]. For a fixed classification task at high volume, commenters note that a fine-tuned small model or embedding retrieval can still be cheaper once training is paid for [1:15]. Jev fits best when you have no labeled data and a new question to ask.

Key takeaways

  • Jev scores a fixed list of answers and returns typed values with probabilities, so it slots into WHERE, GROUP BY and ORDER BY. [1:16] [2:12]
  • MotherDuck classified 100,000 complaints in 82.2 seconds; per 100,000 rows, Jev cost $0.50 against $1.58 for gpt-5-nano and $37.58 for GPT-5.6 Terra. [2:13]
  • Use confidence scores to route uncertain rows to review: 10.9% of rows fell below 0.5 in MotherDuck’s run. [2:14]
  • The DuckDB extensions are new and send row text to a third-party API; start on a small, non-sensitive sample. [1:17]

Sources


  1. DuckDB Blog, “Jev and DuckDB: Plain-English Conditions in SQL”, 2026-09-29. https://duckdb.org/2026/09/29/jev.html ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎

  2. MotherDuck Blog, “Jev for analytics: turn text columns into gold, in plain SQL”, 2026-09-29. https://motherduck.com/blog/jev-for-analytics ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎ ↩︎

Discussion

Join the discussion: create a free account or sign in to comment.

No comments yet.

Keep reading

Loading MongoDB into DuckDB from Java: Why a Table Function Beat JDBC and the Appender
Data Engineering

Loading MongoDB into DuckDB from Java: Why a Table Function Beat JDBC and the Appender

On a 485,168-record sample, a pure-Java table function loaded data in 1m 27s, against 2m 02s for the Appender and 3m 37s for JDBC batches. On production data it matched the Mongo community extension.

Nov 12, 2026 · 5 min read
ClickHouse on NVIDIA Vera: How a 352-Thread CPU Scales Filters, Aggregations and Joins
Data Engineering

ClickHouse on NVIDIA Vera: How a 352-Thread CPU Scales Filters, Aggregations and Joins

An unmodified ClickHouse binary scales almost linearly to Vera's 176 physical cores on CPU-heavy queries. Past that, SMT adds little, and a simple LIKE filter runs out of memory bandwidth at 64 threads.

Nov 11, 2026 · 5 min read
ClickHouse Cloud Executable UDFs GA: Native Code, Network Access, and Query-Level Metrics
Data Engineering

ClickHouse Cloud Executable UDFs GA: Native Code, Network Access, and Query-Level Metrics

ClickHouse Cloud now supports compiled-language UDFs, outbound network access for eligible UDF runtimes, and per-query execution metrics. For LLM observability, that means token accounting and sampled quality evaluation can live closer to the data—with important resource, security, and runtime trade-offs.

Oct 14, 2026 · 14 min read