dbt\_jev
dbt package whose macros run Jev Choice, Noul and Score over SQL values in DuckDB and ClickHouse models.
Overview
dbt_jev brings Jev into dbt. Its macros evaluate SQL values through TypeSafe's hosted API or OpenRouter and work on DuckDB and ClickHouse. classify exposes a Choice as a nullable label, match_probability exposes a Noul as a nullable probability that two records match, and score applies an ordered rubric and returns the expected level, so a three-level rubric can yield fractional values such as 1.75. A decisions macro batches several typed questions about one input into a single request, with accessors to read each answer back.
It is aimed at analytics engineers who want typed judgments inside their transformation layer: labelling agent tool failures, scoring support-ticket urgency, or entity resolution where ordinary SQL generates candidate pairs and Jev scores them. Outputs are nullable, so failed calls do not break a model. The README includes a recorded OpenRouter-backed demo replayed deterministically.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Is this tool failure expected, unexpected or unknown? | expected · unexpected · unknown |
| Yes / no | Do these records represent the same customer? | true · false |
| Score | Rate the urgency of this support request | No urgency · Needs attention · Urgent |
How it works
- Generate candidate rows or pairs with ordinary SQL
- Call a dbt_jev macro in a model
- Jev returns a label, probability or expected score per row
- Filter or join downstream on the typed columns
Strengths
- Typed judgments directly in dbt models
- Batched questions per row
- Same macros on DuckDB and ClickHouse
- Nullable outputs tolerate failures
Caveats
- Each row is an API call with cost and latency
- Only DuckDB and ClickHouse supported
Getting started
Add dbt_jev to your dbt packages, configure a TypeSafe or OpenRouter key, then call {{ dbt_jev.classify(...) }} in a model.At a glance
- Type
- Project
- Status
- beta
- Language
- SQL (Jinja)
- Runtime
- dbt on DuckDB / ClickHouse
- Has code
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Score a candidate pair after ordinary SQL has generated it:
logicrw/awesome-jev-projects
Frequently asked questions
Which warehouses are supported?
DuckDB and ClickHouse.
Can I use OpenRouter instead of TypeSafe?
Yes, both providers are supported.
What does score return?
The expected level index, which can be fractional.
Related projects
DuckDB extension that asks Jev about every row in SQL and returns answers as ENUM, DOUBLE or STRUCT columns.
PluginbetaC++CLI that scans tabular, structured and text files or databases and asks Jev which fields look anomalous, building a review queue.
CLIbetaPythondbt package and Terraform module adding jev_noul, jev_choice, jev_score and jev_ask SQL functions to Snowflake.
LibrarybetaSQLPostgreSQL extension with jev(), jev_prob, jev_choice and jev_score to filter, rank and classify rows by plain-language conditions.
PluginbetaCDuckDB extension that labels rows in CSV, Parquet or DuckDB tables with Jev, reported at about ten seconds per thousand rows.
DiscussionprototypeSQLite and Node library adding Jev judgments to SQL for matching, evidence picking, ranking, review queues and semantic CI checks.
ProjectbetaJavaScript