OCRRouter

DeepSeek-OCR online

Open-source vision model that compresses pages into few tokens.

DeepSeek-OCR versions: DeepSeek-OCR 2 (January 2026)

PDF, PNG, JPG, WebP, HEIC. Up to 20 MB each, 10 files.No file?
Model ID
deepseek/deepseek-ocr
Type
Open source
Price
1 credit / page ($1.00 per 1,000 pages)
Typical speed
1.1 s / page
Inputs
PDF, images
Languages
100+ languages
Max pages per request
200
Output
Markdown, JSON with positions
License
MIT
Supports
TablesMathBounding boxesMultilingual
curl https://api.ocrrouter.ai/v1/ocr \
  -H "Authorization: Bearer $OCRROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek/deepseek-ocr",
    "file_url": "https://example.com/invoice.pdf",
    "format": "markdown"
  }'

DeepSeek-OCR speed and reliability

Loading…

Measured on our own traffic over the last 7 days.

DeepSeek-OCR pricing

DeepSeek-OCR costs 1 credits per page. One dollar buys 1,000 credits, so 1,000 pages cost $1.00. You only pay for pages that return a result.

New accounts get 50 free credits, enough for about 50 pages with this model. See pricing for credit packs.

Similar models

All DeepSeek-OCR alternativesBest OCR models by use case

Compare DeepSeek-OCR

DeepSeek-OCR versions

What DeepSeek-OCR is and how it works

DeepSeek-OCR is an open-source vision-language model released by DeepSeek on October 20, 2025, with the paper "DeepSeek-OCR: Contexts Optical Compression" (arXiv 2510.18234). It has two parts: DeepEncoder, a vision encoder that combines a SAM-style window-attention stage with a CLIP-style global-attention stage and a 16x convolutional token compressor, and a DeepSeek3B-MoE decoder with about 570M active parameters. The research idea is "optical compression": render long text as an image and let the model read it back from far fewer vision tokens than the text would need as text tokens. The paper reports about 97% decoding precision when there are fewer than 10 text tokens per vision token, and about 60% at a 20x ratio. That makes it both an OCR model and an experiment in compressing long LLM context.

Resolution modes and vision-token budget

DeepSeek-OCR does not use a fixed number of tokens per page. The README and paper describe native-resolution modes: Tiny (512x512, 64 vision tokens), Small (640x640, 100 tokens), Base (1024x1024, 256 tokens) and Large (1280x1280, 400 tokens), plus a dynamic "Gundam" mode that tiles a large page into 640x640 crops plus one 1024x1024 global view. Fewer tokens mean faster, cheaper decoding, while more tokens help with dense pages such as newspapers or small print. In the Transformers example these map to base_size, image_size and crop_mode. The default in the README example (base_size=1024, image_size=640, crop_mode=True) is Gundam mode.

Run DeepSeek-OCR locally in Python

The official repository (github.com/deepseek-ai/DeepSeek-OCR) was tested with CUDA 11.8, PyTorch 2.6.0 and Python 3.12, and needs an NVIDIA GPU. The shortest path is Hugging Face Transformers:

from transformers import AutoModel, AutoTokenizer
import torch

name = 'deepseek-ai/DeepSeek-OCR'
tok = AutoTokenizer.from_pretrained(name, trust_remote_code=True)
model = AutoModel.from_pretrained(name, _attn_implementation='flash_attention_2',
                                  trust_remote_code=True, use_safetensors=True)
model = model.eval().cuda().to(torch.bfloat16)

res = model.infer(tok, prompt='<image>\n<|grounding|>Convert the document to markdown. ',
                  image_file='page.jpg', output_path='out',
                  base_size=1024, image_size=640, crop_mode=True, save_results=True)

For batch work, DeepSeek-OCR is supported in upstream vLLM (since October 23, 2025). Ollama also ships it as ollama run deepseek-ocr.

Prompts: plain OCR, Markdown and grounding

DeepSeek-OCR is steered by its prompt. The README lists these patterns:

  • <image>\n<|grounding|>Convert the document to markdown. for full document conversion with layout.
  • <image>\nFree OCR. for plain text without layout.
  • <image>\nParse the figure. for charts and figures inside documents.
  • <image>\nDescribe this image in detail. for a general description.
  • <image>\nLocate <|ref|>xxxx<|/ref|> in the image. to find a phrase and return its box.

The <|grounding|> token makes the model output coordinates alongside text, which is how it returns bounding boxes. Without it you get plain text or Markdown only.

PDF handling and throughput

The model reads images, so PDFs are first rendered page by page into images. The repository ships a vLLM script for this (run_dpsk_ocr_pdf.py), and DeepSeek reports roughly 2,500 tokens per second of concurrent output on one A100-40G with it. The paper says one A100-40G can produce more than 200,000 pages of training data per day. Through the OCRRouter API you skip that step: send a PDF or image by URL or upload, and DeepSeek-OCR returns Markdown for each page. The model is live on OCRRouter as deepseek/deepseek-ocr.

Benchmarks and where it falls short

On OmniDocBench the paper reports that DeepSeek-OCR beats GOT-OCR2.0 (256 tokens per page) while using only 100 vision tokens, and beats MinerU 2.0 (more than 6,000 tokens per page on average) with under 800 vision tokens. It was not the top OmniDocBench score at release; it wins on accuracy per token. Known limits: accuracy drops sharply past about 10x compression, so very dense pages need the Large or Gundam modes; like other generative OCR models it can repeat text or invent text on blank or low-quality areas (the vLLM recipe adds an n-gram logits processor to curb repetition); and it needs a GPU to run at a usable speed. DeepSeek-OCR 2 (January 2026) improves reading order and scores 3.73 points higher on OmniDocBench v1.5.

License, GitHub, paper and the API

The code and weights of DeepSeek-OCR are released under the MIT license, so commercial use is allowed. Weights are on Hugging Face as deepseek-ai/DeepSeek-OCR, code is at github.com/deepseek-ai/DeepSeek-OCR, and the paper is arXiv 2510.18234. Run it yourself if you have an NVIDIA GPU and steady volume. Use an API if you don't want to manage CUDA, vLLM versions and PDF rendering. OCRRouter serves DeepSeek-OCR through the same endpoint as its other models, so you can compare it with other models on your own pages by changing one model name.

Questions