MotherDuck puts image classification inside SQL—but confidence routing is the real production feature
prompt_jev() can now classify and locate objects in image BLOBs. The deployment pattern is not “trust every answer”; it is “route by confidence, then escalate.”
MotherDuck has extended prompt_jev() from text to images, letting SQL queries classify pictures, score them, choose among fixed labels, or locate an object with a bounding box. Images are passed as raw JPEG or PNG bytes in BLOB columns, and the output stays typed so it can be filtered, joined and aggregated like ordinary warehouse data (MotherDuck announcement; function documentation).
That makes image analysis easier to operationalize, but the most useful production idea in the release is not the new input type. It is the confidence-routing pattern.
Treat confidence as a queueing signal
MotherDuck tested Jev on 1,010 Food-101 images, asking it to select one of 101 dish labels. The vendor reports 90.2% accuracy at 44 rows per second and about $0.06 for the run. More importantly, when it retained only answers with confidence of at least 0.8, reported accuracy rose to 97.7% while keeping 81% of images. At a 0.95 threshold, it kept 65% at 98.9% accuracy (MotherDuck benchmark).
Those are vendor-run results on one labeled dataset, not a guarantee for product catalogs, receipts or inspection photos. But they demonstrate the right architecture: accept high-confidence rows automatically, send uncertain rows to a stronger model or a human review queue, and measure the retained coverage and error rate on your own labeled sample.
MotherDuck also reports that a Jev-first pipeline followed by Gemini 3.8 Flash on uncertain cases reached 96.5% accuracy at about $0.45 per 1,000 photos, compared with 97.0% at $1.40 for sending every image to Gemini. Again, teams should reproduce those economics on their images before budgeting around them (MotherDuck benchmark).
Put three controls around the SQL
First, keep the task closed. prompt_jev() returns probabilities, fixed-list choices, ordered scores or boxes; it is not intended for open-ended text extraction. Labels and question definitions are constants bound before rows are read, which makes the output schema predictable (function documentation).
Second, validate presence before trusting a box. MotherDuck’s documentation says a box query has no “not found” result and will return coordinates even if the requested object is absent. Pair object location with a separate yes/no presence question and reject the box when presence confidence is too low (function documentation).
Third, budget by image dimensions rather than compressed file size. The documentation estimates image token use from width and height and requires images between 280 and 1,568 pixels on each side; oversized files need resizing first (function documentation).
The practical result is a warehouse-native triage layer: SQL handles storage, fixed outputs and downstream joins, while confidence thresholds decide what can pass automatically and what needs escalation. That boundary—not a headline accuracy number—is what makes the feature usable in production.
sources
- prompt_jev() now works on imagesmotherduck.com
- MotherDuck PROMPT_JEV documentationmotherduck.com
comments · 0