Chat with Documents in LM Studio

Attach local documents in LM Studio, ask source-specific questions, and check answers against the original text.

By Chat Overview Published Updated
Document chat
Local model
Document
Question
Source check
Checked answer
  • Quote
  • Location
  • Missing text

Synopsis

LM Studio can answer questions about attached PDF, DOCX, and text files with a downloaded model. Short documents can fit directly into the conversation; longer documents use retrieval to select relevant passages. Retrieval does not guarantee that every page was searched successfully.

Prepare a local chat

Install LM Studio , download an instruction-tuned model that fits the machine's memory, and load it in the chat view. Finish downloading the model and its runtime before disconnecting from the network. Select a local model for local processing; cloud models and external tools have separate data flows.

Use a short, non-sensitive document for the first check. Save the following as project-notes.txt:

Project Cedar
The maintenance window starts at 21:30 UTC on Saturday.
The service owner is the infrastructure team.
The rollback deadline is 22:15 UTC.

Attach and ask

  1. Start a new chat with the loaded model.
  2. Drag project-notes.txt into the chat and wait for attachment processing to finish.
  3. Send a question that names the relevant subject:
According to project-notes.txt, when is the rollback deadline?
Quote the sentence that gives the deadline.
If the document does not contain the answer, say so.

The answer must identify 22:15 UTC and quote the corresponding sentence. Check the original file rather than treating a generated quotation as proof. Ask for the maintenance window next, then ask for an approval date that the document does not contain. An invented approval date is a failed check.

Use longer documents

Name the section, product, or term expected in the relevant passage. Check quoted text and page references against the source. A request to summarize an entire long document can miss material that retrieval did not select. For exhaustive review, work through sections separately.

If a scanned PDF produces missing or garbled text, extract readable text with optical character recognition before attaching it. Keep tables and headings understandable in the extracted version.