GPU + CPU routing
Use WebGPU for suitable workloads; fall back cleanly when unavailable or more efficient.
A small, portable search engine for large collections. Run fuzzy and substring search on WebGPU when it helps, with a CPU fallback when it doesn’t.
import { SearchIndex } from 'webgpu-search';
const index = await SearchIndex.create(files);
const results = await index.search('auth controller', { mode: 'fuzzy' });
// GPU when useful. CPU fallback when needed.
Use the same API in browser apps, Web Workers, Node.js, and SSR. The library selects an execution path based on the device and search workload.
Same data, same search — timed live in your browser.
GPU acceleration is one part of a practical search API — not a requirement for every query.
Use WebGPU for suitable workloads; fall back cleanly when unavailable or more efficient.
Fuzzy, substring, token, prefix, typo tolerance, and autocomplete.
Normalize and match across scripts, including CJK text and emoji.
Worker support, cancellation, memory stats, timings, and persistence tools.
Runs on WebGPU at scale (30k+ items), uFuzzy on CPU when small or unavailable.
Stale searches are dropped mid-flight via AbortSignal and sequence tagging.
Binary encode and restore indexes; one shared GPU device across all of them.
Identical normalized scores on GPU and CPU. Zero runtime dependencies.
Bring your own UI. Keep the search engine framework-independent.
npm install webgpu-search