PluginBench
Skill
Pass
Audit score 90

liteparse

run-llama/llamaparse-agent-skills

Fast, local document extraction via `lit` CLI—parse once, search cheaply with disciplined patterns.

What is liteparse?

LiteParse extracts text, tables, and data from PDFs, DOCX, PPTX, XLSX, and images using the `lit` command-line tool. Use it when you need to read documents or pull specific values without re-parsing or bloating context—especially for answering questions about document contents or extracting structured data.

  • Parse documents (PDF, DOCX, PPTX, XLSX, images) to text once, then search the saved file with grep/sed to avoid re-extraction costs
  • Extract text, tables, and specific values using low-cost shell search patterns (grep -C, sed) instead of repeated full parses
  • Screenshot individual pages at modest DPI (150–200) as a last resort for dense tables, figures, or charts
  • Rank search results with bundled BM25 helper (search.py) when keyword-based grep doesn't pin down the answer
  • Handle born-digital PDFs with --no-ocr flag for speed, or enable OCR for scanned documents and images

How to install liteparse

npx skills add https://github.com/run-llama/llamaparse-agent-skills --skill liteparse
Prerequisites
  • Node 18+
  • npm i -g @llamaindex/liteparse (verify with lit --version)
  • LibreOffice (for DOCX, PPTX, XLSX)
  • ImageMagick (for image files)
  • uv (for bundled search.py helper)
Claude Code
Cursor
Windsurf
Cline

How to use liteparse

  1. 1.Parse the document exactly once to a temp file: lit parse "/abs/path/doc.pdf" --format text --no-ocr -o /tmp/doc.txt
  2. 2.Use grep -C with line numbers to search the file and get context in one command: grep -n -i -C4 "search term" /tmp/doc.txt | head -40
  3. 3.For multiple independent lookups, batch them in a single command using a for loop with labels to avoid round-trips
  4. 4.If targeted greps don't find the answer after two attempts, run the bundled search.py ranker instead of iterating keyword variants
  5. 5.For dense tables or charts that text can't answer, screenshot one page at modest DPI (150–200): lit screenshot "/abs/path/doc.pdf" --target-pages "13" --dpi 150 -o /tmp/shots/
  6. 6.Reuse the parsed text file for all subsequent questions about the same document

Use cases

Good for
  • Answer questions about a PDF report by parsing it once to a temp file, then running multiple targeted searches without re-parsing
  • Extract specific financial figures (revenue, assets) or ESG metrics from a document using batched grep commands in a single turn
  • Find materiality topics or priority items in a long document by running the bundled BM25 ranker with a natural-language query
  • Verify data in a dense multi-column table by screenshotting that one page at 150 DPI and reading it visually
  • Process multiple questions about the same document by reusing the parsed text file across all queries
Who it's for
  • Agents and developers extracting data from documents programmatically
  • Teams analyzing PDFs, reports, or spreadsheets without cloud OCR costs
  • Users needing fast, local document parsing with minimal context overhead

liteparse FAQ

Why parse to a file instead of calling `lit parse` each time I search?

Each `lit parse` re-extracts the entire document, wasting time and tokens. Parsing once to a file, then searching it with grep/sed, eliminates redundant extraction and keeps context small across multiple questions.

Should I use --no-ocr for all PDFs?

Use --no-ocr for born-digital PDFs (nearly all corporate reports, which have a real text layer)—it's much faster and text is identical. Only drop --no-ocr for scanned PDFs or images where OCR is needed.

When should I use the bundled search.py helper instead of grep?

Use search.py when two targeted greps haven't pinned down the answer. It ranks results by relevance using BM25 and returns context windows in one command, avoiding a long chain of speculative keyword variations.

How expensive are screenshots?

Very expensive—a single high-DPI page PNG can cost ~140k characters of context. Only screenshot when text/tables genuinely can't answer the question (dense multi-column tables, figures, charts), use one page at a time, and keep DPI modest (150–200).

Can I reuse the parsed file for multiple questions?

Yes. Keep the /tmp/doc.txt file and search it for every question about that document instead of re-parsing. This is the most efficient pattern for documents with many questions.

Full instructions (SKILL.md)

Source of truth, from run-llama/llamaparse-agent-skills.


name: liteparse description: Use this skill whenever a task involves a document file (PDF, DOCX, PPTX, XLSX, or image) and you need to read it or pull text, tables, or specific values out of it — to answer a question about its contents, look up a figure, or extract data. Provides fast, local, model-free extraction via the lit CLI with disciplined, low-cost search patterns. compatibility: Requires Node 18+ and @llamaindex/liteparse (npm i -g @llamaindex/liteparse, verify lit --version). LibreOffice for Office files; ImageMagick for images. The bundled search.py helper needs uv. license: MIT metadata: author: LlamaIndex version: "1.0.1"

Effective LiteParse

Extract text from documents locally with the lit CLI — a fast, model-free parser. This skill is about using it cheaply: each lit parse re-runs full extraction, and every line you dump into the conversation is paid for on every subsequent turn. The patterns below come from analyzing real agent traces where the same PDF was parsed up to 9 times and single image reads cost 140k+ characters of context. Don't repeat those mistakes.

The golden rule: parse ONCE to a file, then search the file

lit parse re-extracts the whole document every time you call it. Re-parsing per search is the #1 waste seen in traces. Parse a document exactly once, to a temp file, then run all your searches against that file:

# ONE TIME, per document. --no-ocr for born-digital PDFs (almost all reports) — much faster.
lit parse "/abs/path/doc.pdf" --format text --no-ocr -o /tmp/doc.txt && wc -l /tmp/doc.txt

Then search the file with cheap shell tools — never re-run lit parse to search again.

Search discipline — minimize ROUND-TRIPS, then keep results small

Every Bash call is a full model round-trip (latency + re-read of context). The biggest waste after parsing is a serial loop: grep → look → grep again → sed to read the window → grep again. In traces this doubled the turn count versus just reading the doc. Two rules fix it:

1. Get context in the SAME command — don't grep then sed. Use grep -C so the surrounding lines come back with the hit. This removes the follow-up sed turn for the common case:

grep -n -i -C4 "total assets" /tmp/doc.txt | head -40      # location AND its window, one turn

Only fall back to sed -n 'A,Bp' when you already know the exact line and need a wider window than -C gave you.

2. Batch independent lookups into ONE command. When a question needs several distinct facts (e.g. emissions and revenue), don't spend one turn per term. Probe them together with labels:

for q in "carbon intensity" "scope 1" "total revenue"; do \
  echo "=== $q ==="; grep -n -i -C3 "$q" /tmp/doc.txt | head -25; done

Then keep results small:

  • Always bound output with head and use -n for line numbers.
  • Don't fan out blindly. Aim to resolve a question in ≤3 search commands. If two targeted greps don't pin it down, switch to search.py (below) — don't keep firing keyword variations one per turn.
  • Prefer Bash grep/sed on the saved file over the Read and Grep tools — fewer round-trips and you control output size precisely.

Ranked search when keywords are uncertain (bundled helper)

When two targeted greps haven't pinned the answer, stop greping — don't iterate keyword variants one turn at a time. Run the bundled BM25 ranker ONCE to surface the most relevant line-windows in a single command:

./.claude/skills/effective-liteparse/scripts/search.py /tmp/doc.txt -q "materiality assessment priority topics" -k 8 -e 5

-k = number of matches, -e = lines of context around each (so the window comes back inline — no follow-up sed turn). It returns ranked windows with line numbers. Use a rich natural-language query (several synonyms in one string), not a single keyword. This replaces a long chain of speculative greps.

Born-digital vs scanned

  • Born-digital PDF (real text layer — nearly all corporate/finance/ESG reports): always pass --no-ocr. It's much faster and the text is identical. Leaving OCR on wastes time.
  • Scanned PDF / image: drop --no-ocr. If the value is missing or digits look wrong, read the page visually (see below) rather than trusting OCR.

Reading a page visually — last resort, ONE screenshot, modest DPI

Screenshots are the most expensive thing you can put in context: a single high-DPI page PNG ran ~140k characters in one trace, and agents often rendered the same page twice (default + hi-res).

Only screenshot when text/tables genuinely can't answer the question (dense multi-column tables, figures, charts). Then:

  • Render one page at a time with --target-pages "N" (note: it's --target-pages, NOT --pages).
  • Use modest DPI (~150–200). Do not start at 300+; do not re-render the same page at higher DPI unless the text is actually illegible.
lit screenshot "/abs/path/doc.pdf" --target-pages "13" --dpi 150 -o /tmp/shots/   # then Read the PNG

Many questions about the same document

Parsing once to a file already covers this: keep the /tmp/doc.txt and reuse it across every question instead of re-parsing.

Don't waste turns on preamble

Skip lit --version, ls -la, and lit … --help unless something actually failed. Go straight to the parse. Core flags you need:

--format text|json · --no-ocr · --target-pages "1-5,10" · --dpi <n> (default 150) · --ocr-language <iso>. Use --format json only when you need bounding boxes/layout — it's much larger; still search it, never load it whole.

Setup

PDFs work out of the box. If lit is missing: npm i -g @llamaindex/liteparse. Office docs need LibreOffice; images need ImageMagick (both auto-converted to PDF).