G-01 · AI · 3 min read

How to chat with a PDF without uploading it

Ask questions about a long PDF and get answers with page citations from an AI model that runs in your browser, so the document never leaves your device.

Fig. G-01 · AI

Most "chat with PDF" services upload your document to a server and send it to a large AI model. That is a problem for contracts, medical records, HR files or anything under an NDA. A small open model running in your browser can do the same job for most questions: it searches the document, reads the pages it needs and cites them, and the file never leaves your computer.

Step by step

  1. Open Chat with PDF and drop your file. PDF, text, Markdown, CSV, JSON and HTML all work, and you can paste text instead.
  2. The first time, the page shows the model it will use, its download size and whether your device can run it on the GPU. Click Download and run. The model is about 260 MB and is kept in your browser for next time unless you untick the box.
  3. Ask a question. A search over the document runs first; its results appear as a card you can open.
  4. Read the answer. Page references such as p. 12 are buttons: click one to see that page's text in the side panel.
  5. Ask follow-up questions. Older turns are folded into a short memory note so long conversations keep fitting in the model's context.

How a 350M-parameter model reads a 300-page PDF

Small models have small context windows, a few thousand tokens in practice, so the whole document can never be in view at once. Instead the model works like a researcher with an index:

  • search ranks short passages against the question with BM25, the classic keyword ranking used by search engines, and shows the best sentences with their page numbers.
  • grep finds every line with an exact term, such as a defined term, a section number or an amount.
  • read_page reads one page, in parts if it is long.
  • outline lists the headings with page numbers.

The model decides which tool to call, the browser runs it instantly, and the result is placed in the model's context. Each call is shown as a card with its arguments and output, so you can see what it read.

Tip Questions that name the thing you want ("termination notice period", "late payment interest") work best. Vague questions ("is this a good contract?") are beyond what a small model can judge.

What we measured

We tested the same task, finding a single clause on page 137 of a 200-page agreement, with four open models from 1,024 to 8,192 tokens of context. With the search-first design every model found the right answer at every size. Two details mattered most: running the first search before the model's first reply, and keeping excerpts short. Longer excerpts made small models more likely to quote the wrong sentence.

Limits

  • Scanned PDFs are pictures of pages with no text layer. The page warns you when most pages are empty; run them through OCR first.
  • A small model can misread. Always check the cited page for anything important.
  • For a whole-document overview rather than a specific answer, use the AI summarizer, which reads every part of the document.

FAQ

Common questions.

01Is my PDF uploaded anywhere?

No. The text is extracted by pdf.js in your browser and the model runs locally with ONNX Runtime. The only download is the model itself, from Hugging Face.

02Does it work offline?

Yes, once the model is stored in your browser. Load the page, disconnect, and ask away.

03Which model should I choose?

LFM2.5 350M is the fastest and the default. Qwen3 0.6B and Qwen3.5 0.8B give steadier answers on harder questions but are slower. On phones, stay with the smallest.