How it works

Chapter 4 of 6

In your browser: download, check and run

The model arrives in parts, and each part is checked before it is kept. A small C engine compiled to WebAssembly then does the arithmetic on your own processor.

Fig. 1Parcel line
SERVER00CACHE

Space or Right steps the run

first visit · 0 of 17 parts stored · 0.0 of 534.8 MiB

  • SHA-256 match, or a part held in the cache
  • a part of the model
Fig. 1 — Parcel line. Flyingkiwi 0.6B's weights arrive as 17 parts, each checked against its SHA-256 fingerprint before it is kept in the browser's Cache Storage; later visits read the parts from there and check them again, and only a part that fails its check is downloaded again. The pins and ridges are an illustration of that comparison, not a model of the hash itself.
Fig. 2Row stamper, one head or six
1row 1

Space: 1 or 6 threads · Right: step

6 threads · 16 numbers per instruction · rows done 0 of 32

  • row being stamped now
  • stamped so far
Fig. 2 — Row stamper, one head or six. One WebAssembly instruction multiplies and adds 16 eight-bit numbers at once, and up to six threads each take the next rows from a shared counter (the rows drawn are a few of the real ones). On one laptop with six threads, Blazing Kiwi wrote 98–127 tokens per second.

In numbers

17

Parts of up to 32 MiB

Flyingkiwi 0.6B English: 560,823,360 bytes of weights, three parts at a time.

SHA-256

Checked for every file

Against the size and fingerprint in the manifest, when downloaded and when read back.

16

Numbers per instruction

One WebAssembly SIMD instruction multiplies and adds sixteen 8-bit numbers.

98–127

Tokens per second, Blazing Kiwi

Six threads on one laptop processor (AMD Ryzen 5 7530U) in Chrome.