Guide · updated 2026-11-27
How to ask questions of a PDF without uploading it anywhere
Three ways to chat with a PDF on your own computer: a desktop app, a page that runs the model in your browser, or two commands. Plus a test that nothing left.
You can ask questions of a PDF without it leaving your computer by running the whole job on your own machine: a program reads the text out of the file, a small language model on your computer answers from that text, and nothing is sent to a server. There are three ways to set that up. A desktop app with a built in local model needs no code and is the easiest. A web page that runs the model inside your browser needs no install, but only works in some browsers. A couple of command lines suit anyone already comfortable in a terminal. Each one downloads something once during setup, so the honest test is to turn the network off afterwards and ask again.
What does asking a PDF questions locally actually involve?
It involves the same steps a hosted assistant takes, done on your own hardware. The program pulls the text out of the PDF. If the file is long, it splits the text into short passages and builds an index so it can find the passages that match your question. Then it hands those passages and your question to a language model, which writes the answer.
Two parts of that need a download the first time. The language model itself is a large file. Many apps also use a second, much smaller model to build the index. In AnythingLLM, for example, the built in indexing model downloads on the first file you add, is about 25 MB, and runs on the processor rather than a graphics card (AnythingLLM documentation on its default embedder, read 2026-11-26). After those downloads, a properly local setup has no reason to touch the internet.
Short files often skip the index entirely. LM Studio's documentation on chatting with documents says a file short enough to fit in the model's working memory is added to the conversation in full, and only a long one is searched for relevant passages (read 2026-11-26). That matters for answer quality: when the whole file is in view, the model cannot miss a section.
Which route suits you?
Pick the row that matches how you work. The last two columns are the ones that decide whether your file stays private.
| Route | What you install | One time download | Works with the network off | Comfortable file sizes | How to confirm nothing left |
|---|---|---|---|---|---|
| Desktop app (GPT4All, AnythingLLM, LM Studio) | One app | A language model, plus a small indexing model in some apps | Yes, once the downloads finish | Short reports in full; long manuals and whole folders through the index | Turn Wi-Fi off and ask a new question; set the model provider to a local one; switch off any telemetry option |
| In the browser | Nothing | The model, saved in the browser's cache | Yes, if the page really runs the model on your device | Short to medium files; long files are slow and limited by your graphics memory | Turn Wi-Fi off after the model loads and ask again; watch the browser's Network panel while you ask |
| Code (Ollama plus a text extractor) | Ollama and a PDF to text tool | A language model | Yes | Whatever fits in the model's context; raise the limit for long files | You can see every step; nothing runs that you did not type |
If you have never opened a terminal, start with a desktop app. If you cannot install software on the machine, try the browser route. If you want to know exactly what is happening at every step, use the code route.
How do you do it in a desktop app?
Three desktop apps handle this well, and the steps are similar.
GPT4All is built around a feature called LocalDocs. GPT4All's LocalDocs documentation describes indexing a folder with on device embedding models and showing which files an answer drew on (read 2026-11-26). The steps:
- Set up GPT4All, then pick a model from the list it shows when it first opens.
- Open LocalDocs, choose Add Collection, and point it at a folder holding your PDF.
- Wait for the progress to show that embedding is complete. This happens once per folder, not once per question.
- Start a chat, open LocalDocs from the top right corner, and switch on your collection.
- Ask your question, then click Sources under the answer to see which file and passage it used.
AnythingLLM works in workspaces. You create a workspace, drag your PDF into it, and confirm the embedding step. Every chat in that workspace can then answer from every file in it, which suits a contract plus its amendments, or a folder of papers. It can run its own local model or connect to Ollama if you already use it. Its documentation also says it collects anonymous telemetry by default and that you can switch this off in its privacy settings (AnythingLLM privacy and data handling page, read 2026-11-26). Switch it off if the point of the exercise is that nothing leaves the machine.
LM Studio is the quickest for one file and a few questions. Download a model inside the app, start a chat, and attach the PDF. It accepts PDF, Word and plain text files. It does not keep a library of documents between chats, so it is less suited to a folder you come back to.
Whichever app you pick, check the model setting before your first question. Some document apps also offer hosted models from cloud providers, and choosing one of those sends the passages from your file to that provider.
Can it run in the browser with nothing installed?
Yes, on some browsers. A small number of PDF chat pages download a compact model into your browser and run it there using WebGPU, a browser feature that lets a web page use your graphics card. WebLLM, an open source engine built for this, describes running language models inside the browser with no server side processing (WebLLM project home page, read 2026-11-26).
Two limits apply. WebGPU does not work in every widely used browser yet, and it only runs on secure (HTTPS) pages (MDN Web Docs WebGPU API page, read 2026-11-26). The model also has to fit in your graphics memory, so browser models are small and long files are slow.
Be careful with the wording on these sites. A page can call itself private and still send your file to a server, so the word on a landing page proves nothing. A page that genuinely runs on your device will do a large download the first time, then keep answering after you turn the network off. Run the check in the section below before you give it anything sensitive.
How do you do it with a few lines of code?
The shortest code route is two commands: one turns the PDF into plain text, and one asks a local model about it. It suits a short to medium file and needs nothing beyond two free tools.
First install Ollama and download a model. The model name is an example; any model you have pulled works.
ollama pull gemma4
Then extract the text with pdftotext, which is part of the Poppler PDF tools. It comes with most Linux systems and installs on macOS with Homebrew.
pdftotext -layout report.pdf report.txt
Now ask your question with the text included. On macOS or Linux:
ollama run gemma4 "Answer only from the document below. If it does not say, reply that it does not say. Question: what is the notice period? Document: $(cat report.txt)"
On Windows in PowerShell, the same command reads the file a different way:
ollama run gemma4 "Answer only from the document below. If it does not say, reply that it does not say. Question: what is the notice period? Document: $(Get-Content report.txt -Raw)"
One setting catches people out. Ollama uses a context window of 4096 tokens by default, which is only a few pages of text, and anything past that is cut off without warning (Ollama FAQ, read 2026-11-26). The same FAQ shows how to raise it by starting the server with a larger value. On macOS or Linux, for example:
OLLAMA_CONTEXT_LENGTH=16384 ollama serve
On Windows, the Ollama app has a context length slider in its settings that does the same job (Ollama context length documentation, read 2026-11-26). A larger window needs more memory, so raise it only as far as your file requires. For files much longer than that, use a desktop app with an index instead of pasting the whole text in. If you want a chat window on top of Ollama rather than a terminal, self hosting Open WebUI with Ollama covers that setup, and it also runs on your own machine.
How do you check nothing was uploaded?
Test it, rather than trusting the description. These checks take a few minutes and work for all three routes.
- Finish setup with the network on, so every model is already downloaded.
- Turn off Wi-Fi or unplug the network cable.
- Open a new chat, add a PDF you have not used before, and ask a question about it.
- If you get an answer drawn from the file, the reading and the answering both happened on your machine.
- Turn the network back on and watch network activity while you ask another question. On Windows, open Resource Monitor and look at the Network tab. On macOS, open Activity Monitor and look at the Network tab. In a browser, open the developer tools and watch the Network panel.
The offline test proves the work can be done locally. It does not prove the app never sends anything once you reconnect, which is why the setting checks still matter: the model provider set to a local model, and any telemetry or usage sharing option switched off.
What do you give up compared with a hosted assistant?
You give up some answer quality, some speed and a little convenience, and you keep the file.
- The models that run on a laptop are smaller than the ones behind hosted assistants. They answer direct questions about a document well, and are weaker at long chains of reasoning across many sections.
- Without a graphics card, answers come out more slowly. Indexing a long file takes a while the first time, though only once. How much VRAM you need to run an LLM locally explains what your hardware can hold.
- Index based tools retrieve a few passages per question rather than reading the whole file, so a question whose answer is spread across the document can come back incomplete. Ask specific questions, and check the cited passage.
- Scanned PDFs have no text to extract until you run text recognition on them. Why an AI assistant makes things up about your PDF covers how to spot a scan and fix it.
- You do the setup and the updates yourself.
The same trade applies to audio. Transcribing audio without uploading it walks through the local route for recordings.
FAQ
Does a local document chat work on a laptop with no graphics card?
Yes. The indexing model in apps such as AnythingLLM runs on the processor, and its documentation asks for at least 2 GB of free memory for that step (AnythingLLM default embedder page, read 2026-11-26). The language model also runs on the processor, more slowly. Pick a small model and expect answers to appear at reading pace rather than instantly.
Can it read scanned PDFs?
Not directly. A scan is a picture of a page, so there is no text for the tool to extract, and some tools will then answer from nothing. Run text recognition (OCR) on the file first, then add the new copy. If you can select a sentence with your cursor, the file already has text.
Can I ask questions across several files at once?
Yes, with GPT4All or AnythingLLM. Point a GPT4All LocalDocs collection at a folder, or drag several files into one AnythingLLM workspace, and each answer can draw on all of them. LM Studio attaches files to one chat at a time and does not keep a library, and the two command route reads one file per question.
Is an app that offers cloud models still private?
Only while you use a local model in it. The app keeps your files on disk either way, but if you choose a hosted model, the passages it retrieves from your file are sent to that provider with your question. Check which model is selected before every sensitive question, and switch off telemetry where the app offers it.
Find a document chat tool that runs on your machine
Compare the tools for asking questions of documents, with a reason for and against each one, on the chat with documents use-case page. For the open source ones you can run yourself, see the open source tools for running models locally, including GPT4All, AnythingLLM and LM Studio.