7,250 9 months ago

State-of-the-art OCR (Optical Character Recognition) vision language model based on [allenai/olmOCR-2-7B-1025](https://huggingface.co/allenai/olmOCR-2-7B-1025).

vision
ollama run richardyoung/olmocr2:7b-q8

Models

View all →

Readme

olmocr2

State-of-the-art OCR (Optical Character Recognition) vision-language model, packaged for Ollama. Based on allenai/olmOCR-2-7B-1025, it transcribes text from documents, PDFs, handwriting, tables, charts, equations, and screenshots into clean, structured output.

๐Ÿš€ Overview

olmocr2 is a vision-language model fine-tuned specifically for document understanding and optical character recognition. It takes an image (a scanned page, a photo of a document, a screenshot) and returns the text it contains, preserving structure such as tables, headings, and mathematical notation.

It is built on Ai2โ€™s olmOCR-2-7B-1025, which fine-tunes Qwen2.5-VL-7B-Instruct on the olmOCR dataset and further refines it with reinforcement learning to handle hard cases like equations and complex tables. This Ollama build ships a Q8_0 (8-bit) quantization for high-quality local inference.

๐Ÿ“Š Benchmarks

Benchmark Score
olmOCR-Bench 82.4

Score as reported for the upstream allenai/olmOCR-2-7B-1025 model on olmOCR-Bench. Quantization (Q8_0) may produce small deviations from the full-precision baseline.

๐ŸŽฏ Key Features

  • Document-grade OCR, extracts text from scanned pages, PDFs, and photos.
  • Structure-aware, preserves tables, spreadsheets, headings, and reading order.
  • Handwriting support, transcribes handwritten notes.
  • Math & equations, handles mathematical expressions and notation.
  • Charts & graphs, reads labels and values from visual data.
  • Screenshots & images, pulls text out of UI captures and general images.
  • Runs locally, Q8_0 quantization for high quality on a single GPU via Ollama.

๐Ÿท๏ธ Available Versions

Tag Size BPW Notes
7b-q8 9.5GB ~8.5 (Q8_0) Default. 8B-param VLM, high-quality 8-bit quantization.

Only the 7b-q8 tag is published. Pulling richardyoung/olmocr2 resolves to this tag.

๐Ÿ’ป Quick Start

Pull the model:

ollama pull richardyoung/olmocr2

Run OCR on an image (multimodal input):

ollama run richardyoung/olmocr2 "Transcribe all text from this image." ./document.png

Via the API:

curl http://localhost:11434/api/generate -d '{
  "model": "richardyoung/olmocr2",
  "prompt": "Extract all text from this document.",
  "images": ["<base64-encoded-image>"]
}'

๐Ÿ› ๏ธ Use Cases

  • Digitizing scanned documents and PDFs into searchable text.
  • Extracting tables and figures from reports into structured form.
  • Transcribing handwritten notes and forms.
  • Reading equations from academic papers and worksheets.
  • Pulling text from screenshots, receipts, and photographed pages.
  • Building document-understanding and RAG pipelines that need OCR.

๐Ÿ“‹ System Requirements

  • Ollama 0.4+ with multimodal (vision) support.
  • Disk: ~10 GB free for the model files.
  • Memory: ~12 GB VRAM recommended to run comfortably on GPU; runs on CPU/RAM with reduced throughput.
  • Input: images (PNG, JPEG, etc.); the model is image + text in, text out.

๐Ÿ”ง Technical Details

  • Base model: allenai/olmOCR-2-7B-1025 (fine-tune of Qwen2.5-VL-7B-Instruct).
  • Parameters: ~8B (vision-language model).
  • Quantization: Q8_0 (8-bit).
  • Context length: up to 125K tokens (architectural max from the Qwen2.5-VL base); the Ollama default num_ctx is 4096 and can be raised at runtime.
  • Modality: vision-language (image + text in, text out).
  • Prompt format: Qwen chat template (<|im_start|> / <|im_end|>).
  • License: Apache 2.0.

โš ๏ธ Disclaimer

OCR output may contain errors, omissions, or misreadings, especially with low-quality scans, unusual fonts, dense tables, handwriting, or complex mathematical notation. Always verify critical text against the source before relying on it. Do not use the output for high-stakes decisions without human review. The model is provided as-is, without warranty of accuracy or fitness for any particular purpose.

๐Ÿ™ Acknowledgments

  • Ai2 (Allen Institute for AI) for the upstream olmOCR-2-7B-1025 model and the olmOCR project.
  • Qwen team for the Qwen2.5-VL-7B-Instruct base model.
  • llama.cpp for the GGUF quantization toolchain that makes local inference possible.
  • The Ollama team and community for the runtime and model distribution.

Licensed under Apache 2.0, in accordance with Ai2โ€™s Responsible Use Guidelines.


Built & maintained by Richard Young ยท DeepNeuro