romanI04/sift: Semantic search for static sites. No server required.


CI
PyPI
npm
license

Semantic search for static sites. Two commands to install, zero servers to run.

sift vs keyword search

Install the CLI and index your docs:

pip install sift-search
sift index ./docs -o public/sift-index.db

Add the widget to your site:

script type="module" src="https://cdn.jsdelivr.net/npm/sift-search@latest/dist/sift-search.js">script>
sift-search db="/sift-index.db">sift-search>

Visitors get semantic search. No backend. No API keys. No monthly bill.

Build time: sift index reads your markdown, splits into chunks, and computes embeddings with all-MiniLM-L6-v2 (ONNX). Output is a single SQLite file.

Runtime: The browser loads the SQLite file via HTTP range requests — no full download needed. Keyword results appear instantly via FTS5. Once the ML model loads client-side (~2s), results upgrade to semantic.

No server. The index is a static file. The model runs in the browser via Transformers.js. Deploy on Netlify, Vercel, GitHub Pages, Cloudflare Pages, or any static host.

Keyword search needs exact matches. Users don’t think in exact matches.

Search “how to protect my API” on FastAPI’s docs — keyword search returns the Alternatives page. Sift returns Security First Steps, OAuth2, and JWT.

See it yourself — side-by-side on FastAPI’s full docs (146 pages, 2,123 chunks).

sift doctor validates your index (14 checks). Dark mode with . 92KB JS bundle (gzip 27KB), plus on-demand WASM and model loading. Supports Chrome, Edge, Firefox (latest), Safari 16+.

Your static host must serve .db files without compression (breaks range requests). See the installation guide for header config.

Built on sql.js-httpvfs by phiresky, Transformers.js by Hugging Face, and all-MiniLM-L6-v2.

MIT



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *