altra's profile picture
altra

document-parser

Public

Extract and search text from PDF, DOCX, spreadsheets, and plain-text files — entirely on your machine, no upload.

1.3K Downloads

3 stars

README

Document Parser Plugin for LM Studio — Local File Reader & Text Extractor

Local document ingestion for LM Studio. Extract text from PDFs, Word documents, spreadsheets, and plain text files — then search inside them by keyword or regex. No cloud upload, no OCR service, everything stays local with complete privacy. This LM Studio plugin processes all files offline with no external services.

Keywords: lm studio plugin, document parser, local pdf reader, extract text from pdf, word document parser, offline document processing, no cloud, private file reading


Who This Is For

  • Writers and researchers who need to extract and search text from local documents without uploading to any cloud service
  • Developers who want a local, private way to parse PDFs, Word docs, and spreadsheets inside LM Studio
  • Privacy-conscious users who need offline document processing with no API keys or external dependencies
  • Anyone who wants to search across document content using keyword or regex patterns directly from their LLM chat

What It Does

  • PDF parsing — full text extraction from PDF files via pdf-parse
  • DOCX parsing — Word document text extraction via mammoth
  • Spreadsheet parsing — Excel/CSV/ODS as Markdown tables, one per sheet, via xlsx
  • Plain text — direct read with encoding detection
  • Format auto-detection — detects format from file extension when not specified
  • Keyword / regex search — find patterns inside documents with surrounding context lines
  • Size protection — files over the configured limit are rejected before parsing

Installation

cd document-parser-plugin
npm install
npm run build

Load the built plugin folder in LM Studio.


Configuration

FieldDefaultDescription
Workspace Path(blank)Root directory for relative path lookups. Blank = absolute paths only
Max File Size (MB)50Files larger than this are rejected before parsing

Tools

parse_document

Extract full text from a document.

parse_document(path="/Users/me/docs/report.pdf")
parse_document(path="budget.xlsx", sheet_name="Q1 2025")
parse_document(path="contract.docx", max_chars=20000)

Parameters:

  • path — relative (within workspace) or absolute file path
  • format — auto (default), pdf, docx, spreadsheet, txt
  • sheet_name — target a single sheet (spreadsheets only; blank = all sheets)
  • max_chars — truncate output at this many characters (default 80000 ≈ 60 pages)

Returns: plain text. Spreadsheets return one Markdown table per sheet.


search_document

Search for a keyword or regex pattern inside a document.

search_document(path="report.pdf", pattern="revenue")
search_document(path="data.xlsx", pattern="/\d{4}-\d{2}-\d{2}/")
search_document(path="notes.txt", pattern="TODO", context_lines=3)

Parameters:

  • path — file path (relative or absolute)
  • pattern — literal string or JavaScript regex (/pattern/flags)
  • format — same as parse_document
  • context_lines — lines before/after each match (default 2, max 10)
  • max_matches — stop after this many matches (default 50, max 500)

Returns: matched lines with surrounding context and line numbers.


Supported Formats

ExtensionFormatLibrary
.pdfPDFpdf-parse
.docxWordmammoth
.xlsx, .xls, .ods, .csvSpreadsheetxlsx
.txt, .md, .log, .json, .csv (text)Plain textNode.js fs

Example Workflows

Summarise a report:

"Summarise this PDF" (with file path) → parse_document(path="/path/to/report.pdf")

Analyse a spreadsheet:

"What does the Q1 sheet look like in this Excel file?" → parse_document(path="budget.xlsx", sheet_name="Q1 2025")

Find specific clauses in a contract:

"Find all mentions of 'termination' in this contract" → search_document(path="contract.docx", pattern="termination", context_lines=3)

Extract dates from a document:

"Find all dates in this report" → search_document(path="report.pdf", pattern="/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/")

Read a log file:

"Show me all ERROR lines in this log" → search_document(path="app.log", pattern="/^ERROR/", max_matches=100)

💚 Support Development

This plugin is free and open source. If you find it useful, consider supporting development:

Ko-fi
TierAmountPerks
☕ Coffee$3Name in credits
🍔 Lunch$10+ Priority support
🍕 Pizza$25+ Name in README
🏆 Founding$50+ Lifetime support, consultation

Every coffee helps keep this project alive! ☕