Model reference · open weights
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.
Summary of the deepseek-ai/DeepSeek-OCR-2 model card, 2026-10-01
What it is
| Released by | DeepSeek |
|---|---|
| Released | 2026-01-27 |
| Parameters | 3.4B |
| VRAM | 6.8 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory |
|---|---|---|---|
| 8K each | |||
| RTX 3060 12 GB | 5 | all 8K | 11.6 GB |
| RTX 4060 Ti 16 GB | 12 | all 8K | 15.4 GB |
| RTX 3090 24 GB | 28 | all 8K | 23.4 GB |
| RTX 4090 24 GB | 28 | all 8K | 23.4 GB |
| RTX 5090 32 GB | 43 | all 8K | 31.0 GB |
| L40S 48 GB | 69 | all 8K | 44.0 GB |
| A100 80 GB | 137 | all 8K | 78.2 GB |
| H100 80 GB | 127 | all 8K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 158 | all 8K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 185 | all 8K | 107 GB |
| H200 141 GB | 246 | all 8K | 138 GB |
| B200 180 GB | 319 | all 8K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 23 | all 8K | 11.6 GB a card |
| Requests at once | 8K tokens each |
|---|---|
| 1 | 9.5 GB |
| 5 | 11.5 GB |
| 8 | 13.1 GB |
| 16 | 17.1 GB |
| 32 | 25.1 GB |
| 64 | 41.2 GB |
One card, with vLLM's small-card settings.
From the model card
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)
Refer to 🌟GitHub for guidance on model inference acceleration and PDF processing, etc.
# document: \nConvert the document to markdown.
# without layouts: \nFree OCR.
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.
@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.