DeepSeek-OCR
DeepSeek · deepseek-ai/DeepSeek-OCR
Weights license: MIT · code and components may use other terms
Quality
No comparable score
We track no public, comparable benchmark that covers this model yet. No score is inferred.
Reported by the publisher
Runs on
Fast memory holds it 118
The planning estimate fits the memory the model can use quickly: graphics card VRAM, or unified memory within the macOS GPU share.
Show all 118
Within memory, outside the fast part 1
Within the machine's memory, outside its fast part: on a graphics card the layers that do not fit run on the CPU from PC RAM (the listed RAM, or 32 GB assumed); on a Mac, above the macOS default GPU share. Not a speed figure.
Hardware profiles grouped by the Q4 planning estimate on each machine (dedicated GPUs reserve 2 GB; unified and system memory 25%, 2 to 8 GB): the fast memory holds it, it is within memory but outside the fast part (layers offloaded to PC RAM, or above the macOS GPU share), or the machine is one memory tier short. Not a measured fit or speed.
DeepSeek released DeepSeek-OCR on 2025-10-20: a vision-language model that answers about images, with 3.34B parameters on the Hugging Face count and the MIT license. Languages the publisher declares: Multilingual.
License: commercial use allowed. At Q4 the weights load about 2.5 GB before each machine's reserve; image resolution, video frames and context add memory, and the vision encoder needs support in the runtime you pick.
Measured speed
No published measurement for this checkpoint
Tokens per second are shown only when a source publishes them with hardware, build and setup. They are never estimated.
How to run
Runtime compatibility and tokens per second have not been measured for this entry. Published metadata and a memory estimate do not prove a successful local run.
Library in source: transformers
Documented ways to run it
Copied as printed in the linked source (read 2026-10-18); not run by this site.
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 = "<image>\nFree OCR. "
prompt = "<image>\n<|grounding|>Convert 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)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/nightlyfrom 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 = "<image>\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: <td>, </td>
),
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)Technical details
What the source and the catalog store for this checkpoint. Missing fields are left out, never zero.
- Checkpoint / source
- deepseek-ai/DeepSeek-OCR
- Task
- image-text-to-text
- Architecture
- DeepseekOCRForCausalLM
- Library in source
- transformers
- Weight license
- MITdeepseek-ai/DeepSeek-OCR model card (Hugging Face) · read 2026-10-18source
- Commercial use
- Allowed MIT license text (SPDX) · read 2026-10-18license text
- Languages
- MultilingualModel card metadata · read 2026-10-25source
- Context
- 8,192 tokensconfig.json max_position_embeddings; the card states no figuresource
- Released
- deepseek-ai/DeepSeek-OCR README (GitHub) · read 2026-10-09source
Every stored field
- Revision checked
- 9f30c71f441d010e5429c532364a86705536c53a
- Architecture
- DeepseekOCRForCausalLM
- Library
- transformers
- Hub task tag
- image-text-to-text
- Formats
- transformers, safetensors
- Access
- Open download
- Publisher kind
- Official
- Hub parameter count
- 3,336,106,240safetensors.total
- Repository created
- 2025-10-17creation is not the model's release
- Repository updated
- 2025-11-04a commit is not a release date
- Hub downloads (30 days) · likes
- 2,072,209 · 3,457this repository only · read 2026-10-25
- Catalog state
- Hub config or weights found; no inventory benchmark link
Sources
Identity and published specifications come from the checkpoint page. Benchmark scores belong to the named release and do not measure speed on your computer.
- Publisher model card
- License: deepseek-ai/DeepSeek-OCR model card (Hugging Face)
- Release date: deepseek-ai/DeepSeek-OCR README (GitHub)
Curated facts checked: 2026-10-18. The license and release date cite the publisher's sources; parameters, files and task come from the Hugging Face record, and memory is a labelled estimate from its parameter count. A value no source states stays empty; a repository commit is not a model release date.






























































