Illustration of what liteparse does: Local PDF and Office document parser with Markdown, JSON and bounding-box output

run-llama /

liteparse

Local PDF and Office document parser with Markdown, JSON and bounding-box output

  • 12.9k stars
  • 142 stars since 3 Oct
  • Rust
  • Updated today
  • Beginner friendly
  • Memory, RAG & data

PDFs store text as positioned fragments, not paragraphs, so a naive extract scrambles columns and tables. LiteParse rebuilds the page layout and gives you text, Markdown or JSON, with the position of each piece of text.

It is written in Rust and reads PDFs with the PDFium library, at about 2-5 ms per page according to the README. When a page needs it, it runs OCR. Tesseract is bundled, or you can plug in any OCR server (EasyOCR, PaddleOCR or your own) through a simple HTTP API. Word, Excel, PowerPoint and image files are converted first, then go through the same steps.

It uses no ML model, GPU or cloud service. The README compares it with markitdown, opendataloader and pdf-inspector and reports higher scores on three public benchmarks; these are the authors' own runs. The authors say it is weaker on dense tables, charts, handwriting and scans, and point to their paid cloud product, LlamaParse, for those.

What it does

  • Layout-aware extraction

    Reads PDFs with PDFium and rebuilds the spatial layout. Output can be plain text, Markdown (headings, tables, lists, links) or JSON with bounding boxes.

  • Optional OCR

    Tesseract is built in with no setup. Any OCR server that follows the documented HTTP API can be used instead.

  • Complexity detection

    Cheaply checks whether a document needs OCR or heavier parsing, so you can route it, reject it or estimate cost before a full parse.

  • Page screenshots

    Generates page images, which the README says are meant for LLM agents.

  • Many languages and a worker pool

    Use it from Rust, Node.js/TypeScript, Python or the browser via WASM. Python and Node.js also offer worker processes with hard per-parse timeouts.

What you could build

  • Convert a folder of PDFs to Markdown to feed a RAG pipeline.
  • Extract text with bounding boxes to highlight where an answer came from on the page.
  • Screen incoming documents and send only the hard ones to OCR or a heavier parser.
  • Give a coding or research agent a skill for reading PDFs and Office files.
  • Parse documents in the browser without uploading them anywhere.

Get started

Install the package for your language (all but the WASM build include the same lit command), then run lit parse on a file. Add --format markdown for Markdown or --no-ocr to skip OCR.

pip install liteparse
npm i -g @llamaindex/liteparse
lit parse document.pdf --format markdown -o output.md

Commands are copied from the project's README. Read it on GitHub for the full setup.

More in Memory, RAG & data

    ↑↓ to move, Enter to open, Esc to close