01/05#enrg-0001/052026Sole engineer
Enargeia: Inference in the browser
Browser-native LLM inference engine in WGSL compute shaders. Zero server cost.
- tok/s at 2048 ctx
- 43.1
- weights resident
- 334.9 MiB
- compression
- 5.63×
- server cost
- $0
How it works, in 4 steps
- int4 weights, int8 embedding and head: 1884.6 MiB at fp32 becomes 334.9 MiB resident.
- Each token is one pass up through 24 layers: 460 WGSL compute dispatches, in order.
- Decode holds 43.1 tok/s at 2048 context, flat across context length.
- The visitor’s GPU does the work, so serving costs nothing beyond static files.
Notes
Enargeia runs Qwen2.5-0.5B-Instruct entirely in the browser. The visitor’s GPU does the inference, so serving it costs nothing beyond static files — no server, no API key, no per-token cost. Every kernel is WGSL running on WebGPU. Generating a token is one pass up through the model’s 24 layers, 460 compute dispatches in order (412 where the GPU lacks shader-f16), and every one of them runs on the machine in front of you.
The model is quantized to int4, except the tied embedding and LM head which ship at int8 — 334.9 MiB resident against 1884.6 at fp32, for 13.5% worse perplexity. Decode runs at 45.5 tokens a second at 512 context and 43.1 at 2048, flat across context length. Time to first token is 219 ms on a short prompt. Cold load over the CDN is 14.6 seconds; warm is 1.4.
Measured on an Apple M2 with a 10-core GPU, headless and with nothing else on the GPU; a foreground tab shares it with the compositor and reads about 15% lower: 38.2 tokens a second on the live site.
Built with
- WGSL
- WebGPU
- TypeScript
- Qwen2.5-0.5B