Running LLMs in the Browser: WebGPU vs WASM Benchmarks Reveal Surprising Limits
A developer tested running large language models directly in the browser using WebLLM and Transformers.js on Apple Silicon Macs, finding that browser storage quotas — not GPU power — are often the first barrier to deployment. On an 8GB MacBook Air with limited disk space, a 3.8B-parameter model (Phi-3.5-mini-instruct) failed to load entirely due to browser Cache API quota errors, regardless of storage strategy used. Benchmarks on a Mac Studio showed that for tiny models like GPT-2 (124M parameters), WASM outperformed WebGPU by roughly 12% due to GPU kernel overhead and data-transfer costs outweighing parallelization benefits. However, at the 3.8B scale, WebGPU was 119 times faster than WASM, completing 10 inference tasks in about 8 seconds versus nearly 14 minutes for WASM. The key takeaway is that developers targeting sub-1B models should prioritize checking users' available disk space before optimizing for GPU backend selection.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in