LFM3-VL-2B is a vision-language model for on-device visual understanding. It takes text, images, and video as input, and combines the LFM3 language model with a new in-house vision encoder.
New in LFM3-VL-2B:
Video understanding: the first LFM vision model that takes video as input. Ask questions about a recorded lecture, a walkthrough filmed on your phone, or a clip from a camera feed.
Thinking: the model reasons step by step before it answers. This helps most with harder visual questions, such as math, charts, and multi-step problems.
Spatial and embodied reasoning: the model finds objects and reasons about how they are placed relative to each other, a strong foundation for robotics applications.
LFM3-VL-2B is designed for on-device visual tasks: questions about video, reading documents, charts, and app screens, finding objects in an image, and spatial reasoning for robots. It is not recommended for coding, multi-turn conversations, or complex reasoning.
Use these ONNX weights with Transformers.jsv4.3.2 or later. The example below uses AutoModelForImageTextToText and AutoProcessor with WebGPU.
npm install @huggingface/transformers@^4.3.2
import { AutoModelForImageTextToText, AutoProcessor, load_image } from "@huggingface/transformers";
const modelId = "onnx-community/LFM3-VL-2B-ONNX";
const model = await AutoModelForImageTextToText.from_pretrained(modelId, {
device: "webgpu",
dtype: {
vision_encoder: "fp16",
embed_tokens: "fp16",
decoder_model_merged: "q4f16",
},
});
const processor = await AutoProcessor.from_pretrained(modelId);
const image = await load_image(
"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png",
);
const messages = [
{
role: "user",
content: [
{ type: "image" },
{ type: "text", text: "What is in this image?" },
],
},
];
// Format the chat and preprocess the image.
const chatPrompt = processor.apply_chat_template(messages, {
add_generation_prompt: true,
enable_thinking: false,
});
const inputs = await processor(image, chatPrompt, { add_special_tokens: false });
const outputs = await model.generate({
...inputs,
do_sample: true,
temperature: 0.1,
top_k: 50,
repetition_penalty: 1.1,
max_new_tokens: 128,
});
// Decode only the newly generated tokens.
const inputLength = inputs.input_ids.dims.at(-1);
const generated = outputs.slice(null, [inputLength, null]);
console.log(processor.batch_decode(generated, { skip_special_tokens: true })[0]);
// Release the model when you are finished using it.
await model.dispose();
The processor loads the image preprocessing settings and chat template automatically. This example disables thinking with enable_thinking: false. Set it to true in processor.apply_chat_template() and increase max_new_tokens when you want to allow a longer reasoning trace.
Across 62 vision benchmarks, LFM3-VL-2B scores at least 8 points ahead of all models of similar size. It matches Gemma 4 12B, is within 2 points of GPT-5.6 Luna, and scores higher than Gemini 3.5 Flash Lite.
# custom terms: read the license before you download$ fw get onnx-community/LFM3-VL-2B-ONNX
# manifest sha256 5294c7ad086e… · 18.6 GB · 44 files$ fw verify ./LFM3-VL-2B-ONNX onnx-community/LFM3-VL-2B-ONNX
Terms that come with these files. LFM 1.0: commercial use only for organisations under US$10M annual revenue. Keep a copy of the license with the files.
Custom license (custom).Read the license text first. Open this panel to show the commands once you accept its terms.
fw.pyChecks the signature and every sha256, tries each source in order, resumes.