Downloads · 30 days
194
9% of all-time downloads
infil00p/granite-docling-258M-GGUF
granite-docling-258M-GGUF is a image-text-to-text model from infil00p. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for gguf. The card lists the license as apache-2.0.
This repository contains GGUF format quantized versions of ibm-granite/granite-docling-258M for use with llama.cpp.
Downloads · 30 days
194
9% of all-time downloads
All-time downloads
2.3K
Public
Repo size
1.2 GB
Likes
1
Public
Click a slice to open those files.
.gguf1.2 GB · 100%
From the Hugging Face model README
This repository contains GGUF format quantized versions of ibm-granite/granite-docling-258M for use with llama.cpp.
<div style="display: flex; align-items: center;"> <div> <p>Granite Docling is a multimodal Image-Text-to-Text model engineered for efficient document conversion. This GGUF version enables fast CPU and GPU inference using llama.cpp, making it ideal for edge deployment and resource-constrained environments.</p> </div> </div>This repository contains multiple quantization levels of the text model, plus the vision encoder/projector. You need one text model file + the mmproj file for inference.
| Filename | Quant | Size | Use Case |
|---|---|---|---|
| granite-docling-258M-Q4_K_M.gguf | Q4_K_M | 133 MB | Smallest, good quality-size balance, recommended for most users |
| granite-docling-258M-Q5_K_M.gguf | Q5_K_M | 139 MB | Better quality, still compact |
| granite-docling-258M-Q6_K.gguf | Q6_K | 164 MB | Higher quality |
| granite-docling-258M-Q8_0.gguf | Q8_0 | 170 MB | Very high quality |
| granite-docling-258M-f16.gguf | F16 | 317 MB | Highest quality, original precision |
| Filename | Size | Notes |
|---|---|---|
| mmproj-granite-docling-258M-f16.gguf | 182 MB | Vision encoder (SigLIP) - required for all quantizations |
Note: The mmproj file is kept at F16 precision to maintain vision quality.
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=ON # For CUDA support
cmake --build build --config Release -j
# Using Q4_K_M (recommended for most users)
./llama.cpp/build/bin/llama-mtmd-cli \
-m granite-docling-258M-Q4_K_M.gguf \
--mmproj mmproj-granite-docling-258M-f16.gguf \
--image document.png \
--chat-template "{%- for message in messages -%}{{- '<|start_of_role|>' + message['role'] + '<|end_of_role|>' -}}{%- if message['content'] is string -%}{{- message['content'] -}}{%- else -%}{%- for part in message['content'] -%}{%- if part['type'] == 'text' -%}{{- part['text'] -}}{%- elif part['type'] == 'image' -%}{{- '<image>' -}}{%- endif -%}{%- endfor -%}{%- endif -%}{{- '<|end_of_text|>\n' -}}{%- endfor -%}{%- if add_generation_prompt -%}{{- '<|start_of_role|>assistant' -}}{%- if controls -%}{{- ' ' + controls | tojson() -}}{%- endif -%}{{- '<|end_of_role|>' -}}{%- endif -%}" \
-p "Convert this page to docling." \
-n 512 \
--temp 0.1 \
-ngl 99
# Or use any other quantization (Q5_K_M, Q6_K, Q8_0, F16)
# Just replace the -m parameter with your chosen model file
Save the chat template to a file for easier reuse:
# Save chat template
cat > granite_docling_template.jinja << 'EOF'
{%- for message in messages -%}
{{- '<|start_of_role|>' + message['role'] + '<|end_of_role|>' -}}
{%- if message['content'] is string -%}
{{- message['content'] -}}
{%- else -%}
{%- for part in message['content'] -%}
{%- if part['type'] == 'text' -%}
{{- part['text'] -}}
{%- elif part['type'] == 'image' -%}
{{- '<image>' -}}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{{- '<|end_of_text|>
' -}}
{%- endfor -%}
{%- if add_generation_prompt -%}
{{- '<|start_of_role|>assistant' -}}
{%- if controls -%}{{- ' ' + controls | tojson() -}}{%- endif -%}
{{- '<|end_of_role|>' -}}
{%- endif -%}
EOF
# Then use it:
./llama.cpp/build/bin/llama-mtmd-cli \
-m granite-docling-258M-Q4_K_M.gguf \
--mmproj mmproj-granite-docling-258M-f16.gguf \
--image document.png \
--chat-template "$(cat granite_docling_template.jinja)" \
-p "Convert this page to docling." \
-n 512 \
-ngl 99
Recommended for most users: Q4_K_M - Best balance of size and quality
| Quantization | Total Size | Quality | Speed | RAM Usage |
|---|---|---|---|---|
| Q4_K_M | 315 MB | Good | Fastest | ~400 MB |
| Q5_K_M | 321 MB | Better | Fast | ~420 MB |
| Q6_K | 346 MB | High | Medium | ~450 MB |
| Q8_0 | 352 MB | Very High | Medium | ~480 MB |
| F16 | 499 MB | Highest | Slower | ~650 MB |
Total size = text model + mmproj (182 MB)
The model outputs DocTags format with precise layout information:
<doctag>
<page_header><loc_145><loc_28><loc_355><loc_35>ENERGY BUDGET OF WASP-121 b</page_header>
<text><loc_88><loc_42><loc_242><loc_89>while the kernel weights are structured as...</text>
...
</doctag>
| Description | Instruction |
|---|---|
| Full conversion | Convert this page to docling. |
| Chart | Convert chart to table. |
| Formula | Convert formula to LaTeX. |
| Code | Convert code to text. |
| Table | Convert table to OTSL. |
| OCR region | OCR the text in a specific location: <loc_155><loc_233><loc_206><loc_237> |
Tested on NVIDIA RTX 4070 Ti SUPER with CUDA:
The architecture consists of:
Vision encoder: siglip2-base-patch16-512
Vision-language connector: Pixel shuffle projector (Idefics3 style)
Large language model: Granite 165M
These GGUF files were converted from the original model using llama.cpp's conversion tools:
Vision/Projector conversion (F16):
python convert_hf_to_gguf.py granite-docling-258M \
--mmproj --outtype f16 \
--outfile mmproj-granite-docling-258M-f16.gguf
Text model conversion:
Quantization:
llama-quantize granite-docling-258M-f16.gguf granite-docling-258M-Q4_K_M.gguf Q4_K_M
llama-quantize granite-docling-258M-f16.gguf granite-docling-258M-Q5_K_M.gguf Q5_K_M
llama-quantize granite-docling-258M-f16.gguf granite-docling-258M-Q6_K.gguf Q6_K
llama-quantize granite-docling-258M-f16.gguf granite-docling-258M-Q8_0.gguf Q8_0
Granite-Docling excels at:
This model is designed for document understanding and should be used responsibly:
If you use this model, please cite:
@misc{granite-docling-2025,
title={Granite Docling: Efficient Document Conversion with Vision-Language Models},
author={IBM Research},
year={2025},
url={https://huggingface.co/ibm-granite/granite-docling-258M}
}