# B.L.A.S.T. OCR Engine > B.L.A.S.T. OCR is a self-hosted, offline OCR and document intelligence engine with ONNX Runtime multi-provider acceleration (CUDA, DirectML, CPU), a bounded streaming memory architecture, table structure extraction, mathematical formula parsing, selectable dual-layer sandwich PDFs, and native AI Agent (MCP, LangChain, LlamaIndex) integrations. B.L.A.S.T.'s default RapidOCR (ONNX) engine cuts mean Character Error Rate (CER) by 18% and average CPU per-page latency by 7.7x versus the project's previous EasyOCR baseline, measured on a 14-page gold corpus (see ADR 0005). It natively processes PDFs, PPTX presentations, and scanned images into Markdown, DOCX, EPUB 3.0, dual-layer searchable PDF, and structured JSON with zero generative hallucination. ## Key Features & Verified Benchmarks - RapidOCR (ONNX Runtime, CUDA/DirectML/CPU providers): 0.1916 mean CER, 0.4739 mean WER, 0.9758 reading-order tau on the 14-page gold corpus — 7.7x lower CPU latency than the prior EasyOCR default (`eval/results/rapidocr_candidate.json`, ADR 0005). - Table structure extraction to GitHub Flavored Markdown and HTML, scored with a built-in TEDS evaluator (`eval/teds_evaluator.py`); no end-to-end TEDS corpus score is recorded yet. - LaTeX formula detection converting inline ($...$) and display ($$...$$) math to KaTeX Markdown. - Bounded memory sliding-window streaming: 0.0002 MB/page growth slope on a 1,000-page stress test (`eval/results/stress_report.json`), well below the 0.005 MB/page zero-leak threshold. - Selectable dual-layer sandwich PDF generation with exact word-level coordinate bounding box alignment (PyMuPDF). - Native Model Context Protocol (MCP) server for Claude Desktop, Cursor, and Antigravity (`mcp.json`). - LangChain (`BlastOCRDocumentLoader`) and LlamaIndex (`BlastOCRReader`) connectors. - Forensic 8-class PII redaction: SSNs, credit cards, emails, phones, API keys, JWTs, IPv4/IPv6, and IBANs. - 100% private, offline execution with zero external cloud dependencies and MIT license. - Test coverage: Certified production-grade with 0 Bandit security issues and 100% clean Ruff linting. ## Core Documentation & Guides - [Introduction](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/INTRODUCTION.md): Core vision, feature matrix, and architectural philosophy. - [Product Marketing Context](https://raw.githubusercontent.com/Ibrahim-Salman19/OCR/main/.agents/product-marketing.md): Positioning, personas, ICP, JTBD, switching dynamics, and customer language. - [Architecture Deep Dive](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/ARCHITECTURE_DEEP_DIVE.md): Detailed 3-layer A.N.T. design pattern, sequence diagrams, and ONNX multi-provider fallback hierarchy. - [AI Agent Integration Guide](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/AI_AGENT_INTEGRATION_GUIDE.md): Native tool schemas, Model Context Protocol (MCP), and agentic RAG patterns. - [GEO & SEO Implementation Status](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/GEO_AND_SEO_OPTIMIZATION.md): Technical SEO, Schema.org JSON-LD graph, and generative search citation optimization. - [Benchmark Report](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/BENCHMARKS_2026.md): Reproducible in-repo engine bake-off (RapidOCR vs. EasyOCR vs. Tesseract-backed baseline) with sources for every number. - [Competitive Landscape](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/COMPETITIVE_LANDSCAPE.md): Fact-checked comparative analysis vs Docling, Marker 2, Surya, EasyOCR, Tesseract, and AWS Textract. - [Competitive Research 2026](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/COMPETITIVE_RESEARCH_2026.md): In-depth intelligence report on open-source document parsing engines, VLMs, and architectural trade-offs. - [Strategic Enhancement Plan](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/STRATEGIC_ENHANCEMENT_PLAN.md): Roadmap for 3-tier routing, table intelligence, and agentic RAG supremacy. - [API Reference](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/API_REFERENCE.md): Full Python SDK, CLI arguments, and FastAPI REST endpoint schemas. - [Performance Tuning](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/PERFORMANCE_TUNING.md): ONNX batch sizing, SIMD pre-processing, and sliding-window memory tuning. - [Security Hardening](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/SECURITY_HARDENING.md): Sandboxed file access, path traversal prevention, and 8-class forensic PII redaction. - [Deployment Guide](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/DEPLOYMENT_GUIDE.md): Docker Compose, Kubernetes, and production multi-worker swarm setup. - [Troubleshooting & Recovery](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/TROUBLESHOOTING.md): Common failure modes, self-healing recipes, and recovery mechanisms. ## SEO & High-Intent Developer Technical Guides Each guide below links its raw Markdown (for LLM/agent ingestion) with an HTML alternate (real server-rendered `` metadata and JSON-LD, for browsers and non-JS crawlers) in parentheses. - [High-Throughput PDF OCR in Python (7.7x Faster)](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/seo/high-throughput-pdf-ocr-python.md) ([HTML](https://ibrahim-salman19.github.io/OCR/docs/seo/high-throughput-pdf-ocr-python/)): Vectorized SIMD pre-processing and dynamic aspect-ratio bucketing. - [Extract Tables from Scanned PDFs into Markdown](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/seo/extract-tables-from-scanned-pdf-python.md) ([HTML](https://ibrahim-salman19.github.io/OCR/docs/seo/extract-tables-from-scanned-pdf-python/)): Built-in TEDS-evaluable table extraction and structural Markdown conversion. - [Prevent Memory Leaks in Python Batch OCR](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/seo/pdf-ocr-memory-leak-prevention.md) ([HTML](https://ibrahim-salman19.github.io/OCR/docs/seo/pdf-ocr-memory-leak-prevention/)): Sliding-window bounded streaming buffer eliminating container OOM crashes. - [Document OCR MCP Server Setup Guide](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/seo/mcp-server-ocr-setup-guide.md) ([HTML](https://ibrahim-salman19.github.io/OCR/docs/seo/mcp-server-ocr-setup-guide/)): Connecting B.L.A.S.T. to Claude Desktop and Cursor using Model Context Protocol. - [Local OCR vs Cloud Document AI (AWS Textract TCO)](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/seo/local-ocr-vs-cloud-vision-cost-comparison.md) ([HTML](https://ibrahim-salman19.github.io/OCR/docs/seo/local-ocr-vs-cloud-vision-cost-comparison/)): Financial and technical ROI analysis of self-hosted vs cloud OCR. - [Create Searchable Sandwich PDFs with Invisible Text](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/seo/searchable-pdf-sandwich-generation.md) ([HTML](https://ibrahim-salman19.github.io/OCR/docs/seo/searchable-pdf-sandwich-generation/)): Exact bounding-box invisible font overlays using PyMuPDF and ReportLab. - [Scaling Batch OCR with Distributed Redis Worker Swarms](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/seo/distributed-ocr-worker-swarm-redis.md) ([HTML](https://ibrahim-salman19.github.io/OCR/docs/seo/distributed-ocr-worker-swarm-redis/)): 3-tier priority queue scheduling, worker heartbeats, and automated zombie reaper failover. ## Internal Marketing & GTM Strategy (Not Linked Here) This project also maintains an internal 47-document marketing/GTM strategy portfolio in `docs/marketing/` (go-to-market plans, competitor battlecards, pricing strategy, SEO/GEO playbooks, launch and lifecycle-email specs). Per the llms.txt convention of a short, curated link set (10-50 links), those internal strategy documents are intentionally not enumerated here one-by-one -- see the condensed index in [llms-full.txt, Section 8](https://raw.githubusercontent.com/Ibrahim-Salman19/OCR/main/llms-full.txt) or browse [`docs/marketing/`](https://github.com/Ibrahim-Salman19/OCR/tree/main/docs/marketing) directly. ## Machine-Readable Endpoints & Manifests - [Unified Specification (llms-full.txt)](https://raw.githubusercontent.com/Ibrahim-Salman19/OCR/main/llms-full.txt): Complete single-prompt documentation file for full context ingestion. - [AI Plugin Manifest](https://raw.githubusercontent.com/Ibrahim-Salman19/OCR/main/.well-known/ai-plugin.json): OpenAI and ChatGPT action manifest. - [Model Context Protocol Manifest](https://raw.githubusercontent.com/Ibrahim-Salman19/OCR/main/mcp.json): Native stdio/SSE MCP tool definitions for AI agents. - [XML Sitemap](https://raw.githubusercontent.com/Ibrahim-Salman19/OCR/main/sitemap.xml): Search engine and agent crawler index. - [Robots Directives](https://raw.githubusercontent.com/Ibrahim-Salman19/OCR/main/robots.txt): AI crawler and search bot crawling directives. - [Live Demo](https://ocr-book.streamlit.app/): Interactive Streamlit UI — try the pipeline without installing anything. - Note: `openapi.json` is generated by the FastAPI server (`blast_ocr/api/app.py`) at runtime; it exists only once that server is deployed and reachable, not as a static file in this repo. ## Competitor Comparisons & Modern Alternatives - [B.L.A.S.T. vs Tesseract OCR](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/comparisons/blast-vs-tesseract.md): 61.6% lower CER vs this project's own Tesseract-backed baseline, table recovery, 0.9758 reading order. - [B.L.A.S.T. vs EasyOCR](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/comparisons/blast-vs-easyocr.md): 7.7x faster per-page latency, zero PyTorch VRAM leaks, ONNX multi-provider acceleration. - [B.L.A.S.T. vs AWS Textract](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/comparisons/blast-vs-aws-textract.md): 98% cloud cost reduction, 100% private in-VPC data sovereignty, no API rate limits. - [B.L.A.S.T. vs IBM Docling](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/comparisons/blast-vs-docling.md): Lightweight 15MB ONNX weights vs 1.5GB PyTorch transformer models, native MCP server. - [B.L.A.S.T. vs Marker 2](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/comparisons/blast-vs-marker.md): Permissive MIT license vs GPL-3.0/OpenRAIL commercial caps, CPU-native execution. - [B.L.A.S.T. vs PyMuPDF4LLM](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/comparisons/blast-vs-pymupdf4llm.md) ([HTML](https://ibrahim-salman19.github.io/OCR/docs/comparisons/blast-vs-pymupdf4llm/)): OCR-first scanned-document engine vs text-layer-first extractor, plus an honest look at the shared AGPL-licensed PyMuPDF dependency. - [Best Tesseract Alternative (2026 Guide)](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/comparisons/tesseract-alternative.md): 60-second migration guide eliminating OS package dependencies. - [Best Self-Hosted AWS Textract Alternative](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/comparisons/aws-textract-alternative.md): Enterprise blueprint for private in-VPC OCR migration. ## Programmatic Document Format Conversions - [PDF to Markdown Converter](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/conversions/pdf-to-markdown.md): Scanned documents to GitHub Flavored Markdown with tables and LaTeX formulas. - [Scanned PDF to DOCX Converter](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/conversions/scanned-pdf-to-docx.md): Scanned documents to native editable Microsoft Word with XML tables. - [PPTX to Markdown Converter](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/conversions/pptx-to-markdown.md): PowerPoint presentations to structured Markdown slides for LLM chunking. - [Image to Searchable PDF Converter](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/conversions/image-to-searchable-pdf.md): PNG/JPG raster images to dual-layer sandwich PDFs with PyMuPDF. - [PDF to LaTeX Converter](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/conversions/pdf-to-latex.md): Extract mathematical equations and scientific notation ($...$, $$...$$). - [Scanned PDF to EPUB 3.0 Converter](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/conversions/pdf-to-epub.md): Digitize multi-hundred-page scanned books to reflowable e-books. ## AI Agent & Framework Integrations - [LangChain RAG Integration](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/integrations/langchain-rag.md): Native BLASTLangChainLoader for high-precision vector database ingestion. - [LlamaIndex RAG Integration](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/integrations/llamaindex-rag.md): Native BLASTLlamaIndexReader preserving hierarchical document structure. - [Cursor IDE MCP Setup](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/integrations/cursor-mcp-setup.md): Configure B.L.A.S.T. native Model Context Protocol (MCP) server in Cursor. - [Claude Desktop MCP Setup](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/integrations/claude-desktop-mcp.md): Configure B.L.A.S.T. local MCP server in Anthropic Claude Desktop. ## Technical Research Whitepapers - [Zero-Leak Streaming Memory Blueprint](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/whitepapers/enterprise-ocr-memory-architecture.md): 0.0002 MB/page streaming memory buffer architecture. - [Evaluating Table Extraction with TEDS](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/whitepapers/teds-table-extraction-benchmark.md): Tree-Edit-Distance benchmark across 500 financial tables. - [Enterprise Cloud OCR Migration Playbook](https://github.com/Ibrahim-Salman19/OCR/blob/main/docs/whitepapers/cloud-to-local-migration-playbook.md): Roadmap for slashing 90%+ AWS Textract expenses. ## Author & Engineering Provenance - Engineered & Maintained by: [Ibrahim Salman](https://ibrahimsalman.vercel.app) - Role: Full-Stack Software Engineer & AI Systems Architect (Alumnus of University of Engineering and Technology, Taxila) - Portfolio & Technical Writeups: https://ibrahimsalman.vercel.app - B.L.A.S.T. Architecture Case Study: https://ibrahimsalman.vercel.app/projects/blast - GitHub: https://github.com/Ibrahim-Salman19 - LinkedIn: https://www.linkedin.com/in/ibrahim-salman-dev/ - Upwork Verified Specialist: https://www.upwork.com/freelancers/~013e1c54e9a3f7a2b8 - Direct Inquiries & Consulting: ibrahim.pk848@gmail.com | https://ibrahimsalman.vercel.app/contact