DeepSeek-OCR-2
DeepSeek's OCR model with Visual Causal Flow.
Working when we checked on .
What is DeepSeek-OCR-2?
DeepSeek-OCR-2 (Visual Causal Flow) is an open-source optical character recognition model from DeepSeek AI that converts documents and images to markdown with layout grounding. It targets developers and researchers building document digitization pipelines. The model supports both vLLM and Transformers inference, handles images, PDFs with concurrent processing, and batch evaluation on benchmarks like OmniDocBench v1.5. It uses dynamic resolution with up to 6×768×768 crops plus a 1024×1024 base image, producing visual tokens for context compression. Weights are downloadable from Hugging Face under an Apache-2.0 license.
DeepSeek-OCR-2 pricing
Pricing model: Free
Free and open-source (model weights publicly available on Hugging Face)
DeepSeek-OCR-2 pros
- Open source under Apache-2.0 license with weights on Hugging Face
- Supports both vLLM and Transformers inference code paths
- Handles images, PDFs with concurrent processing, and batch benchmark evaluation
- Dynamic resolution: (0-6)×768×768 plus 1×1024×1024 base, (0-6)×144+256 visual tokens
- PDF concurrency speed is on par with DeepSeek-OCR
- Includes grounding prompt mode that converts documents to markdown
DeepSeek-OCR-2 cons
- Requires specific environment: CUDA 11.8, torch 2.6.0, Python 3.12.9, flash-attn 2.7.3
- No hosted API or GUI offered; users must self-deploy with GPUs
- vLLM 0.8.5 dependency can conflict with transformers version requirements
- Commercial licensing and support terms beyond the repo are not documented
Frequently asked questions about DeepSeek-OCR-2
What does DeepSeek-OCR-2 do?
It is an OCR model that converts documents and images to markdown, with an optional grounding prompt mode that preserves layouts. It also supports free OCR extraction without layout information.
Who is DeepSeek-OCR-2 for?
Developers and researchers who want to self-host an OCR model for document digitization, benchmarking, or document-to-markdown conversion pipelines.
How can the model be run?
It can be run via vLLM (v0.8.5) or Hugging Face Transformers, with provided scripts for single images, PDFs with concurrency, and batch benchmark evaluation.
What input formats are supported?
The repo provides scripts for image inference with streaming output and PDF processing with concurrency, outputting markdown or OCR text.
What resolution modes does it use?
It supports dynamic resolution: (0-6) crops of 768×768 plus one 1024×1024 base image, yielding (0-6)×144 + 256 visual tokens.
How fast is PDF processing?
According to the repo, PDF concurrency processing runs at a speed on par with the previous DeepSeek-OCR model.
What software environment is required?
The tested environment is CUDA 11.8 with torch 2.6.0, Python 3.12.9 in conda, plus vLLM 0.8.5 (cu118), flash-attn 2.7.3, and the repo's requirements.txt.
Under what license is it released?
The code and model are released under the Apache-2.0 license, per the repository's license file and About section.
Where can the model weights be downloaded?
Model weights are available on Hugging Face at deepseek-ai/DeepSeek-OCR-2, linked from the repository as the Model Download.
Does it cost anything to use?
No. It is an open-source model released under Apache-2.0 at no charge; users only pay for their own compute to run it.