Jev (TypeSafe)
TypeSafe builds Jev, a model that answers closed questions about text and returns a choice, a score, or a probability instead of prose. MotherDuck exposes it as the prompt_jev SQL function, with no TypeSafe account or API key required.
TypeSafe builds Jev, a model that answers closed questions about text. Unlike a standard large language model (LLM), Jev returns no prose: it returns a probability, a choice from a list you supply, or a position on an ordered scale, each with calibrated probabilities. MotherDuck provides access to Jev as part of the AI functions through the prompt_jev SQL function.
How it works with MotherDuck
MotherDuck provides access to TypeSafe and calls the API on your behalf when a query uses prompt_jev. You don't need a TypeSafe account or API key.
A request is sent for any non-NULL input rows. Single-question calls batch multiple rows into each request by default.
SELECT prompt_jev(
body, -- "I can't find my latest invoice."
'Which team should handle this?',
choice := ['billing', 'technical', 'sales']
).choice AS team
FROM support_messages;
To learn more about using Jev, look at our tutorials on classifying text or using Jev's confidence number for triaging. TypeSafe's own documentation also has some great use cases and examples.
Prerequisites
- A MotherDuck organization on the Lite or Business plan, in any region. In
eu-central-1andeu-west-1, an Admin must turn it on first. AI functions are not available on the Free plan. - Nothing else. No token, account, or network configuration on the TypeSafe side.
What MotherDuck sends
Each row produces one HTTPS request to the TypeSafe API containing:
- The
inputtext for that row - Your
instructionsstring, or the fullquestionsobject for a multi-question call - Your
choiceorscorelabels and descriptions, when supplied - The model alias
jev-latest
TypeSafe returns the answer and a token count. MotherDuck records the token count for metering and discards the rest.
Requests from every cloud region are processed by TypeSafe's servers in the United States.
prompt_jev is off by default in eu-central-1 and eu-west-1. Admins can turn it on or off on the AI Features settings page.
Turning the integration off
An Admin can turn off prompt_jev on the AI Features settings page. Queries that call the function then fail with:
AI functions are not available for your organization. If you are on the Free plan,
upgrade to Lite or Business. Otherwise contact your organization admin.
Disabling AI functions for the organization disables prompt_jev as well.
When to use Jev instead of a language model
- Use
prompt_jevwhen the set of answers is fixed and you need the decision, not an explanation: routing, labelling, flagging, rating against a rubric, or filtering a table down to the rows that match a description. It's faster and cheaper per row than a language model, and it returns calibrated probabilities you can threshold on. - Use
promptwhen you need generated text, a summary, or extraction of values you can't enumerate in advance.
The two compose well. A common pattern is to run prompt_jev over the whole table, then send only the low-confidence rows to prompt. See Triage classifications by confidence.
For search reranking, retrieve a limited set of candidates first, then use prompt_jev to score each query-document pair against a relevance rubric. Sort by the relevance score. Confidence describes certainty about that score, not relevance itself.
Billing
Usage is metered on input tokens only; output tokens are free. It counts toward the combined AI session cap for Advanced AI functions. The default cap for Lite and Business plans is 10 AI Units per Duckling session. In long-running Duckling sessions, AI Unit usage resets after 24 hours. Admins can change the cap on the AI Features settings page. See AI function pricing.
Known limitations
TypeSafe's Jev 1.13 failure-mode guide describes unreliable counting and date comparisons, literal prompt interpretation, and sensitivity to irrelevant or adversarial input. Separate questions and their negations need not produce complementary probabilities. Thresholds tuned for noul should not be reused for choice without evaluation.
Keep exact calculations in SQL, align instructions with criteria, and test representative inputs and edge cases before automating decisions. The guide covers jev-1.13, while MotherDuck uses the jev-latest alias.
Jev returns decisions and probabilities without explaining which input details led to an answer. Confidence does not establish correctness or rule out bias. Evaluate labelled examples across the input groups your workflow handles, including high-confidence predictions. See Triage classifications by confidence for evaluating thresholds and routing results for review.
- The input is a single text value per row. TypeSafe's API accepts structured state, but
prompt_jevsends a string. Concatenate multiple fields into one labelled string. - No model parameter. Requests always use the
jev-latestalias. instructions,choice,score,noul, andquestionsmust be query constants. They can't come from a column.