> This is the documentation for LibreYOLO 1.5.0. Current version: https://www.libreyolo.com/docs/models/lfm2-vl

# LFM2-VL
LFM2-VL is a compact, on-device vision-language model released by Liquid AI. LibreYOLO wraps it as an open-vocabulary object detector: any list of text labels becomes the class set, with no fixed head and no fine-tuning required.
Tasks: Detection. Install: pip install libreyolo.
Verified against LibreYOLO v1.5.0.

## Install

LFM2-VL needs the `vlm` extra, which pulls in `transformers` for the
chat-template backbone.

```bash
pip install "libreyolo[vlm]"
```

## Predict

`LibreLFM2VL` is a Python class, not a `.pt` checkpoint: it is not loaded
through the `LibreYOLO()` factory, and the `libreyolo` CLI does not resolve
it. The `LibreVLM(...)` factory (`from libreyolo import LibreVLM`) also
reaches this family by alias, e.g. `LibreVLM("lfm2-vl-450m")`; the class used
below is what it constructs. Weights come from Liquid AI's own Hugging Face
repository, not a LibreYOLO mirror; the first call downloads and caches them
locally, and logs a one-time license notice before it does.

**Python**

```python
from libreyolo import LibreLFM2VL, SAMPLE_IMAGE

model = LibreLFM2VL(size="450m")

# Open vocabulary: any words work, not a fixed class head. Sticky
# across every later predict()/track() call until set again.
model.set_classes(["person", "bicycle", "dog"])
result = model(SAMPLE_IMAGE, save=True)

for box in result.boxes:
    print(box.cls, box.conf, box.xyxy)
```

**Raw chat**

```python
from libreyolo import LibreLFM2VL, SAMPLE_IMAGE

model = LibreLFM2VL(size="450m")

# The escape hatch beneath the detection convenience: free-form
# questions, counting, or any prompt the boxes wrapper doesn't cover.
text = model.chat(SAMPLE_IMAGE, "Describe the scene in one sentence.")
print(text)
```

`result.boxes` carries the parsed detections like any other family.
Confidence is a placeholder: LFM2-VL emits no per-box score, so every
detection gets the same constant confidence, and `conf=` only drops rows
below that constant, it does not rank them. `iou` discards near-duplicate
boxes of the same class above the given overlap, a side effect of greedy
decoding repeating an object; it is not a class-wise NMS pass. Skip
`set_classes()` and the vocabulary defaults to the COCO-80 names. See
[prediction](/docs/v1.5.0/predict) for sources, streaming and result handling.

## Variants

Two sizes: 450m and 1.6b, both from Liquid AI's LFM2.5-VL release, built for
on-device deployment. LibreYOLO's benchmark harness has not measured this
family, so there are no published accuracy numbers to compare them by; pick a
size against your own compute budget.

LibreYOLO exposes this family for prediction only. `train()`, `val()` and
`export()` all raise `NotImplementedError`: fine-tune upstream and load the
result instead, dataset validation is skipped because a placeholder
confidence would make COCO mAP misleading, and export is out of scope for a
generative model with no state dict to trace.

## Licensing

Check the license on the Hugging Face repository of the specific weights you download. That repository is authoritative and licenses are not always uniform across a family. This is a description of the licenses involved, not legal advice.

- Original work: LFM2-VL, Liquid AI
- Upstream license: LFM Open License v1.0
- Upstream source: https://huggingface.co/LiquidAI/LFM2.5-VL-450M
- LibreYOLO code: MIT
- Weights: LFM Open License v1.0, distributed by their authors. LibreYOLO does not host or mirror them.
- Interpretation: The LFM Open License v1.0 permits Commercial Use, reproduction and modification, but only below a $10 million annual revenue threshold; a Legal Entity at or above that threshold is not licensed under this agreement at all for Commercial Use, and must contact Liquid AI directly. Qualified non-profit organizations are exempt from the threshold for non-commercial or research use. Redistribution must keep the license text, and any modified file must carry a notice saying so. LibreYOLO ships no LiquidAI source code, since the model loads through the Apache-2.0 transformers library, and does not host or redistribute the weights: LibreLFM2VL downloads the matching size directly from Liquid AI's own Hugging Face repository the first time it runs, and logs a one-time notice before that download.

The LFM Open License v1.0 permits commercial use, reproduction and
modification, but only below a $10 million annual revenue threshold; a legal
entity at or above that threshold is not licensed under this agreement at all
for commercial use, and must contact Liquid AI directly. Qualified
non-profit organizations are exempt from the threshold for non-commercial or
research use. LibreYOLO ships no LiquidAI source code, since the model loads
through the Apache-2.0 `transformers` library, and does not host or
redistribute the weights: `LibreLFM2VL` downloads the matching size directly
from Liquid AI's own Hugging Face repository the first time it runs, and
logs a one-time notice before that download.

## Citation

```bibtex
@article{liquidai2025lfm2,
 title={LFM2 Technical Report},
 author={Liquid AI},
 journal={arXiv preprint arXiv:2511.23404},
 year={2025}
}
```

Copied from https://huggingface.co/LiquidAI/LFM2.5-VL-450M#citation


## LFM2.5-VL architecture

- LFM2.5-VL 450M: [SVG](/diagrams/models/lfm2-vl/450m-detect.svg), [interactive diagram](/diagrams/models/lfm2-vl/450m-detect.html)
- LFM2.5-VL 1.6B: [SVG](/diagrams/models/lfm2-vl/1-6b-detect.svg), [interactive diagram](/diagrams/models/lfm2-vl/1-6b-detect.html)
- LFM2.5-VL 3B: [SVG](/diagrams/models/lfm2-vl/3b-detect.svg), [interactive diagram](/diagrams/models/lfm2-vl/3b-detect.html)
- LFM2.5-VL family: [SVG](/diagrams/models/lfm2-vl/family-16-layer.svg), [interactive diagram](/diagrams/models/lfm2-vl/family-16-layer.html)
