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

DeepSeek-OCR-2

Date: 2026-11-14Commit: aaa02f3Signed: 2DC28CC7B26A283B ✓

Image text to text model with 3.4B parameters. Safetensors weights, 6.79 GB in all. Published by deepseek-ai under Apache-2.0.

3.4B params6.79GBDeepSeek-OCR-2safetensorspermissive
FactsParams3.4BSize6.79 GBFormatssafetensorsTaskimage text to textLicenseApache-2.0From sourcepermissive
$ fw get deepseek-ai/DeepSeek-OCR-2
# manifest sha256 5f6db77082ed… · 6.79 GB · 16 files
$ fw verify ./DeepSeek-OCR-2 deepseek-ai/DeepSeek-OCR-2
From sourceHosted (signed)deepseek-ai/DeepSeek-OCR-2Last 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.79 GB
Weights
6.78 GB (safetensors)
Parameters
3.4B
Formats
safetensors
Task
image text to text
License
Apache-2.0 (permissive)
Files
16, 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 aaa02f3. 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 2: Visual Causal Flow

Image: image

Explore more human-like visual encoding.

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-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 = "<image>\nFree OCR. "
prompt = "<image>\n<|grounding|>Convert 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)

vLLM#

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

Support-Modes#

  • Dynamic resolution
    • Default: (0-6)×768×768 + 1×1024×1024 — (0-6)×144 + 256 visual tokens ✅

Main Prompts#

# document: <image>\n<|grounding|>Convert the document to markdown.
# without layouts: <image>\nFree OCR.

Acknowledgement#

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.

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

Files

16 files · 6.79 GBWeights 6.78 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 16 files with their sha256
FileSizesha256
.gitattributes1.57 KBd8c58cd65e84cd2e9639504e924a7b7e9319b5db04ef5eb6257da76c4769088c
LICENSE.txt11.3 KB9debfe045c2a2755a52d0ae1087605d15770fe6636798c09efd93c1dc732ef28
README.md4.14 KB507812c8e4620f72625305377daa697faf7135d7400ac25ab4b7d6299a92d60b
assets/fig1.png141 KBbfa3301b397df240c5eba7206c7865cae3d9aaf6674a6c8a68904a9c98bcbc77
config.json2.59 KBe2bb23b49b445f0bfd6eeb978bac9f19a2df82cb38472754e4ae83662d18f845
configuration_deepseek_v2.py10.6 KB6ab21f29a4722e26fa28c8e0d4277591689a598df17cf6c712330e8f62b3fc7c
conversation.py9.25 KBec7b6ce89bcda643de1f43269ffa66a7b2e65dc3ed30e427958f776546b4ba03
deepencoderv2.py36.3 KB562e4da383b7ba5ef5db79b5ddfb705c649a80044b99122fe4d5d42c16284193
model-00001-of-000001.safetensors6.78 GBd8ff67a424ba6f4dd077885eb9d6a05d2537e76fe5491f0e2a9b712f8c8870fa
model.safetensors.index.json247 KBf97aa45bbff64ccb2d645789303b1e2be17f45990812e5f0c2f80d169587aed7
modeling_deepseekocr2.py39.2 KB4166e8f014250143e257f48fb4eaa57a2ef49fa6ad375ecc016bc7d262fc7160
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
aaa02f3811 pinned now manifest updated, same commit2026-11-14 21:14 UTC16 files · 6.79 GB
aaa02f38112026-11-14 21:14 UTC16 files · 6.79 GB

Use it

$ fw get deepseek-ai/DeepSeek-OCR-2
# manifest sha256 5f6db77082ed… · 6.79 GB · 16 files
$ fw verify ./DeepSeek-OCR-2 deepseek-ai/DeepSeek-OCR-2
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-2.json --dir ./DeepSeek-OCR-2 $ python3 fw.py verify ./DeepSeek-OCR-2 ./deepseek-ai__DeepSeek-OCR-2.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download deepseek-ai/DeepSeek-OCR-2 --revision aaa02f3811945a91062062994c5c4a3f4c0af2b0 --local-dir ./DeepSeek-OCR-2
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-2", revision="aaa02f3811945a91062062994c5c4a3f4c0af2b0") model = AutoModelForImageTextToText.from_pretrained("deepseek-ai/DeepSeek-OCR-2", revision="aaa02f3811945a91062062994c5c4a3f4c0af2b0", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve deepseek-ai/DeepSeek-OCR-2 --revision aaa02f3811945a91062062994c5c4a3f4c0af2b0

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
LICENSE.txt
Text sha256
9debfe045c2a2755a52d0ae1087605d15770fe6636798c09efd93c1dc732ef28
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-OCR-2Date: 2026-11-14Commit: aaa02f3Signed: 2DC28CC7B26A283B ✓
Upstream
deepseek-ai/DeepSeek-OCR-2
Pinned commit
aaa02f3811945a91062062994c5c4a3f4c0af2b0
Manifest
DeepSeek-OCR-2.json · .minisig
Manifest sha256
5f6db77082ed025810fa4946fc1af9c9056cb3afb8ec67255e8d3e5decc469ee
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-2.json $ curl -O https://freeweights.allternit.com/manifests/deepseek-ai/DeepSeek-OCR-2.json.minisig $ minisign -Vm DeepSeek-OCR-2.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-2
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-2.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