The Browser Cannot Tell You How Much Memory You Have
We wanted the chat page to suggest the right model for 8 GB and 16 GB laptops. Older Chrome caps navigator.deviceMemory at 8 (Chrome 155 reported 16 on a 16 GB laptop) and WebGPU reports no VRAM, so the page pre-selects a class, lets you change it, applies conservative budgets, and refuses to probe by allocating.
Summary
A model that fits one laptop swaps or fails to load on another. We wanted the on-device chat page to pick the right model automatically. The signals the browser exposes are weak: navigator.deviceMemory was capped at 8 in older Chrome (it reported "8" for 8 GB or more), WebGPU limits describe buffer sizes, not installed or video memory, and on Apple silicon memory is unified with the system. We detect what we can (adapter name, subgroup support, thread count), and ask the person for their memory class.
The suggestion rule
Each class has an estimated budget for weights plus cache that one tab can hold, minus 0.35 GB for the KV cache and scratch. The page suggests the highest-ranked model whose weights fit.
| computer memory | estimated budget | suggested model |
|---|---|---|
| 4 GB or less | 1.0 GB | Qwen3 0.6B (0.61 GB) |
| 8 GB | 3.0 GB | Qwen3 1.7B (1.77 GB) |
| 16 GB | 7.5 GB | MedGemma 4B (3.24 GB) |
| 24, 32, 64 GB | 12, 18, 40 GB | the largest we have (currently the same 4B) |
The budgets are estimates. The 16 GB figure is our working number from a single swap event, and the 8 GB figure is scaled from it. The page says so, warns when the loaded model exceeds the class budget, and never loads a different model on its own.
Gotchas
Do not probe by allocating. Growing GPU buffers until something fails would find the real limit and could also push a machine into swap. We refuse to do it.
No WebGPU subgroups means no model. The engine needs them, so the suggestion says that instead of picking something that cannot run.
Test the logic without a browser. The rule is a pure function tested in node against the real model catalog, including that sizes match the registry bytes and that a bigger class never picks a lower-ranked model.
Not yet validated on real 8 GB hardware. The budgets and the page behaviour are checked in tests; the 8 GB class has not been tried on an 8 GB machine.
Key takeaways
- Treat browser memory signals as hints; ask the person when the stakes are a swap storm.
- Keep detection and recommendation separate, and make the recommendation a tested pure function.
- Label the budgets as estimates in the interface.
- Never let a suggestion switch models without a click.
Correction (2026-10-17, same day)
The cap described above applies to older Chrome. We measured Chrome 155 on a 16 GB MacBook Air and navigator.deviceMemory returned 16, so newer versions report larger values. The page now trusts values above 8 and snaps them to a memory class, keeps 8 as "8 GB" because it may be a capped report, and still lets the person change the class. Nothing else here changes: the value is an approximation, it says nothing about a PC's separate graphics memory, and the budgets remain estimates.
Follow @robotnurseio on X for the short version.
Everything in these notes I also do for hire: local AI set up on hardware you own, configured on-site, then handed over with enough documentation that you do not need me afterward. If that sounds more useful than another weekend of reading forum threads, the details are at /work. No obligation from an email, and the posts stay free either way.