madewithlaya

Catalog / Security & fraud

0110GitHub

SQL review benchmark: 14 PostgreSQL statements, seven with deliberate bugs

Fan-out SUMs, = NULL, UPDATE without WHERE, injection remnants and more, each with intent and schema context. Four typed questions per statement, identical payloads to both models.

DDnim/jev-vs-layaREADME ↗
# Jev vs Laya: SQL review benchmark

A small, reproducible benchmark comparing two "System 1" decision models — models that
take a **state** plus typed **questions** and return calibrated probabilities instead of text:

- **Jev** (`jev-latest`) — TypeSafe AI, proprietary API. https://docs.typesafe.ai
- **Laya** — Convai Innovations, open weights (Apache 2.0), 3 checkpoints. https://huggingface.co/convaiinnovations/laya

Both accept the same wire format (`state` + `questions` of type `choice` / `score` / `noul`),
so the exact same payload is sent to each.

## Task 1: review 14 SQL statements

Each case is a PostgreSQL statement with an explicit **intent** and a shared **schema context**
(5 tables, row counts, indexes). Seven of them are correct; seven contain a deliberate bug:

| bug | case |
|---|---|
| join fan-out double-counting a SUM | `q02_fanout` |
| `= NULL` (always UNKNOWN) | `q03_null_eq` |
| `OR` deletes far more than intended | `q04_delete_all` |
| `UPDATE` without `WHERE` | `q06_update_no_where` |
| cross join instead of `NOT EXISTS` | `q08_cross_join` |
| `CREATE INDEX` without `CONCURRENTLY` on 80M rows | `q10_migration_lock` |
| `BETWEEN` on dates includes the next day | `q13_between_ts` |
| `OR 1=1 --` injection remnant | `q14_injection` |

Four questions are asked per statement:

| id | type | question |
|---|---|---|
| `safe` | noul | read-only and safe to run on production as-is? |
| `correct` | noul | implements the intent with no logical bug? |
| `cost` | score 0–2 | cheap / moderate / heavy |
| `kind` | choice | report / destructive / schema |

## Results (2026-09-21)

| model | safe | correct | cost | kind | Brier safe / correct | p50 latency |
|---|---|---|---|---|---|---|
| **Jev `jev-latest`** (API) | **14/14** | **13/14** | 9/14 | **14/14** | 

Also filed under Security & fraud

  1. 0084

    IOCArena: classify IPs, domains and hashes from VirusTotal data with Jev, Von or Laya

    Self-hosted console that runs VirusTotal lookups through System One models and evaluates them against each other on a labelled dataset. Prompts and criteria are versioned JSON.

    Hayden · Security & fraud · free with local Laya or Von