Skip to content

Jev directory

Sqlite3 Jev

SQLite C extension that exposes Jev as SQL functions (jev_noul, jev_choice, jev_score) so queries can classify states such as ticket bodies directly, with only libcurl as a dependency.
Stars
3
Language
C
License
MIT
Reading time
3 min
Published by
Community
Author
mattn
Last verified
Sep 2026

mattn/sqlite3-jev

User repository on GitHub

View on GitHub

SQLite extension that calls TypeSafe Jev (or tensai serve) from SQL

Forks
1
Last pushed
Updated Sep 2026

Repo stats from the GitHub API, cached Oct 2026.

About this project

SQLite extension that calls TypeSafe Jev — a decision-only model that returns typed answers (yes/no probability, choice, score) instead of text — straight from SQL. Written in C, depends only on libcurl. Builds on Linux, macOS and Windows (MinGW-w64). criteria for jevchoice is either a JSON object {"option": "description"} (description may be null) or a JSON array of option names. levels for jevscore is a JSON array of at least two level descriptions, in order.

Quoted from the project's README. Read the full README.

Highlights

  • Exposes jev_noul, jev_choice, jev_score and their JSON variants, plus jev() for several questions in a single request.
  • Written in C and depends only on libcurl; builds on Linux, macOS and Windows via MinGW-w64.
  • Structured JSON states work through SQLite's json_object and json_array, and *_json results chain with ->> and json_extract.
  • 429 and 529 responses are retried with exponential backoff up to three times, and API errors are raised as SQL errors.
  • Point base_url at mattn's tensai server to run the same SQL against a local GGUF model on port 8080.

Quickstart

sql
.load ./jev
SELECT jev_noul('Help! My payouts have been failing for 3 days.', 'Does this convey urgency?');
SELECT id, jev_choice(body, 'Which team should handle this?', '["billing", "technical", "sales"]') AS dept FROM tickets;

Watch out

MIT-licensed. Needs a C compiler, sqlite3ext.h and libcurl to build, plus a TYPESAFE_API_KEY or a tensai base_url; without a key no Authorization header is sent.

Questions about this entry

Short answers drawn from the linked project or page.

Reactions & coverage

Posts, threads, and videos about this entry from around the web.

Hacker News: A MySQL plugin that filters rows by asking Jev whether a column matches a sentence.

maayanlevy-hn2 pointsA MySQL plugin that filters rows by meaning (built on TypeSafe Jev)Read the thread on Hacker News

X: jev(): Postgres WHERE clauses in plain language

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai