Model reference · open weights
HunyuanOCR is an open-weight language model from tencent. HunyuanOCR (BF16) weighs 2.2 GB; the smallest configuration that runs it is RTX 3060 12 GB.
Summary of the tencent/HunyuanOCR model card, 2026-10-01
What it is
| Released by | tencent |
|---|---|
| Released | 2025-11-18 |
| Parameters | 1.1B |
| VRAM | 2.2 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 9 | 2 | 74K | 11.6 GB |
| RTX 4060 Ti 16 GB | 14 | 3 | 112K | 15.4 GB |
| RTX 3090 24 GB | 23 | 5 | all 128K | 23.4 GB |
| RTX 4090 24 GB | 23 | 5 | all 128K | 23.4 GB |
| RTX 5090 32 GB | 33 | 8 | all 128K | 31.0 GB |
| L40S 48 GB | 49 | 12 | all 128K | 44.0 GB |
| A100 80 GB | 91 | 22 | all 128K | 78.2 GB |
| H100 80 GB | 87 | 21 | all 128K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 106 | 26 | all 128K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 123 | 30 | all 128K | 107 GB |
| H200 141 GB | 161 | 40 | all 128K | 138 GB |
| B200 180 GB | 208 | 52 | all 128K | 176 GB |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 4.9 GB | 7.3 GB |
| 5 | 8.2 GB | 20.2 GB |
| 8 | 10.6 GB | 29.9 GB |
| 16 | 17.0 GB | 55.7 GB |
| 32 | 29.9 GB | 107 GB |
| 64 | 55.7 GB | 210 GB |
One card, with vLLM's small-card settings.
From the model card
🤗 HF Model | 💻 GitHub Repo | 📄 Paper
📦 Model layout. This repository hosts HunyuanOCR-1.5 checkpoint at the root (target base weights). The DFlash speculative-decoding draft lives under
dflash/, and the previous HunyuanOCR-1.0 is archived underv1.0/(load it withsubfolder="v1.0", or download thev1.0/directory directly).
HunyuanOCR-1.5 is a lightweight, end-to-end OCR-specialized vision-language model. It targets a broad range of text-centric visual tasks and unifies document parsing, text spotting, information extraction, text-image translation within a single end-to-end VLM.
Building upon the validated lightweight architecture of HunyuanOCR-1.0, HunyuanOCR-1.5 does not redesign the model backbone. Instead, it performs a systematic upgrade around two goals — making the model faster and better:
llama.cpp with a GGUF-converted checkpoint and an OpenAI-compatible llama-server. A DFlash-adapted llama.cpp fork is provided as well, so the same speculative-decoding acceleration is available on PC.Together, HunyuanOCR-1.5 achieves both faster inference and broader OCR capability coverage while retaining the deployment advantages of a lightweight end-to-end model. The full SFT / DFlash training pipeline and the transformers / vLLM / llama.cpp inference stack are open-sourced in the GitHub repo.
Inference now uses a single unified environment (built on uv, requires CUDA 13) that runs all three configurations from the same install: vLLM AR, DFlash speculative decoding, and native transformers. Accuracy alignment across the three has been verified.
pip install uv
uv venv --python 3.12.11 && source .venv/bin/activate
uv pip install "vllm>=0.25.1"
uv pip install --no-build-isolation --no-cache-dir "flash-attn==2.8.3"
The inference code lives on GitHub under inference/ (inference/vLLM, inference/DFlash, inference/transformers). See docs/inference/inference.md for the full setup and usage. If you lack CUDA 13 or only need one configuration, that document also points to the lighter per-configuration recipes in the archive.
Common prerequisites: Python 3.10+ (3.12 tested), an NVIDIA GPU, and huggingface_hub for downloading the weights:
pip install -U "huggingface_hub[cli]"
# target base (1.5) — skip the archived 1.0 to save space
huggingface-cli download tencent/HunyuanOCR --local-dir ./HunyuanOCR --exclude "v1.0/*"
The download contains both the base model and the dflash/ draft model.
All configurations share the same weights and the same task-type prompts + sampling (temperature=0.0, top_p=1.0, top_k=-1, repetition_penalty=1.08) + post-processing, so their outputs are directly comparable. Grab the toolkit from GitHub first:
git clone https://github.com/Tencent-Hunyuan/HunyuanOCR.git
cd HunyuanOCR
The model ships the official HunYuanVLForConditionalGeneration + AutoProcessor
integration (transformers ≥ 5.13.0). The simplest path — weights are pulled
from the Hub automatically:
import torch
from transformers import AutoProcessor, HunYuanVLForConditionalGeneration
MODEL_ID = "tencent/HunyuanOCR"
processor = AutoProcessor.from_pretrained(MODEL_ID, trust_remote_code=True, use_fast=False)
model = HunYuanVLForConditionalGeneration.from_pretrained(
MODEL_ID, torch_dtype=torch.bfloat16, device_map="auto",
trust_remote_code=True,
).eval()
prompt = (
"提取文档图片中正文的所有信息用markdown格式表示,其中页眉、页脚部分忽略,"
"表格用html格式表达,文档中公式用latex格式表示,按照阅读顺序组织进行解析。"
)
messages = [{
"role": "user",
"content": [
{"type": "image", "image": "/path/to/document.png"},
{"Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.