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 MohammadAminDHM/granite-docling-v2-500m-llama.cpp:F16
# Run inference directly in the terminal:
llama cli -hf MohammadAminDHM/granite-docling-v2-500m-llama.cpp:F16
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf MohammadAminDHM/granite-docling-v2-500m-llama.cpp:F16
# Run inference directly in the terminal:
llama cli -hf MohammadAminDHM/granite-docling-v2-500m-llama.cpp:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-app
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama serve -hf MohammadAminDHM/granite-docling-v2-500m-llama.cpp:F16
# Run inference directly in the terminal:
./build/bin/llama cli -hf MohammadAminDHM/granite-docling-v2-500m-llama.cpp:F16
Use Docker
docker model run hf.co/MohammadAminDHM/granite-docling-v2-500m-llama.cpp:F16
Quick Links

Granite Docling V2 500M โ€” GGUF for llama.cpp

GGUF conversions of ibm-granite/granite-docling-v2-500m for llama.cpp through mtmd.

Status: the architecture support lives in an open pull request, ggml-org/llama.cpp#33607, and is not part of an upstream release yet. Use a llama.cpp build from that branch (or a later commit once it is merged). The stock Ollama release does not load this architecture.

Files

File Size (bytes) SHA-256
granite-docling-v2-500m-text-f16.gguf 777612992 be305baf06021053860d475bbe7f4f0839fec70033a294446aba5e064ee56022
granite-docling-v2-500m-text-Q4_K_M.gguf 265754112 8c16fceb7ecbc41e797ba899e39b10eaffc3a20e3fddbb8dda30195b11313225
granite-docling-v2-500m-mmproj-f16.gguf 347105600 45359a72a2a41de459999ff324708696d8dd4d90c71e7fc87ffcfb6c50546bcc

The projector (mmproj) must be paired with one of the text models. It is kept at F16: low-bit quantization of the deepstack mergers is not recommended.

Usage

llama-mtmd-cli \
  -m granite-docling-v2-500m-text-Q4_K_M.gguf \
  --mmproj granite-docling-v2-500m-mmproj-f16.gguf \
  --image page.png \
  -p "<doclang>" \
  -n 4096

<doclang> produces DocTag output; <doctag> and <otsl> are also accepted by the model.

Add --fine-route (LLAMA_ARG_FINE_ROUTE=1 for the server) to use the fine connector path.

Connector routes

The 500M checkpoint has two connector paths:

Route Scale factor Tokens per 512 px tile Flag
coarse 4 64 default
fine 2 256 --fine-route

The checkpoint also ships a density router that predicts a route at inference time. It is a tiling heuristic, not part of the forward pass, and is not included in these GGUFs; pick the route explicitly with the flag above.

Conversion notes

  • Converted with the converter from PR #33607 (conversion/granite.py).
  • The mtp.* speculative-decoding heads and model.density_router.* tensors are not included. The reference model does not load mtp.* either (_keys_to_ignore_on_load_unexpected = [r"^mtp\."]).
  • Text model: 28 layers, 1024 hidden, vocabulary 133800, embedding_multiplier = 12 folded into the image embeddings.
  • Projector: 12-layer SigLIP-style tower with three deepstack taps ([3, 7, 10]), coarse and fine mergers.

Verification

  • Final embeddings fed to the decoder match the HF reference for both routes: coarse 64 x 4096 and fine 256 x 4096; base stream and all three deepstack streams have cosine similarity ~1.000000.
  • Both routes and both text quantizations were run on real document pages, including a Persian (RTL) page, producing coherent DocTag output.

License

Apache 2.0, following the base model.

Downloads last month
1
GGUF
Model size
0.4B params
Architecture
granite
Hardware compatibility
Log In to add your hardware

4-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for MohammadAminDHM/granite-docling-v2-500m-llama.cpp