Keep It Local: RAG Without the Round Trip
summary
Builds a full RAG stack that runs entirely on-device: a build-time pipeline turns markdown help docs into 400-token chunks, weights title/alias, and writes a single BM25 index file shipped as an asset; retrieval is ~5 ms and top passages are ranked to avoid prompt stuffing. Generation uses Google’s LiteRT LM with small models (example: a 2.7 GB Gemma 2B runs ~52 tokens/sec, first token ~0.3s, full answers ~2s on phone GPU). Repo and ~1,800-line package exist and the demo runs offline.
AI-written summary · about
