MerchantryTidbits

doc-parsing / library

HunyuanOCR

Capability: HunyuanOCR

Use it when

  • I need local OCR and document parsing from a document image through a documented inference server.
  • I need to extract long structured output from dense document or table images.

What it solves

Not the fit when

  • text PDFs that already have usable embedded text
  • the unified vLLM environment on machines without CUDA 13; use the separately documented lighter or llama.cpp paths instead
  • users unable to download and locally operate the model weights and inference stack
  • ocr-overkill-text-pdf
  • gpu-vram-ceiling

Install

git clone https://github.com/Tencent-Hunyuan/HunyuanOCR.git && cd HunyuanOCR && pip install uv && uv venv --python 3.12 && 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"

Invoke

Install huggingface_hub[cli], download `tencent/HunyuanOCR` to `./HunyuanOCR` excluding `v1.0/*`, run `MODEL_PATH=./HunyuanOCR GPU=0 PORT=8000 bash inference/vLLM/serve.sh`, then invoke `python inference/vLLM/infer_vllm_client.py --image /path/to/document.png --task-type doc_parse --model tencent/HunyuanOCR --port 8000 --max-tokens 32768`.

Alternatives

No reviewed alternatives recorded yet.