liquidAI-LFM2-VLM / README.md
karthik87s's picture
Update README.md
f47ad50 verified
|
Raw
History Blame Contribute Delete
3 kB
metadata
license: other
license_name: lfm-open-license-v1.0
license_link: https://huggingface.co/LiquidAI/LFM2-VL-450M
base_model:
  - LiquidAI/LFM2-VL-450M
tags:
  - torq
  - synaptics
  - sl2619
  - npu
  - edge
  - lfm2
  - lfm2-vl
pipeline_tag: image-text-to-text

LFM2-VL-450M — Torq build (Synaptics SL2619 NPU)

Pre-compiled Torq VMFB build of LiquidAI's LFM2-VL-450M vision-language model, ready to run on the Synaptics SL2619 edge NPU. The SigLIP vision encoder and the LFM2 hybrid conv/attention text decoder both execute on the NPU in bf16; the token embeddings run on the host CPU.

Image + prompt → caption / visual question answering. The image is encoded once and its KV cache is reused, so follow-up questions about the same image stay fast.

Contents

File Size Role
vision_encoder_256.vmfb 203 MB SigLIP vision encoder, 256-res → 64 image tokens
decoder_image_2part_A.vmfb 353 MB one-shot image-prefill decoder, layers 0–7
decoder_image_2part_B.vmfb 311 MB one-shot image-prefill decoder, layers 8–15
decoder_nolm.vmfb 577 MB LFM2 single-token decode body (hidden-state output)
lm_head.vmfb 134 MB tied LM head (hidden → 65 536 logits)
token_embeddings.npy 134 MB CPU embedding LUT / tied-LM-head weights (bf16)
config.json, tokenizer.json model config + tokenizer
cats-and-dogs-256.jpg sample 256-res image for the demo
onnx/ ~2 GB reference ONNX exports (vision encoder, merged decoder, embeddings) for non-Torq runtimes

Quick start

Runs through the liquidAI-VLM demo in synaptics-torq/torq-examples:

# downloads this repo to models/Synaptics/liquidAI-LFM2-VLM/
python setup_demos.py liquidAI-VLM

cd liquidAI-VLM
MODELS=../models/Synaptics/liquidAI-LFM2-VLM
python src/infer.py \
  -m              $MODELS/decoder_nolm.vmfb \
  --lm-head       $MODELS/lm_head.vmfb \
  --vision        $MODELS/vision_encoder_256.vmfb \
  --image-decoder $MODELS/decoder_image_2part_ \
  --image         $MODELS/cats-and-dogs-256.jpg

Then ask questions at the Q: prompt (e.g. "What is the breed of the dog?").

Model details

  • Base model: LiquidAI LFM2-VL-450M (SigLIP vision tower + LFM2 language model).
  • Text decoder: LFM2 — hidden size 1024, 16 layers, 16 attention heads, vocabulary 65 536, hybrid short-convolution + grouped-query attention.
  • Image tokens: 64 per image (256-resolution input).
  • Precision: bf16 on the NPU.
  • Target: Synaptics SL2619, compiled with the Torq compiler.
  • On-device performance (SL2619, indicative): vision encode ~2.4 s, image→KV prefill ~3.7 s, decode ~3.6–4.2 tok/s.

License

Derived from LiquidAI's LFM2-VL-450M and distributed under LiquidAI's LFM Open License v1.0 — see the base model for the full terms.