Model reference · open weights

DeepSeek-OCR

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

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

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • DeepSeek-OCR is a 3.3B parameter image-text-to-text model developed by DeepSeek for optical character recognition and document conversion.
  • It supports multilingual inputs and operates with an 8192 token context length.
  • The model is distributed under the MIT license and is available as deepseek-ai/DeepSeek-OCR.

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

What it is

Released byDeepSeek
Released2025-10-17
Parameters3.3B
VRAM6.7 GB for the weights

What it runs on

Memory and cards for DeepSeek-OCR (BF16)

6.7 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 GB128all 8K78.1 GB
RTX PRO 6000 Blackwell 96 GB159all 8K93.8 GB
DGX Spark (GB10) 128 GB unified186all 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.4 GB
511.4 GB
812.9 GB
1617.0 GB
3225.0 GB
6441.1 GB

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

From the model card

What DeepSeek says about DeepSeek-OCR

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'

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'

# infer(self, tokenizer, prompt='', image_file='', output_path = ' ', base_size = 1024, image_size = 640, crop_mode = True, test_compress = False, save_results = False):

# Tiny: base_size = 512, image_size = 512, crop_mode = False
# Small: base_size = 640, image_size = 640, crop_mode = False
# Base: base_size = 1024, image_size = 1024, crop_mode = False
# Large: base_size = 1280, image_size = 1280, crop_mode = False

# Gundam: base_size = 1024, image_size = 640, crop_mode = True

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

vLLM

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

[2025/10/23] 🚀🚀🚀 DeepSeek-OCR is now officially supported in upstream vLLM.

uv venv
source .venv/bin/activate
# Until v0.11.1 release, you need to install vLLM from nightly build
uv pip install -U vllm --pre --extra-index-url https://wheels.vllm.ai/nightly
from vllm import LLM, SamplingParams
from vllm.model_executor.models.deepseek_ocr import NGramPerReqLogitsProcessor
from PIL import Image

# Create model instance
llm = LLM(
    model="deepseek-ai/DeepSeek-OCR",
    enable_prefix_caching=False,
    mm_processor_cache_gb=0,
    logits_processors=[NGramPerReqLogitsProcessor]
)

# Prepare batched input with your image file
image_1 = Image.open("path/to/your/image_1.png").convert("RGB")
image_2 = Image.open("path/to/your/image_2.png").convert("RGB")
prompt = "\nFree OCR."

model_input = [
    {
        "prompt": prompt,
        "multi_modal_data": {"image": image_1}
    },
    {
        "prompt": prompt,
        "multi_modal_data": {"image": image_2}
    }
]

sampling_param = SamplingParams(
            temperature=0.0,
            max_tokens=8192,
            # ngram logit processor args
            extra_args=dict(
                ngram_size=30,
                window_size=90,
                whitelist_token_ids={128821, 128822},  # whitelist: ,
            ),
            skip_special_tokens=False,
        )
# Generate output
model_outputs = llm.generate(model_input, sampling_param)

# Print output
for output in model_outputs:
    print(output.outputs[0].text)

Visualizations

Acknowledgement

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

We also appreciate the benchmarks: Fox, OminiDocBench.

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}
}

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