Model reference · open weights

DeepSeek-OCR-2

LLMs deepseek-ai Vision + text 1 build Open weights 1.1M dl/mo

DeepSeek-OCR-2 is an open-weight language model from DeepSeek. DeepSeek-OCR-2 (BF16) weighs 6.8 GB; the smallest configuration that runs it is RTX 3060 12 GB.

  • DeepSeek-OCR-2 is a 3.4B parameter image-text-to-text model developed by DeepSeek for optical character recognition and document conversion.
  • It supports multilingual input with an 8192 token context length and utilizes dynamic resolution processing.
  • The model is released under the apache-2.0 license.

Summary of the deepseek-ai/DeepSeek-OCR-2 model card, 2026-10-01

What it is

Released byDeepSeek
Released2026-01-27
Parameters3.4B
VRAM6.8 GB for the weights

What it runs on

Memory and cards for DeepSeek-OCR-2 (BF16)

6.8 GBweights, file size
61 MBcache per 1K tokens
2.2 GBruntime overhead, at least
8,192 tokenscontext max
CardRequests at onceContext maxMemory
8K each
RTX 3060 12 GB5all 8K11.6 GB
RTX 4060 Ti 16 GB12all 8K15.4 GB
RTX 3090 24 GB28all 8K23.4 GB
RTX 4090 24 GB28all 8K23.4 GB
RTX 5090 32 GB43all 8K31.0 GB
L40S 48 GB69all 8K44.0 GB
A100 80 GB137all 8K78.2 GB
H100 80 GB127all 8K78.1 GB
RTX PRO 6000 Blackwell 96 GB158all 8K93.8 GB
DGX Spark (GB10) 128 GB unified185all 8K107 GB
H200 141 GB246all 8K138 GB
B200 180 GB319all 8K176 GB
2× RTX 3060 12 GB
tensor parallel
23all 8K11.6 GB a card
Memory needed at each load
Requests at once8K tokens each
19.5 GB
511.5 GB
813.1 GB
1617.1 GB
3225.1 GB
6441.2 GB

One card, with vLLM's small-card settings.

From the model card

What DeepSeek says about DeepSeek-OCR-2

Read the model card

Usage

Inference using Huggingface transformers on NVIDIA GPUs. Requirements tested on python 3.12.9 + CUDA11.8:

torch==2.6.0
transformers==4.46.3
tokenizers==0.20.3
einops
addict
easydict
pip install flash-attn==2.7.3 --no-build-isolation
from transformers import AutoModel, AutoTokenizer
import torch
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '0'
model_name = 'deepseek-ai/DeepSeek-OCR-2'

tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModel.from_pretrained(model_name, _attn_implementation='flash_attention_2', trust_remote_code=True, use_safetensors=True)
model = model.eval().cuda().to(torch.bfloat16)

# prompt = "\nFree OCR. "
prompt = "\nConvert the document to markdown. "
image_file = 'your_image.jpg'
output_path = 'your/output/dir'

res = model.infer(tokenizer, prompt=prompt, image_file=image_file, output_path = output_path, base_size = 1024, image_size = 768, crop_mode=True, save_results = True)

vLLM

Refer to 🌟GitHub for guidance on model inference acceleration and PDF processing, etc.

Support-Modes

  • Dynamic resolution
    • Default: (0-6)×768×768 + 1×1024×1024 — (0-6)×144 + 256 visual tokens ✅

Main Prompts

# document: \nConvert the document to markdown.
# without layouts: \nFree OCR.

Acknowledgement

We would like to thank DeepSeek-OCR, Vary, GOT-OCR2.0, MinerU, PaddleOCR for their valuable models and ideas.

We also appreciate the benchmark OmniDocBench.

Citation

@article{wei2025deepseek,
  title={DeepSeek-OCR: Contexts Optical Compression},
  author={Wei, Haoran and Sun, Yaofeng and Li, Yukun},
  journal={arXiv preprint arXiv:2510.18234},
  year={2025}
}
@article{wei2026deepseek,
  title={DeepSeek-OCR 2: Visual Causal Flow},
  author={Wei, Haoran and Sun, Yaofeng and Li, Yukun},
  journal={arXiv preprint arXiv:2601.20552},
  year={2026}
}

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms