granite-docling-258M
IBM · ibm-granite/granite-docling-258M
Weights license: Apache 2.0 · code and components may use other terms
Quality
No comparable score
We track no public, comparable benchmark that covers this model yet. No score is inferred.
Reported by the publisher
- Layout · MAP ↑
- 0.27lmms-eval
- Layout · F1 ↑
- 0.86lmms-eval
- Layout · Precision ↑
- 0.92lmms-eval
- Layout · Recall ↑
- 0.88lmms-eval
- Table Recognition · TEDS ↑ (FinTabNet 150dpi; structure)
- 0.97
- Table Recognition · TEDS ↑ (FinTabNet 150dpi; w/content)
- 0.96
- Other Benchmarks · MMStar ↑
- 0.30
- Other Benchmarks · OCRBench ↑
- 500
Values as printed on the card, with the publisher's own settings (card section: Evaluations); column “granite-docling-258m”. Not comparable across publishers and not used in any ranking. Model card
Runs on
Fast memory holds it 119
The planning estimate fits the memory the model can use quickly: graphics card VRAM, or unified memory within the macOS GPU share.
Show all 119
Hardware profiles grouped by the Q4 planning estimate on each machine (dedicated GPUs reserve 2 GB; unified and system memory 25%, 2 to 8 GB): the fast memory holds it, it is within memory but outside the fast part (layers offloaded to PC RAM, or above the macOS GPU share), or the machine is one memory tier short. Not a measured fit or speed.
IBM released granite-docling-258M on 2025-09-17: a vision-language model that answers about images, with 300M parameters on the Hugging Face count and the Apache 2.0 license. Languages the publisher declares: en.
License: commercial use allowed. At Q4 the weights load about 0.2 GB before each machine's reserve; image resolution, video frames and context add memory, and the vision encoder needs support in the runtime you pick.
Measured speed
No published measurement for this checkpoint
Tokens per second are shown only when a source publishes them with hardware, build and setup. They are never estimated.
How to run
Runtime compatibility and tokens per second have not been measured for this entry. Published metadata and a memory estimate do not prove a successful local run.
Library in source: transformers
Documented ways to run it
Copied as printed in the linked source (read 2026-10-18); not run by this site.
# Convert to HTML and Markdown:
docling --to html --to md --pipeline vlm --vlm-model granite_docling "https://arxiv.org/pdf/2501.17887" # accepts files, urls or directories
# Convert to HTML including layout visualization:
docling --to html_split_page --show-layout --pipeline vlm --vlm-model granite_docling "https://arxiv.org/pdf/2501.17887"# Prerequisites:
# pip install torch
# pip install docling_core
# pip install transformers
import torch
from docling_core.types.doc import DoclingDocument
from docling_core.types.doc.document import DocTagsDocument
from transformers import AutoProcessor, AutoModelForVision2Seq
from transformers.image_utils import load_image
from pathlib import Path
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
# Load images
image = load_image("https://huggingface.co/ibm-granite/granite-docling-258M/resolve/main/assets/new_arxiv.png")
# Initialize processor and model
processor = AutoProcessor.from_pretrained("ibm-granite/granite-docling-258M")
model = AutoModelForVision2Seq.from_pretrained(
"ibm-granite/granite-docling-258M",
torch_dtype=torch.bfloat16,
_attn_implementation="flash_attention_2" if DEVICE == "cuda" else "sdpa",
).to(DEVICE)
# Create input messages
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": "Convert this page to docling."}
]
},
]
# Prepare inputs
prompt = processor.apply_chat_template(messages, add_generation_prompt=True)
inputs = processor(text=prompt, images=[image], return_tensors="pt")
inputs = inputs.to(DEVICE)
# Generate outputs
generated_ids = model.generate(**inputs, max_new_tokens=8192)
prompt_length = inputs.input_ids.shape[1]
trimmed_generated_ids = generated_ids[:, prompt_length:]
doctags = processor.batch_decode(
trimmed_generated_ids,
skip_special_tokens=False,
)[0].lstrip()
print(f"DocTags: \n{doctags}\n")
# Populate document
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
# create a docling document
doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")
print(f"Markdown:\n{doc.export_to_markdown()}\n")
## export as any format.
# Path("out/").mkdir(parents=True, exist_ok=True)
# HTML:
# output_path_html = Path("out/") / "example.html"
# doc.save_as_html(output_path_html)
# Markdown:
# output_path_md = Path("out/") / "example.md"
# doc.save_as_markdown(output_path_md)# Prerequisites:
# pip install vllm
# pip install docling_core
# place page images you want to convert into "img/" dir
import time
import os
from vllm import LLM, SamplingParams
from transformers import AutoProcessor
from PIL import Image
from docling_core.types.doc import DoclingDocument
from docling_core.types.doc.document import DocTagsDocument
from pathlib import Path
# Configuration
MODEL_PATH = "ibm-granite/granite-docling-258M"
IMAGE_DIR = "img/" # Place your page images here
OUTPUT_DIR = "out/"
PROMPT_TEXT = "Convert this page to docling."
messages = [
{
"role": "user",
"content": [
{"type": "image"},
{"type": "text", "text": PROMPT_TEXT},
],
},
]
# Ensure output directory exists
os.makedirs(OUTPUT_DIR, exist_ok=True)
# Initialize LLM
llm = LLM(model=MODEL_PATH, revision="untied", limit_mm_per_prompt={"image": 1})
processor = AutoProcessor.from_pretrained(MODEL_PATH)
sampling_params = SamplingParams(
temperature=0.0,
max_tokens=8192,
skip_special_tokens=False,
)
# Load and prepare all images and prompts up front
batched_inputs = []
image_names = []
for img_file in sorted(os.listdir(IMAGE_DIR)):
if img_file.lower().endswith((".png", ".jpg", ".jpeg")):
img_path = os.path.join(IMAGE_DIR, img_file)
with Image.open(img_path) as im:
image = im.convert("RGB")
prompt = processor.apply_chat_template(messages, add_generation_prompt=True)
batched_inputs.append({"prompt": prompt, "multi_modal_data": {"image": image}})
image_names.append(os.path.splitext(img_file)[0])
# Run batch inference
start_time = time.time()
outputs = llm.generate(batched_inputs, sampling_params=sampling_params)
# Postprocess all results
for img_fn, output, input_data in zip(image_names, outputs, batched_inputs):
doctags = output.outputs[0].text
output_path_dt = Path(OUTPUT_DIR) / f"{img_fn}.dt"
output_path_md = Path(OUTPUT_DIR) / f"{img_fn}.md"
with open(output_path_dt, "w", encoding="utf-8") as f:
f.write(doctags)
# Convert to DoclingDocument and save markdown
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [input_data["multi_modal_data"]["image"]])
doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")
doc.save_as_markdown(output_path_md)
print(f"Total time: {time.time() - start_time:.2f} sec")Technical details
What the source and the catalog store for this checkpoint. Missing fields are left out, never zero.
- Checkpoint / source
- ibm-granite/granite-docling-258M
- Task
- image-text-to-text
- Architecture
- Idefics3ForConditionalGeneration
- Library in source
- transformers
- Weight license
- Apache 2.0ibm-granite/granite-docling-258M model card (Hugging Face) · read 2026-10-18source
- Commercial use
- Allowed Apache License 2.0 text (SPDX) · read 2026-10-18license text
- Languages
- enModel card metadata · read 2026-10-25source
- Released
- granite-docling-258M model card (Hugging Face, IBM) · read 2026-10-18source
Every stored field
- Revision checked
- 982fe3b40f2fa73c365bdb1bcacf6c81b7184bfe
- Architecture
- Idefics3ForConditionalGeneration
- Library
- transformers
- Hub task tag
- image-text-to-text
- Formats
- transformers, safetensors
- Access
- Open download
- Publisher kind
- Official
- Repository created
- 2025-05-19creation is not the model's release
- Repository updated
- 2025-09-23a commit is not a release date
- Hub downloads (30 days) · likes
- 295,829 · 1,285this repository only · read 2026-10-25
- Catalog state
- Hub config or weights found; no inventory benchmark link
Sources
Identity and published specifications come from the checkpoint page. Benchmark scores belong to the named release and do not measure speed on your computer.
- Publisher model card
- License: ibm-granite/granite-docling-258M model card (Hugging Face)
- Release date: granite-docling-258M model card (Hugging Face, IBM)
Curated facts checked: 2026-10-18. The license and release date cite the publisher's sources; parameters, files and task come from the Hugging Face record, and memory is a labelled estimate from its parameter count. A value no source states stays empty; a repository commit is not a model release date.






























































