Three Docling ducks with hammers and chisels carving a granite statue of a duck that holds a DocLang scroll

Granite Docling V2 2B — W4A16 (AutoRound)

4-bit weight-quantized (Intel AutoRound) variants of ibm-granite/granite-docling-v2-2b with full BF16 Vision Tower, Connector, lm_head, and MTP Speculative Decoding heads preserved.

🤗 Base Model · 📄 Technical Report · 📊 Benchmark Explorer · 🦆 Docling · ⚙️ Intel AutoRound


Quantized Model Variants

Both checkpoints are produced from the same SignRound optimization pass (W4A16, group_size=32, symmetric) and include the original unquantized bfloat16 Multi-Token Prediction (MTP) draft layers (39 tensors in model_extra_tensors.safetensors) so --speculative-config '{"method": "mtp", "num_speculative_tokens": 3}' works out of the box in vLLM:

Repository Export Format Best For
Vishva007/granite-docling-v2-2b-AutoRound auto-round / auto-gptq vLLM (INC / GPTQ / Marlin kernels) & 🤗 Transformers
Vishva007/granite-docling-v2-2b-LLM-Compressor compressed-tensors (wint-a16) vLLM (compressed-tensors runtime)

Quantization Recipe & Precision Layout

To preserve OCR, layout bounding-box (512 × 512), table-structure, and speculative-decoding accuracy on this 2.68B VLM, only the 24 language decoder transformer blocks are quantized to 4-bit:

Module / Component Precision Details
model.text_model.layers.[0-23] (96 linear layers) W4A16 (INT4 weights / BF16 activations) group_size=32, sym=True, iters=1200, nsamples=512, seqlen=4096
model.vision_model (27-layer encoder + GraniteDoclingConnector) BF16 (Unquantized) Preserves spatial & visual feature fidelity (quant_nontext_module=False)
model.text_model.embed_tokens & lm_head BF16 (Unquantized) Tied embeddings (133,800 vocab) kept at full precision
mtp.layers.[0-2] (3 MTP draft layers, 208M params) BF16 (Unquantized) Original bfloat16 weights preserved for lossless MTP speculative decoding
  • Hardware Used: NVIDIA RTX PRO 6000 Blackwell (CUDA 13.2, PyTorch 2.14)
  • Runtime Footprint (vLLM): 2.67 GiB model + MTP weights (`3.04 GiB` total including CUDA graphs)

Quick Start

⚡ vLLM Server (Recommended — with MTP Speculative Decoding)

pip install -U vllm --pre "transformers>=5.23.0" \
  --extra-index-url https://wheels.vllm.ai/nightly

Serve either repository with 3-token MTP speculative decoding enabled:

vllm serve Vishva007/granite-docling-v2-2b-AutoRound \
  --model-impl transformers \
  --gpu-memory-utilization 0.4 \
  --max-model-len 16384 \
  --max-num-batched-tokens 8192 \
  --limit-mm-per-prompt '{"image": 1}' \
  --speculative-config '{"method": "mtp", "num_speculative_tokens": 3}' \
  --api-server-count 8

(To use the compressed-tensors variant instead, swap the model ID to Vishva007/granite-docling-v2-2b-LLM-Compressor.)

Python Client (openai + docling-core)

Important: Always pass extra_body={"skip_special_tokens": False}. DocLang structural tags and 512 × 512 bounding-box location tokens are special tokens; stripping them leaves bare text.

import base64
import mimetypes
from pathlib import Path

from docling_core.transforms.deserializer.doclang import DocLangDocDeserializer
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
model_id = client.models.list().data[0].id

image_path = Path("page.png")
mime_type = mimetypes.guess_type(image_path)[0] or "image/png"
b64_img = base64.b64encode(image_path.read_bytes()).decode("utf-8")

response = client.chat.completions.create(
    model=model_id,
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "image_url", "image_url": {"url": f"data:{mime_type};base64,{b64_img}"}},
                {"type": "text", "text": "<doclang>"},
            ],
        }
    ],
    temperature=0.0,
    max_tokens=16384,
    extra_body={"skip_special_tokens": False},
)

doclang_xml = response.choices[0].message.content
document = DocLangDocDeserializer().deserialize_str(doclang_xml)
print(document.export_to_markdown())

🤗 Transformers

pip install "transformers>=5.23.0" auto-round torch torchvision pillow docling-core
import torch
from PIL import Image
from transformers import AutoModelForImageTextToText, AutoProcessor

model_id = "Vishva007/granite-docling-v2-2b-AutoRound"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
    model_id, dtype=torch.bfloat16, device_map="cuda"
)

image = Image.open("page.png").convert("RGB")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": image},
            {"type": "text", "text": "<doclang>"},
        ],
    }
]
inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to(model.device, dtype=torch.bfloat16)

output = model.generate(**inputs, max_new_tokens=16384, do_sample=False)
doclang = processor.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False)
doclang = doclang.removesuffix(processor.tokenizer.eos_token)
print(doclang)

About Granite Docling V2 2B & Supported Prompts

Granite Docling V2 2B converts document page images into DocLang, an XML markup vocabulary recording element types, 512 × 512 bounding boxes, reading order, OTSL tables, LaTeX formulas, code, and picture captions/descriptions, exportable to Markdown, HTML, or JSON via docling-core.

Prompt Output
<doclang> Full page: every element with its type, bounding box, and content
<doclang> [<table>] Tables only
<doclang> [<table>, <formula>] Tables and formulas only
<doclang> [<ocr>, <layout>] Text with location tokens (<ocr> alone omits location tokens)
<doclang> [<detailed>] Full page plus generated descriptions for pictures

(Supported task tokens: <ocr>, <table>, <formula>, <picture>, <code>, <layout>, <detailed>.)

For full benchmark tables (96.5% pooled content 1 − NED across 16,205 pages) and format specifications, see the upstream model card at ibm-granite/granite-docling-v2-2b and the DocLang 0.9 specification.


🚀 Deploy on RunPod

One-click launch environments pre-configured with PyTorch, CUDA, and dependencies for fine-tuning or quantization.

🎁 Need GPU compute? Sign up via RunPod and get $5–$500 in free credits when you add your first $10.

PyTorch 2.15

Template CUDA Version Docker Image Template ID Deploy
PyTorch 2.15 (CUDA 13.2) 13.2 vishva123/cuda-13.2-pytorch-2.15-runpod 0rsw686010 Deploy to RunPod
PyTorch 2.15 (CUDA 13.4) 13.4 vishva123/cuda-13.4-pytorch-2.15-runpod 0s0rhdfaqy Deploy to RunPod

PyTorch 2.14

Template CUDA Version Docker Image Template ID Deploy
PyTorch 2.14 (CUDA 12.6) 12.6 vishva123/cuda-12.6-pytorch-2.14-runpod d7lxsa4w9m Deploy to RunPod
PyTorch 2.14 (CUDA 13.0) 13.0 vishva123/cuda-13.0-pytorch-2.14-runpod yk0y6j6rpg Deploy to RunPod
PyTorch 2.14 (CUDA 13.2) 13.2 vishva123/cuda-13.2-pytorch-2.14-runpod gsp4gwx0nw Deploy to RunPod

PyTorch 2.13

Template CUDA Version Docker Image Template ID Deploy
PyTorch 2.13 (CUDA 12.6) 12.6 vishva123/cuda-12.6-pytorch-2.13-runpod gmlupxnxfk Deploy to RunPod
PyTorch 2.13 (CUDA 13.0) 13.0 vishva123/cuda-13.0-pytorch-2.13-runpod y3j8xvk4f4 Deploy to RunPod
PyTorch 2.13 (CUDA 13.2) 13.2 vishva123/cuda-13.2-pytorch-2.13-runpod vigpissn5w Deploy to RunPod

PyTorch 2.12

Template CUDA Version Docker Image Template ID Deploy
PyTorch 2.12 (CUDA 12.6) 12.6 vishva123/cuda-12.6-pytorch-2.12-runpod ctmz86zmf0 Deploy to RunPod
PyTorch 2.12 (CUDA 13.0) 13.0 vishva123/cuda-13.0-pytorch-2.12-runpod qjko5yiwzi Deploy to RunPod
PyTorch 2.12 (CUDA 13.2) 13.2 vishva123/cuda-13.2-pytorch-2.12-runpod ifg6xmye0f Deploy to RunPod

Citation

@misc{nassar2026granitedoclingv2technical,
      title={Granite Docling V2: Technical Report},
      author={Ahmed Nassar and Matteo Omenetti and Christoph Auer and Cesar Berrospi Ramis and Michele Dolfi and Said Gürbüz and Viktor Kuropiatnyk and Nikolaos Livathinos and Maksym Lysak and Ingmar Meijer and Tim Strohmeyer and Panos Vagenas and Valery Weber and Ahmetcan Yavuz and Daniel DeAlcala and Peter El Hachem and Vittorio Pippi and Emmanuele Vivoli and Peter Staar},
      year={2026},
      eprint={2611.37727},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={[https://arxiv.org/abs/2611.37727](https://arxiv.org/abs/2611.37727)},
}

License

Released under the Apache 2.0 license, matching the upstream ibm-granite/granite-docling-v2-2b model.

Downloads last month
-
Safetensors
Model size
1.0B params
Tensor type
I32
·
BF16
·
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Vishva007/granite-docling-v2-2b-AutoRound

Collection including Vishva007/granite-docling-v2-2b-AutoRound

Paper for Vishva007/granite-docling-v2-2b-AutoRound