All projects

Integer & embedded · Completed

int-llm SQL

A complete integer-only MicroGPT inference pipeline in a standalone SQLite shell script.

At a glance

Evidence and scope

Repository measurements and recorded project results. Test and benchmark claims were inspected, not rerun during this catalog refresh. Physical line counts use the stated file scopes.

Oracle trace
69,748 rowsDevelopment comparisons cover recorded activations, logits, and probabilities, plus 122 RNG records.
Arithmetic gate
11,750 vectorsFixed-point operations are checked against the vendored C oracle.
Inference output
20 names / 122 stepsSample and raw-logit checksums are calculated by the executed SQL before SQL_GATE=PASS.
Model scope
14,272 parametersOne layer, width 32, four attention heads, eight-position context, and 27 tokens.
Reviewed sources · 2026-10-15 · 6353817f5cda

26 tracked files · 2 documentation files · 1 workflow files. Inventory includes data and vendored or generated files; workflow presence does not establish a passing run.

Download inventory and line-count file scopes

Executive summary

int-llm-sql runs a small transformer as relational computation. One SQLite shell script reads a committed binary checkpoint, decodes the weights into tables, performs the complete forward and autoregressive sampling paths, and checks the result against pinned regression hashes. It uses integer-only Q16.48 arithmetic without custom functions or loadable extensions. Recursive queries implement fixed-point operations, joins implement matrix products, and triggers sequence the model. The artifact demonstrates exact inference for one fixed MicroGPT configuration; it does not generate SQL from natural language.

How it works

SQLite's 64-bit integers are extended with limb multiplication and recursive division and transcendental operations. Intermediate results are materialized in scratch tables. A sequencing trigger supplies 160 ticks, of which 122 become forward passes before end-of-sequence tokens finish the 20 samples.

The only shell-specific helper is readfile(), used once to load the checkpoint. The runtime calculates both sample and raw-logit hashes from its actual output.

Evidence and validation

The repository reports comparison with the C oracle at 69,748 trace rows and 122 random-number sampling records. Its arithmetic suite contains 11,750 vectors. Separate gates compare stdout, regenerate the F12 model, confirm that the standalone artifact embeds its development sources, and rebuild oracle fixtures.

Boundaries

There is no training or prompt interface. The model shape and input checkpoint are fixed. The release was tested with SQLite 3.51.0 and requires a shell with readfile() and the documented SQL features. Regression hashes check determinism, not cryptographic integrity; the loader is not intended for untrusted or unbounded model files.

Repository map and first run

sqlite3 :memory: < microgpt.sql

make verify runs the documented non-mutating release gates. sql/ contains the development fragments, model/ the pinned weights and model card, and reference/ the C oracle and fixtures. make golden is a maintainer operation that rewrites fixtures, rather than an ordinary validation step.