How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf AnandSingh/hunyuanocr-GGUF:
# Run inference directly in the terminal:
llama cli -hf AnandSingh/hunyuanocr-GGUF:
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf AnandSingh/hunyuanocr-GGUF:
# Run inference directly in the terminal:
llama cli -hf AnandSingh/hunyuanocr-GGUF:
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf AnandSingh/hunyuanocr-GGUF:
# Run inference directly in the terminal:
./llama-cli -hf AnandSingh/hunyuanocr-GGUF:
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf AnandSingh/hunyuanocr-GGUF:
# Run inference directly in the terminal:
./build/bin/llama-cli -hf AnandSingh/hunyuanocr-GGUF:
Use Docker
docker model run hf.co/AnandSingh/hunyuanocr-GGUF:
Quick Links

HunyuanOCR GGUF

HunyuanOCR converted to GGUF format for inference with llama.cpp.

This is a quantization of Tencent's HunyuanOCR — a 1B parameter OCR expert Vision-Language Model. Native support was added in llama.cpp build b8670 (April 2026).

Model Architecture

Component Spec
Type Vision-Language Model (VLM)
Parameters ~1.12B
Text Model hunyuan-dense, 24-layer decoder, 1024 dim, GQA (16Q/8KV)
Vision Encoder 27-layer ViT, 1152 dim, perceiver-based projector
Features xdrope RoPE, QK normalization, RMS norm, SiLU SwiGLU

Files

File Size Description
HunyuanOCR-Q4_K_M.gguf 339 MB Text model — Q4_K_M quantized
HunyuanOCR-Q8_0.gguf 551 MB Text model — Q8_0 quantized
HunyuanOCR-F16.gguf 1.0 GB Text model — F16 (full precision)
mmproj-HunyuanOCR-F16.gguf 909 MB Vision encoder (mmproj) — F16 required

Usage

# Via Hugging Face (easiest)
llama-server -hf AnandSingh/hunyuanocr-GGUF

# Or locally
llama-server \
  -m HunyuanOCR-Q4_K_M.gguf \
  --mmproj mmproj-HunyuanOCR-F16.gguf

API request:

{
  "messages": [
    {
      "role": "user",
      "content": [
        { "type": "text", "text": "OCR" },
        { "type": "image_url", "image_url": { "url": "data:image/jpeg;base64,..." } }
      ]
    }
  ]
}

Prompt Examples

Task Prompt
Text Spotting 检测并识别图片中的文字,将文本坐标格式化输出。
Document Parsing 提取文档图片中正文的所有信息用markdown格式表示,其中页眉、页脚部分忽略,表格用html格式表达,文档中公式用latex格式表示,按照阅读顺序组织进行解析。
Formula Recognition 识别图片中的公式,用LaTeX格式表示。
Table Extraction 把图中的表格解析为 HTML。
Translation 先提取文字,再将文字内容翻译为英文。

Requirements

  • llama.cpp build b8670 or later
  • macOS, Linux, or Windows

License

Licensed under the Tencent Hunyuan Community License Agreement.

Attribution

Original model by Tencent Hunyuan Vision Team. GGUF conversion is not affiliated with or endorsed by Tencent.

Downloads last month
549
GGUF
Model size
0.5B params
Architecture
hunyuan-dense
Hardware compatibility
Log In to add your hardware

4-bit

8-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for AnandSingh/hunyuanocr-GGUF

Quantized
(12)
this model