Tiny & Edge Vision-Language Models
Collection
4 items • Updated
How to use webbrain-one/lfm3-vld-2b with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("image-text-to-text", model="webbrain-one/lfm3-vld-2b", trust_remote_code=True)
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
pipe(text=messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoModelForImageTextToText
model = AutoModelForImageTextToText.from_pretrained("webbrain-one/lfm3-vld-2b", trust_remote_code=True, device_map="auto")How to use webbrain-one/lfm3-vld-2b with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "webbrain-one/lfm3-vld-2b"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "webbrain-one/lfm3-vld-2b",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'docker model run hf.co/webbrain-one/lfm3-vld-2b
How to use webbrain-one/lfm3-vld-2b with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "webbrain-one/lfm3-vld-2b" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "webbrain-one/lfm3-vld-2b",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "webbrain-one/lfm3-vld-2b" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "webbrain-one/lfm3-vld-2b",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
}'How to use webbrain-one/lfm3-vld-2b with Docker Model Runner:
docker model run hf.co/webbrain-one/lfm3-vld-2b
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModelForImageTextToText
model = AutoModelForImageTextToText.from_pretrained("webbrain-one/lfm3-vld-2b", trust_remote_code=True, device_map="auto")LiquidAI/LFM3-VL-2B adapted with WebBrain's multipass VL-D (verify Yes/No per option + readout option code) decision protocol, distilled from LiquidAI/d1-2B on WebBrain multimodal browser workflow screenshots — without full VL/Compass fine-tuning (vision tower frozen, language backbone adapted via LoRA and merged to BF16).
webbrain-one/lfm3-vld-2b-onnx: WebGPU ONNX bundle (decoder_q8f16.onnx, decoder_q4f16.onnx with decision_hidden exposed, vision_encoder_fp16.onnx, and trained linear decision probes).webbrain-one/lfm3-vld-2b-gguf: GGUF exports (BF16, Q8_0, Q4_K_M, and mmproj-F16) for llama.cpp (/v1/chat/completions + /v1/systemone).webbrain-one/lfm3-vld-2b-lora: LoRA adapter (r=32, alpha=64) and projector weights.final_test, 126 Categorical Questions)
| Model / Protocol | Correct | Completions Found | False Completions | Unknown Recognized | Score MAE |
|---|---|---|---|---|---|
LFM3-VLD-2B (probe / probe-cs) |
126/126 (100.0%) | 24/24 | 0/48 | 24/24 | 9.56e-8 |
LFM3-VLD-2B (verify zero-shot) |
126/126 (100.0%) | 24/24 | 0/48 | 24/24 | 4.11e-5 |
LFM3-VLD-2B (readout) |
125/126 (99.2%) | 24/24 | 0/48 | 24/24 | 0.0189 |
Base LiquidAI/LFM3-VL-2B (verify zero-shot) |
106/126 (84.1%) | 24/24 | 0/48 | 4/24 | 0.0004 |
Base LiquidAI/LFM3-VL-2B (readout) |
102/126 (81.0%) | 24/24 | 1/48 | 0/24 | 0.1106 |
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="webbrain-one/lfm3-vld-2b", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)