Skip to main content
LFM2.5-VL models’ vision capabilities enable the model to analyze and understand images. These models support common vision-language tasks such as describing images, answering questions about visual content, comparing multiple images, reading text, and localizing objects. LFM2.5-VL also supports tool calling, including examples where an image helps determine the tool arguments. The examples below show how to send images to LFM2.5-VL models. Install PyTorch, Transformers, and the image-processing packages used by the examples. torchvision and Pillow are required by the LFM2.5-VL image processor, and opencv-python is used to draw grounding and layout boxes.
Load the model with AutoProcessor and AutoModelForImageTextToText, matching the standard LFM2.5-VL documentation examples. Start with LiquidAI/LFM2.5-VL-450M or LiquidAI/LFM2.5-VL-1.6B for fast iteration. Use LFM2.5-VL-3B for the strongest grounding, layout parsing, and tool-calling examples.

Single-image prompt

Provide one image and a text question in the same user message. This pattern is useful for captioning, visual question answering, and scene understanding.
Output Cell 7 output

Multi-image prompt

Model support: This capability is best supported by LFM2.5-VL-3B.
You can include multiple images in a single prompt. Label each image in the prompt, such as Media-1 and Media-2, to make cross-image references clearer.
Output
Media-1 inputMedia-2 input

OCR

Model support: This capability is best supported by LFM2.5-VL-3B.
LFM2.5-VL can read text in document images and, with LFM2.5-VL-3B, return structured layout annotations, which can be used to visualize the parsed layout regions.
Image quality: OCR and layout parsing work best when text is legible and the image is not blurry, rotated, or heavily compressed. For dense documents, crop to the relevant page or region when possible.
Output Cell 11 output

Document layout annotations

For document understanding tasks, LFM2.5-VL-3B can return OCR with layout annotations. Each region contains a label, normalized bounding box, and content:
Coordinates are normalized integers in [0, 1000], matching the grounding format. If you want to visualize these boxes, scale the coordinates back to pixels with the same x / 1000 * width and y / 1000 * height pattern used in the grounding example.
Output
Cell 13 output

Object detection and grounding

Model support: This capability is best supported by LFM2.5-VL-3B.
Grounding asks the model to localize visible objects and return normalized coordinates. This example uses a COCO sample image with cats and remote controls, then draws the returned boxes with OpenCV.
Coordinate format: The grounding examples use normalized [0, 1000] coordinates. Convert them back to pixels with x / 1000 * width and y / 1000 * height. Boxes are approximate, so visually inspect the result before using coordinates in downstream workflows.
Output
Cell 15 output

Tool calling

Model support: This capability is best supported by LFM2.5-VL-3B.
In this example, the model sees an image and can route the request to the most relevant tool. The tool schemas are generic enough to adapt to real catalog, search, or workflow APIs.
Output Cell 17 output

FAQ

Which LFM2.5-VL model should I use? Use LFM2.5-VL-450M or LFM2.5-VL-1.6B for fast image captioning and visual question answering. Use LFM2.5-VL-3B for the strongest support for multi-image prompts, grounding, document layout parsing, and tool calling. What image formats are supported? LFM2.5-VL works with common image formats supported by the image loading path you use, such as JPEG and PNG. In the examples above, images are loaded from Hugging Face URLs with transformers.image_utils.load_image. Can LFM2.5-VL return bounding boxes? Yes. For grounding tasks, prompt the model to return bounding boxes in a structured format such as JSON. Coordinates in these examples are normalized to [0, 1000], so you can scale them back to the displayed image size. Note that bounding boxes are approximate and can vary with prompt wording, image resolution, and generation settings. For workflows that require precise localization, inspect the returned boxes and validate them against the original image. Can LFM2.5-VL parse documents? Yes. LFM2.5-VL-3B can read visible text and return document layout annotations, including region labels, bounding boxes, and extracted content. This is useful for tables, forms, screenshots, reports, and other structured document images. Can LFM2.5-VL call tools based on an image? Yes. You can provide tool schemas through the chat template and ask the model to choose the relevant tool based on the visual content. For example, an image can help determine the right tool arguments. Can LFM2.5-VL generate or edit images? No. LFM2.5-VL models are image understanding models. They can analyze images, answer questions, read text, localize objects, parse layouts, and route tool calls, but they do not generate or edit images.