From: deepseek-ai <huggingface.co/deepseek-ai>Newsgroups: alt.freeweights.deepseekSubject:

DeepSeek-OCR

Date: 2026-11-14Commit: 9f30c71Signed: 2DC28CC7B26A283B ✓

Image text to text model with 3.3B parameters. Safetensors weights, 6.68 GB in all. Published by deepseek-ai under MIT.

3.3B params6.68GBDeepSeek-OCRsafetensorspermissive
FactsParams3.3BSize6.68 GBFormatssafetensorsTaskimage text to textLicenseMITFrom sourcepermissive
$ fw get deepseek-ai/DeepSeek-OCR
# manifest sha256 228973e44235… · 6.68 GB · 21 files
$ fw verify ./DeepSeek-OCR deepseek-ai/DeepSeek-OCR
From sourceHosted (signed)deepseek-ai/DeepSeek-OCRLast check: 2026-11-14 21:14 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Overview

Size
6.68 GB
Weights
6.67 GB (safetensors)
Parameters
3.3B
Formats
safetensors
Task
image text to text
License
MIT (permissive)
Files
21, each with a sha256
Publisher
deepseek-ai
Added
2026-11-14
Section
alt.freeweights.deepseek
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-14 21:14 UTCpassed

Model card

From the publisher at commit 9f30c71. Shown as plain text with links; images open at the publisher.

Image: DeepSeek AI


Homepage Hugging Face

Discord Twitter Follow

🌟 Github | πŸ“₯ Model Download | πŸ“„ Paper Link | πŸ“„ Arxiv Paper Link |

DeepSeek-OCR: Contexts Optical Compression

Image: image

Explore the boundaries of visual-text compression.

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 = "<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)

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 = "<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)

Visualizations#

| Image: image | Image: image

| Image: image | Image: image

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

Files

21 files Β· 6.68 GBWeights 6.67 GB (safetensors). Sizes and sha256 from the signed manifest.
Show all 21 files with their sha256
FileSizesha256
.gitattributes1.78 KBd986431589fb401f45eebb2bd2116c2db320b63ebee0d6abb9cf355aeb800310
.ipynb_checkpoints/README-checkpoint.md4.34 KB04e5006bc8b904cca28c1c43286c81b5d00a5208f4b4f0de6357e3ff0e79ab4f
LICENSE1.08 KBf2c6c602815669d292889e5be8c802f2ed950653b77999b1584e8e6aed25d040
README.md6.31 KB4f5e1d9e3b0c65c442f9c57c708e15d06ba9e277bb58db49bc9ba833f62f8f76
assets/fig1.png396 KB3a709eb3fdb51cf6d8a546ffb8efe3c80bef61ae0183c2c8476a4c4a41efa3f1
assets/show1.jpg117 KB887e88e60e5833bc10a2cd7edb89ea7e6992abaae5e1550b027c611b8b8456f2
assets/show2.jpg216 KB81d08f7f33d9d39b95dd9b8162506659e6822d621b9829a208f3830c34c2b4d0
assets/show3.jpg247 KBcd24b0cfc7b6c0b1b34bd1aa55bc385e746298fdd82410db6c0d4e0bf69085c0
assets/show4.jpg269 KB2fe88eacc470c34d00225151372d3770948864f3d9cfaae16afa15b2432d7793
config.json2.67 KBac358c28898de6a71e84e0cb959fcc97fcb9c674edae13cd24286c17b90032d8
configuration_deepseek_v2.py10.6 KB6ab21f29a4722e26fa28c8e0d4277591689a598df17cf6c712330e8f62b3fc7c
conversation.py9.25 KBec7b6ce89bcda643de1f43269ffa66a7b2e65dc3ed30e427958f776546b4ba03
deepencoder.py38.0 KB0ae2fb6d1e5ae8cf100fc32f854830acd08c821a0a1f23a94a76588c222ddcf2
model-00001-of-000001.safetensors6.67 GB1169e7cdc28ff2fb6186556acb2175db148ad26a62097df4c45a17e523180d3f
model.safetensors.index.json247 KBb51d17cc7b282880006a162b06e3a5c4c0a566f3d3093f34a93450ca5a91bd74
modeling_deepseekocr.py40.1 KB5835e0b9e1942fe36df9123009d1d80a2b78ccbe6a2d535668a6561e3d4068b1
modeling_deepseekv2.py82.2 KB69184a0493d1fdac21c360f9f9eabc5b5af3188e0265df44cfaeafc44f9095e3
processor_config.json460 B0fe7ba9aa6b967a90e4af40d43c8030cbdd3dbcfbb387b8907625d5e54f0dbbe
special_tokens_map.json801 Bab4bd57ce17d62e39e0a39e739de1e407484f090f0b2c7e391312bca7a5b061a
tokenizer.json9.98 MBa02f8fd5228c90256bb4f6554c34a579d48f909e5beb232dc4afad870b55a8b4
tokenizer_config.json166 KBa0cbe8464049da1f891b7a12676de06af4cb54c130995d42f71adc1c30c6e9f3
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
9f30c71f44 pinned now manifest updated, same commit2026-11-14 21:14 UTC21 files Β· 6.68 GB
9f30c71f442026-11-14 21:14 UTC21 files Β· 6.68 GB

Use it

$ fw get deepseek-ai/DeepSeek-OCR
# manifest sha256 228973e44235… · 6.68 GB · 21 files
$ fw verify ./DeepSeek-OCR deepseek-ai/DeepSeek-OCR
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/deepseek-ai/DeepSeek-OCR.json --dir ./DeepSeek-OCR $ python3 fw.py verify ./DeepSeek-OCR ./deepseek-ai__DeepSeek-OCR.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download deepseek-ai/DeepSeek-OCR --revision 9f30c71f441d010e5429c532364a86705536c53a --local-dir ./DeepSeek-OCR
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForImageTextToText, AutoProcessor processor = AutoProcessor.from_pretrained("deepseek-ai/DeepSeek-OCR", revision="9f30c71f441d010e5429c532364a86705536c53a") model = AutoModelForImageTextToText.from_pretrained("deepseek-ai/DeepSeek-OCR", revision="9f30c71f441d010e5429c532364a86705536c53a", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve deepseek-ai/DeepSeek-OCR --revision 9f30c71f441d010e5429c532364a86705536c53a

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
LICENSE
Text sha256
f2c6c602815669d292889e5be8c802f2ed950653b77999b1584e8e6aed25d040
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: deepseek-ai <huggingface.co/deepseek-ai>Newsgroups: alt.freeweights.deepseekSubject: DeepSeek-OCRDate: 2026-11-14Commit: 9f30c71Signed: 2DC28CC7B26A283B ✓
Upstream
deepseek-ai/DeepSeek-OCR
Pinned commit
9f30c71f441d010e5429c532364a86705536c53a
Manifest
DeepSeek-OCR.json Β· .minisig
Manifest sha256
228973e44235272db589096d0d3f1a049218c541097b0638771a7d0070eabf3b
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:14 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/deepseek-ai/DeepSeek-OCR.json $ curl -O https://freeweights.allternit.com/manifests/deepseek-ai/DeepSeek-OCR.json.minisig $ minisign -Vm DeepSeek-OCR.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download deepseek-ai/DeepSeek-OCR
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. DeepSeek-OCR.json. Provenance. Takedown history: none.
From: timm <huggingface.co/timm>Subject: deepseek_vit_412m.deepseek_v4_1_flash
From: bartowski <huggingface.co/bartowski>Subject: deepseek-ai_DeepSeek-R1-0528-GGUF
From: bartowski <huggingface.co/bartowski>Subject: deepseek-ai_DeepSeek-R1-0528-Qwen3-8B-GGUF
From: bartowski <huggingface.co/bartowski>Subject: deepseek-ai_DeepSeek-V3-0324-GGUF
From: bartowski <huggingface.co/bartowski>Subject: deepseek-ai_DeepSeek-V3.1-GGUF
From: mlx-community <huggingface.co/mlx-community>Subject: deepseek-ai-DeepSeek-V4-Flash-8bit