2026-11-26 15:50 UTC

Blink: a tiny C/WASM model for fixed-option decisions

state: seedheat: mediumuncertainty: mediumrelevance: mediumedge-inference typed-decisions inference-economicsSQLiteAIMarco Bambini

What is this?

SQLiteAI’s Blink is an open-source C runtime and small model for scoring caller-declared options against a state and question. The repository says blink-tiny’s 452 KiB weights can be mapped read-only, with scoring requiring no allocations in the default build; it also provides a 66 KB WebAssembly build. Its reported strengths are narrow tasks where the answer depends on the form of the input, while natural-language inference and name-to-sentence matching are near chance. The published performance and task results are repository claims, not independent validation.

Why it matters

Blink explores a different efficiency trade-off from shrinking a general-purpose language model: it replaces text generation with a small model that assigns probabilities to options the caller has already defined. If it works on suitable tasks, software could handle some routing and triage decisions locally, quickly, and without per-call allocation or a server. But the project’s own results draw a firm boundary: Blink performs poorly when a decision requires reading comprehension, and its reported benchmarks have not been independently validated in the supplied evidence.

Current assessment

SQLiteAI’s open-source Blink repository describes a one-pass typed-decision model and embeddable C99 runtime, with a WebAssembly build that can run in a browser or Node without a server. The interface takes a state, a question and caller-declared options, returning probabilities rather than generated text. The project reports blink-tiny weights of 452 KiB, zero allocations during scoring in the default build, and 406 μs median latency for a fresh decision on one Apple M5 Pro core (221 μs with its W8A8 build); these are first-party measurements, not independent results. The repository says performance is strong on form-driven tasks but near chance on natural-language inference and name-to-sentence matching, where a frozen 4B model does much better. Its Snake, Doom and driving demos use computed or simulated outcomes as input; the repository cautions that they test ranking and the runtime, not general reasoning over game states or real-world driving. The practical opportunity is a lightweight, potentially local alternative to an LLM call when the task is narrow and options are known in advance, with uncertain confidence available for escalation. Evidence supplied does not establish production adoption, independent replication, or real-world cost savings; do not generalize the release into a general-purpose model replacement.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady2 platformsage 1561h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

09-22 16:25 (minted)⭐ origin echo-reconstructedBlink returns probabilities over caller-declared options without token generation; the repository reports strong form-based task results but
SQLiteAI on github (echo) · attributed from hn.story.49801558 · published time unknown
—
09-22 14:08first on hacker news · published · lag ?Blink – A 452KB decision model in C/WASM with no token generation
marcobambini
—
09-22 14:08amplified on hacker news 👑hn.story.49801558
marcobambini
peak 6 · 0 comments · 75% of case engagement
09-23 11:55amplified on hacker newshn.story.49814732
marcobambini
peak 1 · 0 comments · 13% of case engagement
09-24 06:20amplified on hacker newshn.story.49826889
marcobambini
peak 1 · 0 comments · 13% of case engagement
09-22 14:21our radar first saw it · lag ?discovery anchor: hn.story.49801558—

Evidence (4) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnBlink – A 452KB decision model in C/WASM with no token generation
Retrieved article excerpt

Open article · Retrieved 2026-09-23T14:28:00.679948+00:00

# Blink

**A one-pass typed-decision model with an embeddable C runtime that also
builds to WebAssembly.**

---

TypeSafe released [Jev](https://typesafe.ai/blog/introducing-system-one-models-and-jev),
a closed model in a class they call *System One Models*: fast structured
decisions for software rather than conversation, with calibrated confidence and
no output tokens to pay for. Blink puts that interface behind a C library you
can link into a service, a daemon or a device, or load as WebAssembly in a web
page.

---

Blink answers questions of the form *"given this state and this criterion,
which of these options?"* in a single forward pass. There is no token
generation, no decoding loop, no JSON to parse and nothing to repair: the
output is one probability per option you declared at call time.

The runtime is C99 with no dependencies beyond libc and libm. Weights are
mapped read-only and never copied. Scoring performs **zero allocations** — a
property the test suite checks mechanically, not by inspection.

The same sources build to a 66 KB WebAssembly module that runs unchanged in
browsers and in Node, with no file system and no server
([details](https://github.com/sqliteai/blink#webassembly)).

```
#include "blink.h"

blink_model  *model   = blink_model_open_file("blink-tiny.blink", 1, &status);
blink_session *session = blink_session_init(arena, sizeof arena, model, &limits, &status);

blink_state_set(session, ticket, strlen(ticket));           /* encode once  */
blink_menu_set(session, queues, lengths, 4);                /* encode once  */
blink_score(session, "Which team should handle this?", 29,  /* cheap        */
            probabilities, &result);
```

**What it is good for, in one paragraph.** Blink recognises the *form* of a
decision; it does not read text the way a pretrained language model does.
Where the answer is carried by form — which queue a ticket's wording points
at, whether a claim's verb agrees with the state — blink-tiny is near perfect
and well calibrated. Where the answer requires reading — natural language
inference, binding a name to the right sentence — it is at or a little above
chance, and a frozen 4B model is far ahead. Its confidence is calibrated
enough to branch on: answer when it is sure, escalate when it is not.

## Performance

blink-tiny on one core of an Apple M5 Pro: one decision over a 256-byte state,
a question and four options, p50.

| build | fresh decision | same state, new question | decisions/s, state reused |
| --- | --- | --- | --- |
| default (C99, NEON) | 406 µs | 54 µs | 18,211 |
| [W8A8](https://github.com/sqliteai/blink#w8a8-backend-sdot--i8mm) (int8 activations, SDOT) | 221 µs | 33 µs | 29,481 |
| [Accelerate](https://github.com/sqliteai/blink#accelerate-backend-macos) (macOS) | 172 µs | 32 µs | 31,290 |

A fresh decision encodes the state, the options and the question. Software
usually asks several questions of the same state, and then only the question
is encoded: the cached state is reused exactly, bit for bit. On x86-64 the
AVX2 kernel does the same decision in 760 µs, and 90 µs with the state reused,
on a GitHub-hosted runner.

**Memory. Nothing is allocated while scoring: not per decision, not per
question, not per option.** All the working memory a session needs is one
arena, sized before the session exists and placed wherever you choose, a static
array or a stack buffer included, so Blink runs where `malloc` is unavailable
or not allowed. This is checked, not assumed: `tests/c/check_no_malloc.sh`
fails the build if the scoring code references any allocator.

blink-tiny's weights are 452 KiB of int8, mapped read-only and shared by every
session and every process that opens the same file. The arena is 260 KiB with
the model's default limits and 22 KiB with the smallest. One decision from the
command line peaks at 2.5 MiB of resident memory, the whole process included.
The W8A8 build keeps the no-allocation guarantee; the Accelerate build gives it
up, because the framework allocates inside its matrix products
([details](https://github.com/sqliteai/blink#memory)).

A larger preset, blink-small (7.9M parameters), is **experimental**: it is
worse than blink-tiny on every corpus measured and about ten times slower to
encode, so its containers are not shipped
([why](https://github.com/sqliteai/blink/blob/main/docs/RESULTS.md#5-what-does-not-work)).

All the benchmark tables, and a comparison with other systems that expose the
same interface, are in [docs/RESULTS.md](https://github.com/sqliteai/blink/blob/main/docs/RESULTS.md#comparison-with-other-systems).

---

## Quick start

```
git clone https://github.com/sqliteai/blink
cd blink
make                     # C runtime, tools, benchmarks. No Python needed.
make test                # unit tests + the no-allocation check
make bench               # latency and memory as JSON
make install             # blink, libblink, blink.h, blink.pc, man page under /usr/local
make ACCELERATE=1 test   # macOS only: the Accelerate backend, in build-accelerate/
make W8A8=1 test         # int8 activations with SDOT/I8MM, in build-w8a8/
```

Training and evaluation need Python:

```
uv venv --python 3.12 .venv
uv pip install --python .venv/bin/python torch numpy pytest
export PYTHONPATH=python

.venv/bin/python scripts/make_data.py                    # deterministic corpus
.venv/bin/python -m blink_train.train \
    data/synthetic/train.jsonl \
    --validation data/synthetic/validation.jsonl \
    --preset tiny --output artifacts/blink-tiny.blink \
    --epochs 60 --learning-rate 3e-3 --device auto

.venv/bin/python eval/evaluate.py \
    artifacts/blink-tiny.blink data/synthetic/test.jsonl
```

One decision from the shell, with the committed blink-tiny (no training
needed):

```
./build/blink artifacts/blink-tiny-synthetic-s7.blink \
  --state "The parcel left the depot on Monday and has not arrived." \
  --question "Which team should handle this ticket?" \
  --option "delivery and logistics" \
  --option "billing and payments" \
  --option "account access and sign-in"
```

It answers *delivery and logistics* with probability 0.56: the right queue, with
a confidence low enough that a caller branching at 0.8 would escalate it.

`./build/blink --version` prints the library version and the numeric
backend it runs on this CPU, for example `blink 0.1.0 (neon)`. Every option,
the output fields and the exit codes are in [docs/CLI.md](https://github.com/sqliteai/blink/blob/main/docs/CLI.md), also
installed as the `blink(1)` man page.

`make install` puts `blink`, `libblink.a`, the shared library, `blink.h`, a
`blink.pc` for pkg-config and the man page under `/usr/local`. Use
`PREFIX=...` to choose another place and `DESTDIR=...` to stage a package;
`make uninstall` removes them again. The shared library is named after the ABI
version, `libblink.so.1` on Linux and `libblink.1.dylib` on macOS.

To reproduce everything — build, tests, data, training, accuracy, controls,
perturbations, benchmarks, and a manifest of every checksum:

```
bash scripts/run_all.sh            # the published protocol, about 2 h on an M-series laptop
bash scripts/run_all.sh --smoke    # every stage on a small corpus, a few minutes
```

---

## The architecture in one diagram

```
  state bytes              question bytes           option bytes
       │                         │                        │
   unigram + hashed bigram + position + segment embedding (each separately)
       │                         │                        │
   stem: depthwise conv + pointwise projection, full resolution
       │                         │                        │
   mean-pool by stride 4, then blocks: conv + global mean + FFN, self-attention mixer
       │                         │                        │
   state K, V  ◄──── cross ──── question                  │
   (cached)          (the question attends to the state)  │
       │                         │                        │
       │                  question summary ──── FiLM ──► option vectors
       │                                                  │
       └─────────► multi-head cosine option attention ◄───┘
                                 │
            Σ head cosines × scale / temperature → softmax over the options
```

Four decisions carry most of the design, and each is explained with its
rationale in [docs/ARCHITECTURE.md](https://github.com/sqliteai/blink/blob/main/docs/ARCHITECTURE.md):

1. **Byte level, no tokenizer.** Program state is not curated text. Bytes
   accept JSON, identifiers, any language and embedded NULs, and there is no
   second artefact to keep in sync.
2. **Stem, then pool, then blocks.** Running a feed-forward at every byte is
   what makes byte-level encoders expensive. Blink runs one cheap
   full-resolution stem, pools by the stride, and only then pays for the
   blocks. A 512-byte state is 64 positions before any block executes.
3. **State and question are encoded separately.** Reusing an encoded state is
   therefore *exact*, not approximate: `tests/c/test_session.c` checks it with
   `memcmp`.
4. **Queries are conditioned on the question.** An option query built from
   the option text alone lets the question reach the score by one indirect
   route: the keys and values it adds to the shared context. Blink additionally
   modulates each option vector with a summary of the question, which gives the
   two a direct place to meet. A three-run ablation finds **no demonstrated
   effect** at this scale — between-seed spread exceeds the gap between the
   arms — so this is a motivated design choice, not a measured win. The table
   is in [docs/RESULTS.md](https://github.com/sqliteai/blink/blob/main/docs/RESULTS.md#the-film-ablation-still-undecided).

---

## Memory

**Blink allocates no memory while scoring.** Its memory comes in three parts,
and the third is zero:

- **Weights** — mapped read-only, never copied, shared by every process and
  every session.
- **Session arena** — one contiguous block whose size is a pure function of the
  model and the limits you declare. `blink_session_size` tells you the number
  and `blink_session_init` places the session in a buffer you own: a static
  array, a stack frame, a pool.
- **Scoring** — **no allocation at all.** `tests/c/check_no_malloc.sh` asserts
  that `blink_runtime.o` and `blink_kernels.o` reference no allocator symbol.

`examples/embed_static.c` is the whole pattern in 100 lines with no heap.

These guarantees describe the default build. The W8A8 backend keeps all of
them except exact agreement with the W8A32 definition. The Accelerate backend
trades two of them for speed.

### W8A8 backend (SDOT / I8MM)

`make W8A8=1` builds into `build-w8a8/`, with the activations quantized to
int8 too. Each input row of a projection gets its own scale and the product
becomes an exact integer sum. It runs on SDOT. I8MM is chosen at run time on
non-Apple cores that have it; on Apple silicon it measured level with SDOT
and would need an extra copy of the weights, so SDOT stays the default there
(`BLINK_W8A8_KERNEL=scalar|sdot|i8mm` overrides the choice). On
a CPU without either, a plain integer loop computes the same thing.

| 4 options, p50 | default | W8A8 | speed-up |
| --- | --- | --- | --- |
| blink-tiny, fresh decision, 256-byte state | 406 µs | 221 µs | 1.8× |
| blink-tiny, state reused | 54 µs | 33 µs | 1.6× |
| blink-small, fresh decision, 512-byte state | 4.29 ms | 1.45 ms | 3.0× |
| blink-small, state reused | 314 µs | 115 µs | 2.7× |

What it keeps: nothing allocates while scoring, a cached state is reused
exactly, a batch is bit-identical to single questions, and the scalar, SDOT
and I8MM kernels are bit-identical to each other. What it changes is the
model, since activations are rounded to 8 bits. On all 15 published models,
top-1 moved by −0.15 to +0.42 points and calibration did not change. The
decisions that flip are near-ties, almost all in task families the model sits
at chance on
marcobambini60
🟧 echo.github ⭐Blink returns probabilities over caller-declared options without token generation; the repository reports strong form-based task results butSQLiteAI——
🟧 hnBlink: An Embeddable Jev Enginemarcobambini10
🟧 hnBlink – Embeddable one-pass typed decision in 33 µsmarcobambini10

Interpretation history

Decision trace