Most FAQ chatbots need a server and an API key. I wanted one that runs entirely in a browser tab — offline, private, and free to host. PocketBot is that experiment: fine-tune a small language model on a FAQ dataset, compress it aggressively, and serve it in the browser.
The model
I started with SmolLM2-135M, a 135M-parameter model small enough to be practical in a browser. I fine-tuned it on FAQ-style question/answer data so it specializes in answering questions about one product or site, rather than trying to be a general assistant.
Compression: where it got interesting
At full precision the fine-tuned model reached 97.2% next-token accuracy on my evaluation set. Plain 4-bit rounding shrank it to about 89 MB but dropped accuracy to 88.8% — a real quality loss. Quantization-aware training (QAT) fixed most of that: training with the 4-bit constraint in the loop recovered accuracy to 97.0%, nearly the full-precision result, at the same ~89 MB size.
Running in the browser
The compressed model is exported to ONNX and runs with ONNX Runtime Web / WebGPU. No server, no API key, no data leaving the device. The page downloads the model once and answers locally.
Honest results and limits
On unseen questions, PocketBot answers roughly 8 of 12 correctly. The evaluation set is small, and the model is narrow by design — it knows its FAQ domain and little else. That trade-off is the point: a small, honest, deployable model beats a large one you cannot ship.
What I learned
Compression, evaluation, and deployment constraints are one problem, not three. QAT only helps if you measure the right thing, and "runs in the browser" forces discipline on size, latency, and failure modes from day one.
I wrote the full build log on my site: How I Built PocketBot. The code is open source on my GitHub: https://github.com/faizzyhon. A follow-up project, rihla-llm, extends this work to Arabic, Urdu, and English pipelines — also on faizzyhon.com.

