Skip to content
Local AI Wizard
Your machine
Theme

SmolDocling-256M-preview

Docling · docling-project/SmolDocling-256M-preview

Weights license: Publisher terms: CDLA-Permissive-2.0 · code and components may use other terms

Hub downloads · 30 days29.3KPopularity, not quality · read 2026-10-25
Memory needed~1 GBQ4 weights + working room, before the machine's reserve
Parameters0.3 BHub safetensors total
Repository updated2025-09-17A commit is not a release date

Quality

No comparable score

We track no public, comparable benchmark that covers this model yet. No score is inferred.

Reported by the publisher

The publisher's card states no benchmark result for this checkpoint (read 2026-10-25). not published on the card · read 2026-10-25

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.

Consider it for

Docling released SmolDocling-256M-preview on 2025-03-14: a vision-language model that answers about images, with 256M parameters on the Hugging Face count and the Publisher terms: CDLA-Permissive-2.0 license. Languages the publisher declares: en.

Check first

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.

Transformers · model card · ⌨️ Get started (code examples)
# 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://upload.wikimedia.org/wikipedia/commons/7/76/GazettedeFrance.jpg")

# Initialize processor and model
processor = AutoProcessor.from_pretrained("ds4sd/SmolDocling-256M-preview")
model = AutoModelForVision2Seq.from_pretrained(
    "ds4sd/SmolDocling-256M-preview",
    torch_dtype=torch.bfloat16,
    _attn_implementation="flash_attention_2" if DEVICE == "cuda" else "eager",
).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()

# Populate document
doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
print(doctags)
# create a docling document
doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")

# export as any format
# HTML
# Path("Out/").mkdir(parents=True, exist_ok=True)
# output_path_html = Path("Out/") / "example.html"
# doc.save_as_html(output_path_html)
# MD
print(doc.export_to_markdown())
vLLM · model card · ⌨️ Get started (code examples)
# 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 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 = "ds4sd/SmolDocling-256M-preview"
IMAGE_DIR = "img/"  # Place your page images here
OUTPUT_DIR = "out/"
PROMPT_TEXT = "Convert page to Docling."

# Ensure output directory exists
os.makedirs(OUTPUT_DIR, exist_ok=True)

# Initialize LLM
llm = LLM(model=MODEL_PATH, limit_mm_per_prompt={"image": 1})

sampling_params = SamplingParams(
    temperature=0.0,
    max_tokens=8192)

chat_template = f"<|im_start|>User:<image>{PROMPT_TEXT}<end_of_utterance>
Assistant:"

image_files = sorted([f for f in os.listdir(IMAGE_DIR) if f.lower().endswith((".png", ".jpg", ".jpeg"))])

start_time = time.time()
total_tokens = 0

for idx, img_file in enumerate(image_files, 1):
    img_path = os.path.join(IMAGE_DIR, img_file)
    image = Image.open(img_path).convert("RGB")

    llm_input = {"prompt": chat_template, "multi_modal_data": {"image": image}}
    output = llm.generate([llm_input], sampling_params=sampling_params)[0]
    
    doctags = output.outputs[0].text
    img_fn = os.path.splitext(img_file)[0]
    output_filename = img_fn + ".dt"
    output_path = os.path.join(OUTPUT_DIR, output_filename)

    with open(output_path, "w", encoding="utf-8") as f:
        f.write(doctags)

    # To convert to Docling Document, MD, HTML, etc.:
    doctags_doc = DocTagsDocument.from_doctags_and_image_pairs([doctags], [image])
    doc = DoclingDocument.load_from_doctags(doctags_doc, document_name="Document")
    # export as any format
    # HTML
    # output_path_html = Path(OUTPUT_DIR) / f"{img_fn}.html"
    # doc.save_as_html(output_path_html)
    # MD
    output_path_md = Path(OUTPUT_DIR) / f"{img_fn}.md"
    doc.save_as_markdown(output_path_md)
print(f"Total time: {time.time() - start_time:.2f} sec")

Choose my computer

Technical details

What the source and the catalog store for this checkpoint. Missing fields are left out, never zero.

Task
image-text-to-text
Architecture
Idefics3ForConditionalGeneration
Library in source
transformers
Weight license
Publisher terms: CDLA-Permissive-2.0docling-project/SmolDocling-256M-preview model card (Hugging Face) · read 2026-10-18source
Commercial use
Allowed CDLA-Permissive-2.0 text (SPDX) · read 2026-10-18license text
Languages
enModel card metadata · read 2026-10-25source
Released
SmolDocling: An ultra-compact vision-language model for end-to-end multi-modal document conversion (IBM Research & Hugging Face, arXiv 2503.11576 v1) · read 2026-10-18source
Every stored field13 fields
Revision checked
ce51f56c4ebe36e0b1c3a55f67b261ba22a50bf8
Architecture
Idefics3ForConditionalGeneration
Library
transformers
Hub task tag
image-text-to-text
Declared base models
HuggingFaceTB/SmolVLM-256M-Instruct
Formats
transformers, onnx, safetensors
Access
Open download
Publisher kind
Official
Hub parameter count
256,484,928safetensors.total
Repository created
2025-02-12creation is not the model's release
Repository updated
2025-09-17a commit is not a release date
Hub downloads (30 days) · likes
29,309 · 1,636this 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.

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.