Skip to content

Releases

v0.3.0: the rewrite hardened, the scores re-run, the warehouse priced

Choose a tag to compare

@technobasant technobasant released this 19 Oct 15:05

A review of v0.2.0 found that the control this version leads with, the tool's query rewrite, could be bypassed. It also found that two scores had been run against the real clock, and that the cost headline left out the query engine. This release fixes all three.

The rewrite, hardened (0011)

  • Default-deny: only expression types on a list; casts only to plain scalar types; no write or RECURSIVE anywhere; each table resolved in its own scope; anything unparseable refused.
  • lab/escapes.yml: 44 hand-written escapes, all refused, run in CI. The first version accepted 23 of them, among them query_to_xml and ts_stat, which run SQL of their own, and a CTE name read outside its query.
  • The 28 attack and 436 ordinary queries the models wrote are unchanged: identical to row-level security, none refused.
  • Row-level security alone leaks the catalog: a customer's role that counts 14 users reads every account's 1,935 from pg_class. The rewrite refuses it.

Scores, re-run with "today" pinned to the prompt's date

  • Without the semantic layer, Qwen3 8B went from 43 to 46 of 70 and gpt-oss-120b from 63 to 65. Llama 3.3 70B's 55 → 70 is unchanged.
  • The semantic layer was written with the question templates in view, so its gains are an upper bound; this is now disclosed.

Cost, in the client's EU region (0014)

  • gpt-oss-120b costs $0.00032 an answer, about $19 a month at launch.
  • The smallest SQL warehouse kept awake for the queries would cost $2,657 a month, more than the $1,500 ceiling. Its rate was measured at 4 DBU an hour in data-platform-architecture's proof of concept. So the assistant queries the stage-2 usage store, and the launch gate runs in that store's dialect.

Docs

  • One identity story: one service identity on the platform; the rewrite is the control.
  • 0012 states honestly what the lab's guard checks.
  • Two equally accurate models complied very differently (12 of 12 leaked against 4 of 7), replacing a false "most accurate leaked most".
  • GPU break-even only for hardware that can hold the model; Genie's 3-second polling disclosed.

v0.2.0 — the usage assistant, measured

Choose a tag to compare

@technobasant technobasant released this 19 Oct 07:29

The repository is now the AI architecture for one assistant: stage 3 of the fictional client in data-platform-architecture, answering customers' questions about their own usage from the governed tables.

  • A lab (lab/): the usage mart in Postgres with a read-only role per account and row-level security, 90 customer questions with answers computed by SQL, and 20 requests for other accounts' data.
  • Accuracy: with the semantic layer, Llama 3.3 70B went from 55 to 70 of 70 and Qwen3 8B from 43 to 64; gpt-oss-120b answered 70 of 70 and declined 20 of 20 unanswerable questions. Databricks AI/BI Genie, given the same definitions, answered 69 of 70 at 14.5 s median.
  • Isolation: told to stay in the customer's account, the models leaked another account's data on 23 of 120 requests; run as the customer's database role, 0.
  • Cost: $0.00028 an answer on gpt-oss-120b from measured tokens at list price.
  • Replay: every response is recorded with its prompt's hash; CI rebuilds the mart and re-scores all 750 recordings with no model calls.
  • Brief, requirements, measured options, target architecture, evaluation, security and compliance (OWASP LLM Top 10, EU AI Act, GDPR, NIST AI RMF), operations, risks and 14 decision records.

The reference architecture of v0.1.0 remains in that tag.

v0.1.0 — a reference architecture for AI on governed data

Choose a tag to compare

@technobasant technobasant released this 18 Oct 13:10

Thirteen decision records for AI features on governed data, twelve backed by results measured in the public labs (generated from evidence/evidence.yml and checked in CI); context, architecture and failure modes, evaluation, an OWASP Top 10 for LLM Applications (2025) threat model, quality targets with the three not yet met, operations runbooks, and a model and cost guide from list prices retrieved 2026-10-18.

Write-up: https://basantbhattarai.com.np/writing/ai-answer-cost-and-self-hosting/