DEV Community

Cover image for Skip the OCR queue: pdf-inspector 1.17.0 classified a 14-page paper in 8.296 ms on a local Mac
sword luan
sword luan

Posted on

Skip the OCR queue: pdf-inspector 1.17.0 classified a 14-page paper in 8.296 ms on a local Mac

Teams still send every PDF to cloud OCR. Page counts grow, the pipeline waits, and the bill follows. Firecrawl's open-source pdf-inspector classifies a file first: if it is already text-based, it writes Markdown locally. Jian AI Lab ran version 1.17.0 today on a Mac with zero API keys and zero spend.

This article uses the same facts as the public report. It does not treat the author's 200-document README benchmark as today's measurement. OCR was not executed.

What the author already stated

The README describes a local classify-and-extract engine for text PDFs. Default path skips OCR. The public post by Nicolas Camara (status/2083295265793212827) points the same way: do not stall an agent on OCR before you know the file needs it.

What actually ran on this Mac

uv venv --python 3.11 .venv
uv pip install --python .venv/bin/python pdf-inspector
Enter fullscreen mode Exit fullscreen mode

The environment contained pdf-inspector==1.17.0 only.

File 1 — a one-page text PDF generated for an invoice-like layout:

  • classify_pdf: 0.901 ms, text_based, confidence 1.0, pages_needing_ocr = []
  • process_pdf: 5.671 ms → 181 characters of Markdown, including Amount: 0 CNY

File 2 — public TraceMonkey paper PDF, 1,016,315 bytes:

  • classify: 8.296 ms, still text_based, confidence 1.0, 0 OCR pages
  • extract: 51.342 ms83,804 characters of Markdown
  • library page_count=14; system file reported 6 pages. Public number used: 14

Limits we actually hit

A planted not-a-pdf.txt raised ValueError: Not a PDF: file appears to be plain text on three calls, each under 1 ms. Switching back to a real PDF restored classify and extract. We did not measure scanned pages.

Project: firecrawl/pdf-inspector

Measured report: https://jianailab.com/experiments/pdf-inspector-cf28f675

Top comments (0)