Tesseracted Labs GmbH
LLM.OS — wasmPYTHON RUNNING
001LLM.OS / local inference

A language model,
compiled to WebAssembly.

The terminal above is not talking to a server. The model's weights are downloaded once, kept in your browser's cache, and every token is computed on your CPU by a WebAssembly module of about 76 KB. No GPU code, no inference API; what you type and what the model answers never leave the tab. The one exception is /search, which sends a search query out, and only after you confirm it.

~39tok/sQwen3.5-2B, 8 threads, Apple M3 Max
~124tok/sQwen3-0.6B, same machine
~76KBinference engine (Zig → wasm32; 76–82 KB depending on the build)
0servers or GPUs involved in inference

What is running

Speed against native llama.cpp

Tokens per second while generating: same weights, same machine (Apple M3 Max, 10 performance + 4 efficiency cores). "This page" is headless Chrome; llama.cpp is native build 8660. Measured 27–28 Nov 2026.

modeldownloadthis page, 8 threadsllama.cpp CPU, 8 threadsllama.cpp GPU (Metal)
Qwen3-1.7B Q4_K_M1060 MiB~5280147
Qwen3-0.6B Q4_K_M382 MiB~124163242

So the browser reaches roughly 65–75% of native llama.cpp on the CPU when generating. Reading the prompt is where it is furthest behind: llama.cpp processes prompt tokens in batches (513 tok/s for the 0.6B model), this engine does them one at a time (about 160 tok/s).

The Qwen3.5 models, same machine and 8 threads: about 39 tok/s for the 2B and 74 tok/s for the 0.8B. They are slower per parameter here because their vocabulary is larger (248,320 tokens against 151,936), and I have not benchmarked them against llama.cpp.

Your own numbers appear in the terminal after every reply; type /bench for a fixed test and /numbers for the Qwen3 comparison as a chart.

What 4-bit costs

Share of next-token predictions that stay identical to the full-precision model (Qwen3-0.6B, 645 tokens of mixed English, German, code and chat):

weightssizesame top prediction
8-bit (llm.asm Q8_0)614 MiB98.5%
Unsloth Q6_K472 MiB96.8%
Unsloth Q5_K_M424 MiB94.7%
Unsloth Q4_K_M (used here)378 MiB90.6%
Unsloth Q4_0364 MiB84.4%
naive 4-bit rounding (size estimated)~340 MiB81%

Generic compression helps little: zstd at its highest setting shrinks the 8-bit file by about 6%.

How the model plays a game 60 times a second

Type /invaders or /bricks and the same model that takes seconds to write a reply picks a button for every frame of a game, in 5 to 15 milliseconds. The weights and the engine are the same. The speed comes from what is not computed.

  1. A decision is a classification, not a reply. The model reads the situation and stops. The answer is whichever of four one-token labels (left, right, fire, wait) scores highest at the last position. Nothing is sampled and no text is written.
  2. Four rows of the output layer instead of all of them. To write a token, the last step scores every entry of the vocabulary: 151,936 rows for Qwen3, 248,320 for Qwen3.5. A decision computes the four rows of its labels.
  3. The rules are read once. The instructions and ten worked examples, about 180 tokens, are read when the game starts and the model's state at that point is saved. Every decision starts from there.
  4. Only what changed is read again. The model is told the situation in six tokens, for example shot none, target left =>. From one frame to the next usually only the last word changes, or nothing. With a KV cache the earlier tokens are still valid, so the engine goes back to the first token that differs: on average 1.8 of the 6 tokens. The answers are identical to reading all six again; a test checks that.
  5. Qwen3.5 needs a different trick. Three of every four of its layers keep a recurrent state instead of a cache, and a recurrent state cannot step back one token. So the engine saves the state partway through a line, in one of four slots; a later line that starts the same way begins from its slot.

What is left is close to the cost of the tokens themselves. On Qwen3-0.6B a decision costs about 2.5 ms per token read, and the length of the saved instructions hardly matters (the same decision took 15 ms after 62 tokens of instructions and 20 ms after 358).

model, playing /invadersevery token, every frameonly what changeddecisions per secondfollowed the rules
Qwen3-0.6B17 ms7.0 ms5698.7%
Qwen3-1.7Bnot measured14.4 ms49100%
Qwen3.5-0.8B19 ms8.3 ms6097.2%

Model time per decision in 30-second games, headless Chrome, Apple M3 Max, 8 threads, 28–29 Nov 2026. The game advances one frame per decision and is capped at the screen's refresh rate.

What the model is and is not doing

In the engine this is four small functions next to the generation loop: classify scores the labels, snapshot and restore save and return to the point after the rules, and classify_mark saves the mid-line point for the recurrent models.

Limits