Key highlights:
• ~15.8K GitHub stars (repo opened February 6, 2026), 1,095 forks, MIT-licensed, pure Rust
• Classifies a PDF in ~10-50ms without rendering a single page — returns `TextBased`, `Scanned`, `ImageBased`, or `Mixed` plus a confidence score and a per-page `pages_needing_ocr` list
• No ML models, no GPU, no API key, no system dependencies — one Rust dependency (`lopdf`)
• Bindings for Python, Node.js, browser WebAssembly, and Rust, plus two CLIs (`pdf2md`, `detect-pdf`)
• Benchmark headline: 0.875 overall on the 200-document opendataloader-bench corpus, and it finished the whole corpus in 0.47s versus 17.1s for PyMuPDF4LLM
What is pdf-inspector?
Firecrawl builds web-scraping and document-parsing infrastructure for AI pipelines. pdf-inspector is the piece of that stack they open-sourced: a from-scratch Rust PDF engine that reads a document's internal structure — font encodings, text operators, image coverage — rather than rendering it to pixels and looking at it.
That distinction is the whole product. A conventional "PDF to Markdown for RAG" tool tends to assume the worst: a page might be a scan, so send it to OCR or a vision model and let the GPU sort it out. Firecrawl's stated figure is that roughly 54% of PDFs don't need OCR at all — reports, research papers, invoices, contracts, and legal filings are usually generated by software and carry a perfectly good text layer inside them.
pdf-inspector's job is to find that out in milliseconds and, if the text is there, pull it out locally in about 150ms. Firecrawl says this routing layer is what makes their hosted Fire-PDF engine 3.5x to 5x faster than their previous pipeline: on a 200-page report where 150 pages are pure text, 150 pages never touch a GPU.
How the classifier actually works
This is the part worth understanding, because it explains both the speed and the failure modes.
Detection does not load the full document. The steps are:
1. Parse the xref table and page tree — no full object load
Real code: three languages, one call
The API surface is deliberately tiny. Python, via maturin:
print(result.pdf_type) # "text_based", "scanned", "image_based", "mixed"
import { processPdf, classifyPdf } from '@firecrawl/pdf-inspector';
Read the Full Deep Dive
This is a condensed version. The full article includes architecture diagrams, code examples, comparison tables, and practical use cases.
👉 Read the complete analysis on andrew.ooo
Topics: pdf parsing, rust, firecrawl, pdf-inspector, rag

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.