Skip to main content

Guides

Chat With PDFs Locally

For one PDF, try an attachment in LM Studio. For a collection you want to search again, use a document workspace. Ask for a passage you can locate by hand.

By Updated 17 min read

You can chat with PDFs locally, but the best setup depends on what you mean by “locally.” The easiest path for most beginners is LM Studio document chat because it gives you a desktop interface for attaching PDFs without building a full retrieval stack. The most flexible local workspace is usually Open WebUI with Ollama, especially if you want a browser-based interface, reusable document collections, and a ChatGPT-like local workflow. AnythingLLM Desktop is also a good document workspace.

To get started:

  1. Install LM Studio.
  2. Download a local model that fits your machine.
  3. Attach a PDF in the desktop app and start asking questions.

Use a local model, and a local embedding provider if the app uses document search, with no cloud providers active.

Quick answer

The easiest way to chat with PDFs locally is to use a desktop interface app that supports direct document attachments. Start with LM Studio for the simplest one-off desktop workflow. Use Open WebUI with Ollama if you already have Ollama installed and want a browser-based local workspace. Use AnythingLLM Desktop if you want a document-oriented local workspace and are willing to carefully check provider and telemetry settings. Avoid building your own retrieval-augmented generation (RAG) workflow, which searches document passages and supplies them to the model, unless you are comfortable managing embeddings, vector storage, chunking, and retrieval failures yourself.

Ollama's Windows and macOS desktop apps also accept text and PDF attachments. Choose a downloaded local model, keep the file within usable context, and check the extracted text and answer against the file. For a reusable document collection or more retrieval controls, compare Open WebUI, AnythingLLM, or another supported document workspace. Native desktop attachments do not give persistent indexing or a first-party Linux graphical upload path.

Best local PDF-chat options

Best forWorkflow
One PDF in a desktop chatAttach it in LM Studio, or in Ollama’s Windows/Mac desktop app.
One person reusing a set of sourcesCreate an AnythingLLM Desktop workspace.
Several users or a browserUse an Open WebUI collection and inspect access permissions.
A folder of files in a desktop appGPT4All LocalDocs links a folder of local documents to a collection. Its Use Nomic Embed API setting, off by default, instead creates collections off-device through Nomic's service, so check that it is off before you index sensitive files.

Choose a model for documents

For a first text-based PDF, investigate a supported instruction model such as Qwen3-4B at four-bit compression on a smaller computer, or Qwen3-8B when the exact file and context fit. Their original model cards use Apache 2.0; check the card and license for the exact download you select, especially a separately published conversion or fine-tune.

Use the memory calculator with the exact model file, app, context, and separate RAM or GPU-memory capacities. Its estimate covers the text model only; leave additional room for PDF extraction, OCR, an embedding model and a document index. Use the worked memory examples to see which inputs determine a fit and why missing hardware information prevents one. A larger model can still give the wrong answer when the app retrieves the wrong passage. Increasing context also uses memory, so do not select a maximum advertised window merely because you have a long PDF.

An ordinary text model answers from text the app supplies; it cannot read a scanned page or repair a broken table. If the PDF contains images instead of selectable text, add a local OCR step or a supported vision workflow, and check its extraction against the original. A vision download needs additional files and memory, unlike the text-only Qwen3 downloads above.

Test a document answer before expanding the collection

Start with a harmless one-page file whose content you know. Create a one-page PDF with selectable text: “Cedar meeting. The meeting starts at 10:30 on Tuesday in Room 4.” Open the PDF and copy that sentence into a text editor to confirm it has a text layer. Attach it in a new local chat.

Ask when and where Cedar meets. Require Tuesday, 10:30 and Room 4, then open the supporting sentence. Ask for the catering budget. A pass says the file supplies no amount. If a real document fails, first check whether its text was extracted, then whether the supporting passage reached the model.

Then try a question requiring two different sections of your real document, preserving both the main rule and any exception or cross-reference.

For planning, the token counter can help estimate the text you intend to supply. A retrieval app sends only selected passages plus its own instructions. In LM Studio, you can include short documents in full, while larger ones use retrieval. Attaching the whole file does not mean the model receives every line.

Success means the app supplies usable source text, the answer preserves its material meaning, and you can verify the cited support. For missing passages or invented facts, use the PDF diagnostic and answer-quality checks.

Before you upload a PDF: privacy checklist

CheckWhy it mattersWhat to do
Is the selected model local?A local interface can still send prompts to a cloud model.Confirm the provider is Ollama, a local LM Studio model, or another local runtime.
If document search is used, is its embedding model local?Search may process document text before the answer model receives it.Confirm that any embedding provider used by this workflow is local, not a hosted API.
Is web search off?Web search may send queries or context outside your machine.Disable web search for sensitive documents.
Is the server localhost-only?Exposed local servers change the risk profile.Avoid binding to 0.0.0.0 unless you know what you are doing.
Where are documents stored?Uploaded PDFs, parsed text, and embeddings can remain on disk.Locate the app’s storage folder before testing confidential files. Check full-disk encryption, screenshots and logs.
Is telemetry checked?Some desktop apps collect limited usage data unless changed in settings.Review the app’s privacy settings and policy.
Are cloud API keys configured?If a cloud key is active, the workflow may not be local.Remove or disable cloud providers before a private test.
Is the PDF born-digital or scanned?Scanned PDFs may need OCR before RAG works.Test with a non-sensitive sample first.

Hardware fit for local PDF chat

PDF chat adds file-processing work and document text to the model's context. A search workflow may also split the text into chunks, create embeddings and retrieve passages. A short attachment can instead fit directly in the conversation. The model and the text actually supplied still need to fit the available memory and usable context.

Hardware tierPractical expectationRecommended first path
8 GB RAMExperiment with small models and short, clean PDFs. Avoid large document sets and long context.LM Studio with a small model, or skip local PDF chat until you upgrade.
16 GB RAMReasonable beginner tier for 7B/8B-class models and short to medium born-digital PDFs.LM Studio first; Open WebUI + Ollama if you are comfortable with setup.
32 GB RAMBetter fit for local document workflows, larger context, and reusable knowledge bases.Open WebUI + Ollama or AnythingLLM Desktop, depending on preferred workflow.
Dedicated NVIDIA GPU with 8 GB VRAMGood for 7B/8B text models; watch context length and model size.LM Studio or Ollama with Open WebUI.
Dedicated NVIDIA GPU with 12 GB VRAMStart with an 8B model. The documented Qwen3 14B Q4 example fits at 4,096 tokens with about 1.6 GiB left, but document processing and longer context use that room quickly.Check the 12 GB memory example before raising the context or trying CPU offload.
Dedicated NVIDIA GPU with 16 GB VRAMA short-context 14B candidate has more room, but long context and other document components need their own allowance.Compare the 16 GB memory examples, then try one small PDF in the selected app.
CPU-only laptopPossible but often slow. Use small models and small PDFs.LM Studio for easiest test; avoid large document sets.

If your first PDF-chat test is slow, common causes are a model that is too large, too much retrieved context, a scanned PDF, too many chunks, missing GPU acceleration, or an embedding model running slowly on CPU.

Path 1: Chat with a PDF in LM Studio

Use this path when you want the simplest local PDF chat workflow.

Requirements

  • LM Studio installed.
  • A local model downloaded.
  • Enough RAM or VRAM for the selected model.
  • A test PDF that does not contain sensitive information.
  • Internet access for model download and update checks before you test offline behavior.

Steps

  1. Open LM Studio.
  2. Download a model that fits your machine. For a first test on a 16 GB machine, start with a 7B/8B-class model or smaller rather than a large model.
  3. Create a new chat.
  4. Attach or drag in a non-sensitive PDF.
  5. Run the Cedar check.
  6. Disconnect from the internet and repeat the same harmless prompt if you want to test offline behavior after the model has already been downloaded.

What to test

TestGood signBad sign
Scanned PDFThe app can extract text or clearly fails.The app confidently answers from missing text.
Offline rerunThe same local workflow still works after downloads.The app requires cloud access for document processing.

Local processing and storage

LM Studio’s official offline documentation says document chat/RAG can run without internet once the model files are present. That means documents dragged into LM Studio stay on the machine and are processed locally.

Path 2: Chat with PDFs in Open WebUI with Ollama

Use this path if you already have Ollama and Open WebUI running and want a local browser workspace.

Open WebUI 0.13.4 replaces Direct Connections with Tether. Tether 0.1.14 or newer connects models on a user-owned host; MCP requires Tether 0.1.16 or newer, and an administrator must enable tool servers (ENABLE_TOOL_SERVERS). Model inference stays on the connected machine while chats, uploaded documents and indexes remain on the Open WebUI server. Release notes.

AnythingLLM 1.20.0 adds a Chrome sidebar for chats and explicitly selected page text or images. Full functionality requires both the server and extension at 1.20.0 or newer. Selected browser context goes to the connected workspace; the workspace's selected chat and embedding providers still determine where inference and indexing run. MCP identity forwarding is opt-in per server; enable it only where the server needs that identity. Release notes.

Complete local-document setup: Open WebUI with Ollama

Use the standard image and persistent open-webui volume in the installation guide, with Ollama and Open WebUI on the same computer. Install the current release using the Open WebUI guide.

  1. While online, download your chosen chat model and a separate document-search model with ollama pull nomic-embed-text. The latter creates search vectors, not chat answers. Confirm both appear in ollama list.
  2. As administrator, open Settings → Admin → Documents. Set the embedding engine to Ollama, choose nomic-embed-text, and save. Use the same reachable Ollama connection configured for chat; a Docker container cannot reach host Ollama through its own localhost.
  3. Keep content extraction on the built-in/default local extractor for this born-digital PDF trial, with external extraction services and hybrid-search reranking disabled. Use local storage and the default local vector database. In the Docker recipe, uploaded files, database and search data live under /app/backend/data, persisted in the named open-webui volume. They remain after a chat is closed.
  4. Create the Cedar sample PDF from the test above. Do not start with a scanned document.
  5. In Workspace → Knowledge, create a collection named Cedar trial and upload the PDF. Wait for processing to finish without an error. Inspect the extracted/indexed text and confirm the sentence survived extraction before diagnosing the model.
  6. Start a fresh chat, select the downloaded Ollama chat model, and use # to attach Cedar trial. Use focused retrieval with File Context enabled and the legacy/default function-calling mode for this first trial, so retrieval does not depend on the small model choosing a tool call.
  7. Run the Cedar check. Open the cited passage rather than trusting the citation label.
  8. After the initial downloads and successful indexing, disconnect external networking and repeat with a new chat and a newly uploaded harmless file. This checks extraction and embedding availability as well as generation. Delete the trial collection and uploaded file through the app when finished; review retained chats and backups separately.
  9. For a knowledge collection, also test a conflict between two files: “Compare Document A and Document B on [specific issue].”

For a one-off attachment, upload the PDF directly in chat instead of creating a collection, then apply the same known-answer checks. Changing the embedding model requires rebuilding existing search vectors. Use Admin → Documents → Reindex for knowledge collections; re-upload standalone chat files. Re-index to apply new chunk settings to existing collections, and re-upload when changing extraction because re-indexing reuses extracted text.

Open WebUI settings to understand

Setting or conceptBeginner meaningWhy it matters
File ContextWhether attached files are processed and injected into the conversation.If disabled, the model may ignore uploaded files.
Builtin ToolsWhether the model receives tools to query knowledge bases or files.Smaller/local models may not use tools reliably.
Chunk sizeHow documents are split before retrieval.Bad chunking can hurt retrieval and citations.
Embedding modelThe model used to turn text chunks into searchable vectors.If this is cloud-hosted, document text may leave your machine.
Context lengthHow much retrieved text can fit in the prompt.Too little context can make the model miss key sections.
Persistent volumeWhere Docker stores Open WebUI data.Without persistence, uploads and indexes may disappear.

Path 3 overview: Chat with PDFs in AnythingLLM Desktop

Use this path when you want a local document workspace.

Requirements

  • AnythingLLM Desktop installed.
  • A local LLM provider selected if privacy is the goal.
  • A local embedding provider selected if you want document embeddings to stay local.
  • A test PDF.
  • Telemetry and storage settings reviewed.

Steps

  1. Open AnythingLLM Desktop.
  2. Confirm the selected LLM provider is local.
  3. Confirm the selected embedding provider is local.
  4. Create a workspace or chat.
  5. Add a non-sensitive test PDF.
  6. Decide whether you are attaching the file for direct chat context or embedding it into a reusable workspace.
  7. Ask known-answer questions and negative-control questions.
  8. Check the local storage folders if you need to know what remains on disk.

Local processing and storage

AnythingLLM’s Desktop storage docs identify local folders for extracted document text, search indexes, local models, uploads, activity records, plugins, and the app database. Uploaded files and extracted text remain on disk until you delete them through the app or storage layer.

OCR and scanned-PDF caveat

Born-digital PDFs are much easier for local PDF chat than scanned or image-heavy PDFs. A born-digital PDF contains text that the app can usually extract. A scanned PDF is often just images of pages. Unless the workflow runs OCR, the model may receive little or no usable text. Tesseract does not accept PDF input directly. Convert scanned PDF pages to supported image files before using Tesseract, or use OCRmyPDF to add a searchable text layer to the PDF. You can also check whether your PDF app includes local OCR.

A local PDF chatbot reads scanned contracts, invoices and image-heavy reports poorly without OCR.

Accuracy checklist

Compare apps with the same Cedar check.

A good local PDF-chat setup should say “I do not see that in the document” when the answer is not present. If the model invents an answer, change the model or retrieval settings.

When the right passage is retrieved but ranked too low, a reranker such as Qwen3 Reranker 0.6B can re-order the retrieved passages before the answer model sees them; it scores each passage against the question and does not write answers. If you need to search screenshots or images alongside text, the search step needs a multimodal embedding model such as Qwen3-VL Embedding 2B, which handles text, images and screenshots; check that your app supports it.

Troubleshooting local PDF chat

ProblemLikely causeFix
PDF uploads but the answer ignores itFile context, RAG, or document selection is not activeConfirm the file is attached or selected; check File Context/RAG settings
Scanned PDF produces nonsenseThe PDF is image-only or OCR failedRun OCR first or test with a born-digital PDF
Open WebUI cannot use documents offlineEmbedding model or parser dependency was not pre-downloadedPre-download the local embedding model and test offline again
Docker data disappears after restartMissing persistent volumeConfigure persistent storage for Open WebUI
Answers hallucinateRetrieval missed the right chunk or context is too shortAsk narrower questions, improve chunking, increase context if hardware allows, or use a stronger model
Model is too slowModel is too large, context is too long, or workload is CPU-onlyUse a smaller model, reduce context, or use a machine with more RAM/VRAM
App used a cloud model by mistakeWrong provider selectedSwitch to a local provider before uploading documents
Open WebUI cannot see Ollama modelsConnection or OLLAMA_BASE_URL issueRevisit Open WebUI with Ollama
Citations look wrongRetrieval/citation layer is imperfectCheck the quoted source
Upload/extraction failsParser error, unreadable text layer or unsupported fileInspect the processing error and extracted text; try a small born-digital PDF or local OCR, then re-upload
Indexing stalls or exhausts memoryToo many chunks, excessive overlap or large embedding batchesInspect chunk count; reduce overlap or embedding batch size. Smaller chunks can increase the count; re-index existing collections after changing chunk settings
Answer request exceeds contextRetrieved passages plus chat exceed the selected contextRetrieve fewer passages or narrow the question; increase context only if memory permits

FAQ

Can I chat with PDFs locally?

Yes. Use a local model plus a document-capable app such as LM Studio, Ollama's Windows or macOS desktop app, Open WebUI, or AnythingLLM Desktop. The model provider, file processing and document storage must stay local, along with embeddings and retrieval if used. Test the complete workflow with outbound access blocked.

Is LM Studio enough for local PDF chat?

For simple one-off document chat, usually yes. LM Studio is the easiest first path because it supports document chat in the desktop app. For reusable knowledge bases or more advanced RAG controls, Open WebUI or AnythingLLM may be a better fit.

Do I need Ollama to chat with PDFs locally?

Not always. LM Studio can run local models and chat with documents without Ollama. Ollama is useful when you want a local model runtime that connects to apps such as Open WebUI or other RAG tools.

Does Ollama support PDF chat by itself?

Yes, its Windows and macOS desktop apps accept text and PDF attachments. It does not give a reusable indexed collection. Choose a local model, keep the file within usable context, and check the answer against it. Scanned PDFs still need usable extracted text or a suitable OCR workflow.

Does local PDF chat work offline?

It can work offline after setup if you've already downloaded the model, app and required runtimes, plus any embedding model used by the selected workflow, and the workflow doesn't rely on cloud providers, web search, remote files, or hosted embeddings. Test offline with a harmless file.

Does it work with scanned PDFs?

Try selecting a sentence and copying it into a text editor. If the page looks correct but the text is empty or scrambled, OCR a sample page, inspect the amount and decimal point against the scan, then re-import the corrected file.

Sources