AI in a QR code

Scan the QR. The model is in the URL.

A binary SMS spam classifier — vocabulary, int8 weights and accuracy — packed into the URL fragment. No server, no weights file; the page decodes the model and runs it locally.

Scan me

QR code containing the SMS spam model

The QR is 153×153 modules (version 34, error correction L). Scanning opens this page with the model in the URL. Point a phone camera at it, or open the PNG.

Model: 1,579 bytes of JSON, 2,158-byte URL, 160 words, 93.5% on 1,115 held-out SMS messages.

What is in the QR?

The fragment carries a base64 JSON with the label names, the 160-word vocabulary, 320 int8 weights and two scales. The page decodes it with atob and a Map; the classifier is a dot product. There is no training data and no network call after the page loads.

This is the extreme end of the minimum-bit ladder: a model that fits in a URL. The 130 KB page stores data; the 1.7 MB page stores weights; this one stores quantized weights in the link itself.

—
—
—
—

Try it

Where is the model?

In the URL after #m=: base64 JSON. The page never calls the network after loading. Copy the URL or scan the QR to move the whole classifier.

← the 130 KB data artifact · the 1.7 MB accuracy mode · the 3.7 KB PDF card · make your own

Built with stream-finetune. SMS Spam Collection; Complement NB; int8 weights.