AI SeedbankHelp preserve open and free AI for humanity's future

← All models

deepseek-ai_DeepSeek-OCR

deepseek-ai · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: 2 · Leechers: 0

Observed 2026-09-05T20:48:33Z across trackers.

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


pipeline_tag: image-text-to-text language:

  • multilingual tags:
  • deepseek
  • vision-language
  • ocr
  • custom_code license: mit library_name: transformers


🌟 Github | 📥 Model Download | 📄 Paper Link | 📄 Arxiv Paper Link |

DeepSeek-OCR: Contexts Optical Compression

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

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

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:49f368f8e62842fce7725cd6adeb6c559ea46f0a&dn=deepseek-ai_DeepSeek-OCR

Open magnet in torrent client · infohash 49f368f8e62842fce7725cd6adeb6c559ea46f0a

Files & hashes

PathSizesha1sha256
LICENSE1.1 KB (1,084 B)d62e3bef9f054f21b7fc616365850fbf879a99fff2c6c602815669d292889e5be8c802f2ed950653b77999b1584e8e6aed25d040
README.md6.2 KB (6,308 B)c6b3fb147ef7261513f4f76020def3e73f9a75ae4f5e1d9e3b0c65c442f9c57c708e15d06ba9e277bb58db49bc9ba833f62f8f76
assets/fig1.png386.8 KB (396,104 B)2816cad643bdfb0931050bde621693bafa1e64f23a709eb3fdb51cf6d8a546ffb8efe3c80bef61ae0183c2c8476a4c4a41efa3f1
assets/show1.jpg114.1 KB (116,813 B)81f65e06ae9011b0f4c9e9eeb75e8e9fbc34d171887e88e60e5833bc10a2cd7edb89ea7e6992abaae5e1550b027c611b8b8456f2
assets/show2.jpg210.9 KB (216,011 B)905532c1e911b021768f8941024da88c15a1b85d81d08f7f33d9d39b95dd9b8162506659e6822d621b9829a208f3830c34c2b4d0
assets/show3.jpg241.3 KB (247,052 B)b57fc222980912b1b930efd1df589bd07de303c4cd24b0cfc7b6c0b1b34bd1aa55bc385e746298fdd82410db6c0d4e0bf69085c0
assets/show4.jpg262.5 KB (268,763 B)a5719f945c6018cce7dc5b96285f41023b2a2fe82fe88eacc470c34d00225151372d3770948864f3d9cfaae16afa15b2432d7793
config.json2.6 KB (2,666 B)0bc764cb729cfad6649038ce3b5fa6c29e0c5b34ac358c28898de6a71e84e0cb959fcc97fcb9c674edae13cd24286c17b90032d8
configuration_deepseek_v2.py10.4 KB (10,646 B)a8622c20101ed06940eb7fb6164babbc499bc5246ab21f29a4722e26fa28c8e0d4277591689a598df17cf6c712330e8f62b3fc7c
conversation.py9.0 KB (9,253 B)65c295e81cd804080ec238b31d1922f33e1f9405ec7b6ce89bcda643de1f43269ffa66a7b2e65dc3ed30e427958f776546b4ba03
deepencoder.py37.1 KB (38,008 B)de1687dfec3a4a8a00980a8444baba0082ce779b0ae2fb6d1e5ae8cf100fc32f854830acd08c821a0a1f23a94a76588c222ddcf2
model-00001-of-000001.safetensors6.21 GB (6,672,547,120 B)9beaf6c435986084fc79d37f79e4e13de07a42361169e7cdc28ff2fb6186556acb2175db148ad26a62097df4c45a17e523180d3f
model.safetensors.index.json241.0 KB (246,759 B)76a9e9987d31aec961c934257dc0159b295fdaa6b51d17cc7b282880006a162b06e3a5c4c0a566f3d3093f34a93450ca5a91bd74
modeling_deepseekocr.py39.2 KB (40,133 B)05ebf949161b9e0684a676de9526089b1deaa6365835e0b9e1942fe36df9123009d1d80a2b78ccbe6a2d535668a6561e3d4068b1
modeling_deepseekv2.py80.3 KB (82,224 B)ff008470d58b98d3f8304ecfb6ee1bd04c87773969184a0493d1fdac21c360f9f9eabc5b5af3188e0265df44cfaeafc44f9095e3
processor_config.json460 B (460 B)9153af2ad5e59ad9cf24fed29cf286fcf10d389a0fe7ba9aa6b967a90e4af40d43c8030cbdd3dbcfbb387b8907625d5e54f0dbbe
special_tokens_map.json801 B (801 B)d59d312be868edc63b195e19e256c730dba685adab4bd57ce17d62e39e0a39e739de1e407484f090f0b2c7e391312bca7a5b061a
tokenizer.json9.5 MB (9,979,544 B)c93a1c4d2ecf31bb5a9ec39eb73dfbf915aaf77ea02f8fd5228c90256bb4f6554c34a579d48f909e5beb232dc4afad870b55a8b4
tokenizer_config.json162.0 KB (165,938 B)ba9d4175d69cde58ad9f68a76a4758df091eaffaa0cbe8464049da1f891b7a12676de06af4cb54c130995d42f71adc1c30c6e9f3

Cite this release

Canonical URL
https://aiseedbank.org/models/deepseek-ai_DeepSeek-OCR/
Slug
deepseek-ai_DeepSeek-OCR
Infohash
49f368f8e62842fce7725cd6adeb6c559ea46f0a
License
mit
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: deepseek-ai_DeepSeek-OCR.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositorydeepseek-ai/DeepSeek-OCR
Revision (pinned)9f30c71f441d010e5429c532364a86705536c53a
Fetched at2026-08-20T20:53:13Z
License at fetchmit
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-08-20T20:57:35Z

mit6.23 GB (6,684,375,687 bytes)transformerssafetensorsdeepseek_vl_v2feature-extractiondeepseekvision-languageocrcustom_codeimage-text-to-textmultilingualeval-resultspaper: 2510.18234