Skip to content

FASTVLM GUIDE · Transformers

FastVLM with Transformers

Understand the official Transformers integration, multimodal chat-template format and model-loading choices.

All FastVLM guides

Step by step

  1. 1

    Install a Transformers version that includes FastVLM support.

  2. 2

    Load a compatible model and AutoProcessor.

  3. 3

    Build messages with separate image and text content items.

  4. 4

    Use apply_chat_template before generate; a plain prompt string is not sufficient.

Example

Transformers
from transformers import AutoProcessor, FastVlmForConditionalGeneration

model_id = "KamilaMila/FastVLM-0.5B"
model = FastVlmForConditionalGeneration.from_pretrained(
    model_id, device_map="auto"
)
processor = AutoProcessor.from_pretrained(model_id)

Verify against the primary source

APIs, model files and dependency versions can change. Treat this page as an implementation map, then confirm the current command and license in the linked official documentation.

Open official source