02
LocalAI
Built by Ahmad Saad · 08.2026 - Present
Private AI for company documents that runs entirely in the browser, with page-level citations and a Playwright audit that proves nothing leaves the device.

Overview
13 tools
LocalAI is private AI for company documents that Ahmad Saad has designed and built end to end since August 2026, and it runs entirely in the browser. Built after conversations with people who were barred from, or afraid of, putting work data into hosted AI: no server, no account, nothing leaves the device, and a Playwright audit proves it. Hybrid retrieval with a cross-encoder reranker, page-level citations, structured extraction, and a CI eval that scores 100% retrieval and 100% single-turn answers on an integrated laptop GPU.
The problem I found
Talking with people at different companies, I kept hearing the same thing. They were not allowed to put work material into ChatGPT or Claude, or would not do it themselves, because the data would go to a company they do not trust. So they either did not use AI at work or used it only for things that did not matter. The tools they could use at work did less than the ones they used at home.
What I did about it
I treated this as a discovery problem and gathered requirements from those conversations, the way a forward deployed engineer would on a customer site: nothing may leave the machine, and the person using it must be able to check that; self-hosting a model was not an option, so it could not become an IT project; it had to work for people who are not technical; it had to do real work over contracts, reports and handbooks and show where each answer came from; and it had to run on the laptops people already have.
What I built
LocalAI runs the language model, the embeddings and a cross-encoder reranker on the user's own GPU and CPU, inside the browser. There is no server, no account and no API key; the model weights download once and stay cached. You drop in a PDF, Word, text or Markdown file and ask in plain language. Every answer cites the file and page it came from, a /extract command pulls named fields under a JSON grammar so the output always parses, and follow-up questions are rewritten before retrieval. Privacy is enforced rather than promised: a strict Content Security Policy lets the page talk only to itself and the model-weight hosts, and a Playwright audit boots the app on a real GPU, indexes a document, asks a question, and asserts that no request left for any other host, none carried a body, and none contained document text.
How I measured it
I built a golden set of 49 questions over four generated PDFs and a Node eval that runs in CI, then compared eight embedders and five rerankers before choosing. The eval found and fixed three real bugs along the way (a rerank that was undoing retrieval, excerpt clipping that dropped the answering sentence for half the questions, and a prompt that fed the model its own earlier mistakes). On an integrated Intel laptop GPU, the slowest realistic case, retrieval puts the right excerpt in the prompt for 100% of questions and the default 1.5B model answers 100% of single-turn questions correctly. Every turn in the app reports its own latency and throughput.
Stack
TypeScript, React, Vite, WebLLM (WebGPU), Transformers.js (WASM), pdf.js, mammoth, IndexedDB, Vitest, Playwright, GitHub Actions, Cloudflare Workers.
My role
I designed and built LocalAI end to end. The repository is public and the live demo runs in any browser with WebGPU.
Ahmad Saad is an AI engineer and Computer Engineering senior at the American University of Sharjah (AUS).