B.L.A.S.T. OCR
● Sovereign Edition

B.L.A.S.T. OCR

Batched. Latency-Aware. Streaming. Text-extraction. Self-hosted document OCR built for production throughput, not notebook demos.

7.7x
Faster than EasyOCR (CPU)
0.1916
CER on 14-page gold corpus
0.0002 MB
Memory growth per page
$0
MIT licensed, self-hosted

What B.L.A.S.T. does

A self-hosted ONNX document intelligence engine — no cloud API calls, no per-page billing, no data leaving your infrastructure.

⚡

ONNX Multi-Provider Inference

Batched ONNX Runtime execution with CUDA, DirectML, and CPU provider fallback.

🔗

Distributed Swarm Queue

Redis-backed priority queue with worker heartbeats, retry backoff, and dead-letter quarantine.

📦

Bounded Memory Streaming

Batch-and-stream page processing keeps memory flat on archives hundreds of pages long.

🛡️

Hardened Security Gateway

Magic-byte validation, path-traversal sandboxing, and hostile-text filtering on every upload.

Why not EasyOCR, Tesseract, or AWS Textract?

Full breakdowns with methodology live in docs/comparisons. Summary:

EngineCPU latency (14-page gold corpus)LicenseTable extraction
B.L.A.S.T. (RapidOCR/ONNX)~15.3s/pageMITBuilt-in, TEDS-scored
EasyOCR (PyTorch)~117.8s/pageApache-2.0None
TesseractSlower, no table recoveryApache-2.0None
AWS TextractCloud API, per-page billingProprietaryYes (cloud-only)

How to process a PDF to Markdown

Three steps from install to output. Full API reference in docs/API_REFERENCE.md.

  1. Install B.L.A.S.T. OCR pip install -r requirements.txt
  2. Initialize the pipeline BlastPipeline(config_overrides={'ocr_engine': 'rapidocr', 'secure_mode': True})
  3. Process a document pipeline.process_job(source_path='doc.pdf', formats=['markdown', 'pdf'])

Developer guides

In-depth, code-verified guides for common OCR integration tasks.

High-Throughput PDF OCR in Python

7.7x faster than this project's own EasyOCR baseline on CPU (15.3s vs 117.8s/page).

Extract Tables from Scanned PDFs

Built-in TEDS-evaluable table extraction into clean Markdown, with working code.

OCR MCP Server Setup Guide

Connect self-hosted OCR to Claude Desktop and Cursor via MCP.

Searchable PDF Sandwich Generation

Build invisible-text-layer searchable PDFs with PyMuPDF and ReportLab.

PDF OCR Memory Leak Prevention

Sliding-window bounded buffers: 0.0002 MB/page growth measured over a 1,000-page stress test.

Local OCR vs AWS Textract: TCO

Real AWS Textract pricing vs. self-hosted B.L.A.S.T. compute costs.

Distributed OCR Worker Swarm (Redis)

Scale batch OCR across nodes with a Redis priority queue and zombie reaper.

B.L.A.S.T. vs PyMuPDF4LLM

OCR-first scanned-document engine vs text-layer-first extractor, plus an honest AGPL dependency disclosure.

Frequently asked questions

The same 8 questions answered in the project's Schema.org FAQPage markup — kept here as visible text so the structured data reflects real page content.

Why is B.L.A.S.T. OCR faster than EasyOCR?

B.L.A.S.T.'s default engine (RapidOCR, ONNX Runtime with CUDA → DirectML → CPU fallback) replaced an EasyOCR/PyTorch baseline after a documented bake-off on the project's 14-page gold corpus, cutting average CPU per-page latency from ~117.8s to ~15.3s (a 7.7x improvement) while reducing mean CER by 18%. See ADR 0005 in the repository for the full methodology and raw results.

How does B.L.A.S.T. prevent memory leaks on large PDF archives?

B.L.A.S.T. implements a bounded sliding-window streaming architecture (PageStreamGenerator) that caps concurrent in-memory page buffers and recycles intermediate image tensors. A 1,000-page streaming stress test measured a growth slope of 0.0002 MB/page against a 0.005 MB/page fail threshold.

How does B.L.A.S.T. extract tables?

B.L.A.S.T. uses a morphological table detection and cell reconstruction engine (TableExtractor) that analyzes horizontal and vertical grid lines, merges spanning cells, and preserves hierarchical header structures into clean Markdown and HTML tables, scored against a built-in Tree-Edit-Distance (TEDS) evaluator for regression testing.

How do I connect B.L.A.S.T. OCR to Claude Desktop, Cursor, or Antigravity?

B.L.A.S.T. includes a native Model Context Protocol (MCP) server. Run python -m blast_ocr.mcp_server or configure mcp.json to expose blast_ocr_process, blast_ocr_extract_tables, blast_ocr_extract_formulas, and blast_ocr_semantic_chunk tools with zero configuration.

How does B.L.A.S.T. generate dual-layer sandwich PDFs?

B.L.A.S.T. utilizes PyMuPDF to synthesize dual-layer searchable PDFs where the original scanned image is preserved on the visual layer while an invisible, selectable text layer is placed beneath it with exact word-level coordinate bounding box alignment.

How does B.L.A.S.T. guarantee zero generative hallucination?

Unlike Vision-Language Models (VLMs) that generate text autoregressively and can hallucinate numbers, dates, and clauses, B.L.A.S.T. uses deterministic neural text detection and CTC character classification combined with morphological layout analysis, guaranteeing 0% generative hallucination in legal and financial documents.

Does B.L.A.S.T. run 100% offline in air-gapped secure environments?

Yes. B.L.A.S.T. executes completely locally with zero external network calls, zero third-party telemetry, and zero cloud API dependencies. All ONNX weights and dependencies are hosted on-premise, making it fully compliant with HIPAA, GDPR, and air-gapped environments.

How does B.L.A.S.T. protect confidential data with forensic PII redaction?

When secure_mode=True is enabled, B.L.A.S.T. runs an automated 8-class forensic redaction engine that masks SSNs, credit cards, emails, phone numbers, API keys, JWT tokens, IPv4/IPv6, and IBANs across all generated exports before disk persistence.