Description
DeepSeek OCR is a two-stage, transformer-based document AI that compresses page images into compact vision tokens before decoding them with a high-capacity mixture-of-experts language model. Stage one merges a windowed SAM vision transformer with a dense CLIP-Large encoder and a 16x convolutional compressor, while stage two uses the DeepSeek-3B-MoE decoder (~570M active parameters per token) to reconstruct text, HTML, and figure annotations with minimal loss.
Its core innovation is context optical compression: by reducing a 1024x1024 page to as few as 256 tokens, DeepSeek OCR enables long-document ingestion that would overwhelm conventional OCR pipelines, keeping global semantics while slashing compute. A mode selector ranges from Tiny (64 tokens) to Gundam (multi-viewport tiling), letting users tune the balance between speed and fidelity for invoices, blueprints, and large-format scans.
Trained on 30 million real PDF pages plus synthetic charts, formulas, and diagrams, it preserves layout structure, tables, chemistry SMILES strings, and geometry tasks, and it supports more than 100 languages across Latin, CJK, Cyrillic, and scientific scripts. Structured output can be emitted as HTML tables, Markdown, JSON, SMILES, and captions for direct ingestion into analytics pipelines.
The MIT-licensed weights (a ~6.7 GB safetensors checkpoint) can be run on-premises on local GPUs, avoiding cross-border data exposure, or called through DeepSeek's OpenAI-compatible API with token-based pricing. A single NVIDIA A100 can process roughly 200,000 pages per day.
DeepSeek OCR's Core Features
Two-stage transformer OCR with context optical compression
DeepEncoder combining windowed SAM and CLIP-Large with 16x compression
DeepSeek-3B mixture-of-experts decoder (~570M active parameters)
Mode selector from Tiny (64 tokens) to Gundam multi-viewport tiling
Support for 100+ languages including CJK, Cyrillic, and scientific scripts
Structured output as HTML tables, Markdown, JSON, SMILES, and captions
MIT-licensed weights for on-premises local GPU deployment
OpenAI-compatible hosted API with token-based pricing
How to use DeepSeek OCR?
Deploy locally: Clone the GitHub repo, download the ~6.7 GB safetensors checkpoint, and configure PyTorch 2.6+ with FlashAttention on a compatible GPU.
Or call the API: Use DeepSeek's OpenAI-compatible endpoints to submit images and receive structured text with token-based billing.
Choose a mode: Select Tiny, Base, Large, or Gundam to balance speed against fidelity for your document type.
Integrate outputs: Convert results to JSON, link SMILES strings to cheminformatics pipelines, or feed layout-aware HTML into automation and RAG workflows.
DeepSeek OCR's Use Cases
- Scanned books and reports
- Technical diagrams and formulas
- Multilingual dataset creation
- Document conversion apps
- On-premises OCR at scale




