Running LLMs Purely via WASM in the Browser
celsowm · reddit · 2026-07-15
This project turns LiquidAI's LFM 2.5-350M into an inference demo that runs entirely locally in the browser: no backend, no WebGPU dependency, executing directly via pure WebAssembly.
Key Implementations
- Hand-written WASM SIMD kernels covering gemm/gemv, GQA attention, conv, RoPE, etc.
- Model weights are 4-bit quantized (Q40), with attention projections using Q8.
- Supports batched prefill to avoid token-by-token prompt preprocessing.
- The frontend provides a chat UI, streaming output, a stop button, real-time tok/s, and markdown rendering.
Deployment
- Weights are hosted on Hugging Face: celsowm/lfm2.5-350m-wasm-q40
- The app is statically deployed on GitHub Pages.
- Upon page load, it fetches vocab/merges from Pages and weights from HF, running all inference locally.
The author also included links for the live demo, GitHub repository, and model weights.
More from Infra
- Meta approves nonvoting Class C shares as 2026 capex guidance hits $135B–$145B — thione · 2026-10-26
- Engineer with thousands of fabricated devices pours cold water on photonic crystal modulator yields — jwt0625 · 2026-10-26
- Anthropic S-1 reveals 48 cents of compute cost per dollar of Q2 revenue — nmasc_ · 2026-10-26
- Persistent AI joins UR network to route private AI inference with encrypted, IP-hidden traffic — 0xSammy · 2026-10-26
- Anthropic's disclosed compute commitments: $114.5B Google, $161.2B Broadcom top the list — BenBajarin · 2026-10-26
- SpaceX strikes $40B deal with Apollo Global to lease AI chips and data center hardware — Polymarket · 2026-10-26