# MonkeyOCR — Lightweight Document Parsing Model > A lightweight large multimodal model optimized for accurate document parsing extracting text tables and structure from PDFs and images. ## Install Save in your project root: # MonkeyOCR — Lightweight Document Parsing Model ## Quick Use ```bash pip install monkeyocr from monkeyocr import MonkeyOCR model = MonkeyOCR() result = model.parse("document.pdf") print(result.markdown) ``` ## Introduction MonkeyOCR is a lightweight large multimodal model designed specifically for document parsing. It extracts text, tables, formulas, and document structure from PDFs and images with high accuracy while remaining small enough to run on consumer hardware. ## What MonkeyOCR Does - Parses complex document layouts including multi-column text - Extracts tables with cell-level precision preserving structure - Recognizes mathematical formulas and converts to LaTeX - Outputs structured Markdown or JSON from any document - Handles scanned documents and photos with built-in OCR ## Architecture Overview MonkeyOCR uses a vision-language architecture with a lightweight image encoder paired with a small language model decoder. Documents are processed page-by-page through the vision encoder, and the language model generates structured output following the detected layout. The model is optimized via quantization to run efficiently on 8GB VRAM GPUs or CPU. ## Self-Hosting & Configuration - Install via pip; model weights auto-download on first use - Runs on CPU (slower) or GPU with CUDA support - Configurable output format: Markdown, JSON, or plain text - Batch processing API for high-throughput pipelines - REST server mode for integration with document workflows ## Key Features - Compact model size under 4GB for GPU deployment - Table extraction accuracy exceeding traditional rule-based parsers - Multi-language support covering CJK and Latin scripts - Layout-aware parsing preserves reading order - Open weights with permissive license for commercial use ## Comparison with Similar Tools - **Marker** — rule-based approach; MonkeyOCR uses learned representations for better generalization - **Docling** — heavier pipeline; MonkeyOCR is a single end-to-end model - **Surya** — focuses on line detection; MonkeyOCR provides full structured output - **Tesseract** — OCR only without layout understanding; MonkeyOCR parses structure ## FAQ **Q: What GPU is required?** A: 8GB VRAM minimum for GPU inference; CPU mode available but slower. **Q: Which document formats are supported?** A: PDF, PNG, JPG, TIFF, and multi-page documents. **Q: How does it handle handwritten text?** A: Printed text is primary focus; handwriting recognition is limited. **Q: Can I fine-tune for my domain?** A: Yes, fine-tuning scripts and data format documentation are provided. ## Sources - https://github.com/Yuliang-Liu/MonkeyOCR --- Source: https://tokrepo.com/en/workflows/asset-6746a8a0 Author: AI Open Source