Auto-detect client hardware capabilities and match against in-browser AI models across WebGPU, WASM, and ONNX Runtime.
3
stars
20
commits
TypeScript
primary language
Sep 9, 2026
updated
Check if an AI model fits the browser hardware (WebGPU, WASM, RAM, shader-f16).
https://github.com/user-attachments/assets/f4ceae3a-a2b3-4955-bec2-36de9238f56a
npm install browser-llm-fit
import fit from 'browser-llm-fit';
const res = await fit('SmolLM2-135M');
console.log(res.fits); // true
console.log(res.tier); // 'smooth'
console.log(res.speed); // '45-65 tokens/sec'
fit('model') tests a model against WebGPU buffer limits and VRAM. fit() returns all models sorted by device compatibility. That's the whole API.
import fit from 'browser-llm-fit';
const { hardware, models } = await fit();
console.log(hardware.webgpuDevice);
console.log(models[0].model.name, models[0].evaluation.score);
Returns detected adapter limits and catalog models ranked by compatibility score.
import fit from 'browser-llm-fit';
const res = await fit('Llama-3.2-3B', { ram: 4, gpu: 'wasm-cpu' });
console.log(res.fits); // false
Simulates low-memory phones, Chromebooks, or WASM CPU fallback without physical hardware.
npm run dev
Starts the local development server on http://localhost:5180.
MIT © Hemanth.HM
19 commits
1 commits
Hacker News (1)
TypeScript
49.1%
JavaScript
48.5%
HTML
1.2%
CSS
1.2%
Auto-detect client hardware capabilities and match against in-browser AI models across WebGPU, WASM, and ONNX Runtime.
3
stars
20
commits
TypeScript
primary language
Sep 9, 2026
updated
Check if an AI model fits the browser hardware (WebGPU, WASM, RAM, shader-f16).
https://github.com/user-attachments/assets/f4ceae3a-a2b3-4955-bec2-36de9238f56a
npm install browser-llm-fit
import fit from 'browser-llm-fit';
const res = await fit('SmolLM2-135M');
console.log(res.fits); // true
console.log(res.tier); // 'smooth'
console.log(res.speed); // '45-65 tokens/sec'
fit('model') tests a model against WebGPU buffer limits and VRAM. fit() returns all models sorted by device compatibility. That's the whole API.
import fit from 'browser-llm-fit';
const { hardware, models } = await fit();
console.log(hardware.webgpuDevice);
console.log(models[0].model.name, models[0].evaluation.score);
Returns detected adapter limits and catalog models ranked by compatibility score.
import fit from 'browser-llm-fit';
const res = await fit('Llama-3.2-3B', { ram: 4, gpu: 'wasm-cpu' });
console.log(res.fits); // false
Simulates low-memory phones, Chromebooks, or WASM CPU fallback without physical hardware.
npm run dev
Starts the local development server on http://localhost:5180.
MIT © Hemanth.HM
Hacker News (1)
19 commits
1 commits
TypeScript
49.1%
JavaScript
48.5%
HTML
1.2%
CSS
1.2%