All lessons in Vision-Language Models: Build, Evaluate, and Adapt
Run and Inspect a Small VLM
Execute pinned SmolVLM inference with correct image binding and negative controls.
70 minutes · Members lesson · preview
What you will learn
- Run a pinned VLM locally with the correct processor and chat template.
- Extract only generated answer tokens and retain the actual image-input identity.
- Compare original, blank, and swapped-image runs without confusing controls with production accuracy.
You already have a pixel rule and a retrieval encoder. Now add a model that generates answers from an image and a question. A successful invocation is only the first check: you must verify that the image is bound to the intended placeholder, the answer excludes prompt text, and the model's behavior changes when the visual evidence changes.
The reference implementation uses SmolVLM-256M-Instruct with a fixed checkpoint revision, Python environment, CPU float32, eager attention, deterministic greedy decoding, and a short output limit. These choices make a small experiment inspectable. They are not a recommendation for every production workload.