sqlite-jev
SQLite loadable extension and Python package exposing Jev Noul, Choice and Score as SQL functions and batched virtual-table scans.
Overview
sqlite-jev brings natural-language predicates, classification and scoring to SQLite, inspired by pg-jev but shaped around SQLite's loadable-extension and virtual-table APIs. The main entry point is jev_rows(table, question, kind, criteria, columns), which reads the selected columns, puts up to 40 rows in one shared state, asks one question per row and returns a virtual table (source_rowid, answer, probability, choice, score, confidence) that can be joined back to the source; results are cached for the connection.
Scalar functions cover single records: jev and jev_prob for Noul, jev_choice, jev_score and a normalised score, jev_confidence, and jev_eval for full JSON, plus usage statistics and cache control. Configuration sets the model, batch size, timeout and API URL, and max_rows is a spend guard that fails a scan before sending any data. The README recommends keeping thresholds in SQL so they can rise with the cost of a false positive, and including only the columns the judgment needs. It is a C11 extension using libcurl, with a Python package for loading.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | The customer explicitly expresses urgency or says work is blocked | — |
| Choice | Which team should handle the main request? | billing · technical · sales · other |
| Score | How frustrated is the customer? | — |
How it works
- Load the extension and set TYPESAFE_API_KEY
- Call jev_rows over a table with a question and columns
- Rows are batched (up to 40) into shared-state requests
- Filter or join on probability, choice or score in SQL
Strengths
- Batched scans reduce requests
- max_rows spend guard
- Thresholds kept in SQL
Caveats
- Needs SQLite 3.45+ with loadable extensions and libcurl
- Row data is sent to TypeSafe
Getting started
make, export TYPESAFE_API_KEY, then .load ./build/jev in sqlite3 (or uv add sqlite-jev for Python).At a glance
- Type
- Plugin
- Status
- beta
- Language
- C
- Runtime
- SQLite extension + Python package
- Has code
- yes
Use cases and integrations
How curated lists describe it
SQLite ecosystem: loadable C extension and Python package that expose Jev Noul, Choice, and Score judgments as SQL functions and batched virtual-table queries with confidence results.
yibie/awesome-jev
Frequently asked questions
How do I classify a whole table?
Use jev_rows, which batches up to 40 rows per request and returns a joinable virtual table.
Can I cap spending?
Yes, max_rows makes scans above a limit fail before sending data.
Is it related to pg-jev?
It is inspired by pg-jev but built for SQLite's APIs.
Related projects
dbt package and Terraform module adding jev_noul, jev_choice, jev_score and jev_ask SQL functions to Snowflake.
LibrarybetaSQLPortable SQLite C extension depending only on libcurl that adds jev_noul, jev_choice and jev_score SQL functions.
PluginbetaCDuckDB extension and Python package for semantic SQL that batches row-level filters, joins and classification on Jev.
PluginresearchC++High-throughput native DuckDB extension that batches and streams Jev Noul, Choice and Score judgments directly from SQL.
PluginbetaC++PostgreSQL extension with jev(), jev_prob, jev_choice and jev_score to filter, rank and classify rows by plain-language conditions.
PluginbetaCVGI worker that exposes System One choice, noul and score as DuckDB table functions you can LATERAL join to classify whole tables.
LibrarybetaPython