LiteRT is Google's on-device runtime, the new name for TensorFlow Lite (Android: com.google.ai.edge.litert:litert), and litert-torch, the renamed ai-edge-torch, is its PyTorch converter: a PyTorch model converted unmodified with litert_torch.convert matched the original to 4e-7 on a Galaxy S26 (measured, LiteRT 2.2.0, Android 16, 2026-09-05).
Measured on device (edge-compat), on LFM2.5-VL-3B_int8.litertlm with a text-only prompt: Galaxy S26 · LiteRT-LM 0.16.0 · GPU · decode 20.15–20.23 tok/s · prefill 670–744 tok/s · TTFT 0.33–0.36 s; Galaxy S26 · LiteRT-LM 0.16.0 · CPU · decode 18.77–19.87 tok/s · prefill 228–277 tok/s · TTFT 0.79–0.95 s. Record: https://github.com/john-rocky/edge-compat/blob/main/cards/lfm2.5-vl-3b-int8/CARD.md
LFM2.5-VL-3B — LiteRT-LM
LiquidAI/LFM2.5-VL-3B converted to the LiteRT-LM (.litertlm) format for on-device inference with Google's LiteRT-LM runtime. For the GPU on LiteRT-LM 0.20.0, use LFM2.5-VL-3B_int4_fixB_v0200.litertlm, one of the three _v0200 files added for it. On a Mac M4 Max with litert-lm 0.20.0 from PyPI, this command, run from a directory holding only photo.png, printed an answer that begins The image features the word "CAT" in large, bold, black capital letters centered on a white background.
uvx --from litert-lm==0.20.0 litert-lm run --from-huggingface-repo=litert-community/LFM2.5-VL-3B LFM2.5-VL-3B_int4_fixB_v0200.litertlm --backend gpu --cache no --prompt "Describe this image." --attachment photo.png
On a Mac, --backend gpu of litert-lm 0.20.0 from PyPI runs on WebGPU. litert-lm 0.20.0 from PyPI needs Python 3.10 or newer. Asked one question on the GPU of litert-lm 0.19.2 (PyPI, Mac M4 Max), the three _v0200 files printed garbled text that is not an answer, with no error and exit status 0. On the GPU, use the _v0200 files with LiteRT-LM 0.20.0. The _v0200 files were not run on a phone.
If run stops right after the download with no error message from the CLI (a bus error; exit status 138 on a Mac) or with an error log that contains too large for file size, the downloaded file may be incomplete. The litert-lm CLI (tested on 0.19.2 and litert-lm-nightly 0.20.0.dev20261112; 0.14.0 to 0.19.1 and 0.20.0 have the same download code) can keep an incomplete download in ~/.litert-lm/cache/huggingface/litert-community/LFM2.5-VL-3B/ and uses it again on later runs without checking its size. Delete that file and run the command again.
Text + image work end-to-end on litert-lm 0.20.0 from PyPI (checked on a Mac M4 Max) — each file carries the vision encoder, the vision adapter and the LFM2 image-placeholder metadata, so litert-lm run … --attachment photo.png just works.
Known issue: positional answers can be wrong in files with the stock vision graphs (measured with litert-lm 0.16.0 and 0.17.0)
In files with the stock vision graphs, on those versions, only the top quarter of the image reaches the model. Captioning, colour questions and OCR of a large dominant subject still work. Positional answers — locate, count, enumerate, "which one is at the bottom" — can come back wrong, with no error and well-formed output.
The cause is a shrink-factor assumption in the runtime's vision path, reported upstream as LiteRT-LM#3246. It affects every LFM2.5-VL file with the stock vision graphs, not just this one: the family performs its 2×2 pixel-unshuffle in the vision adapter rather than the encoder, and the runtime assumes the opposite.
Quick check — a 512×512 image with 16 numbered horizontal bands, asked to list every number from top to bottom:
expected: 1 … 16 actual: 1 1 2 2 3 3 4 4 1
A repaired int4 build is in this repo: LFM2.5-VL-3B_int4_fixB.litertlm — the stock file with its two vision graphs re-exported so the 2×2 pixel-unshuffle happens inside the encoder (text weights, tokenizer and metadata unchanged; scripts: reexport_vision_unshuffle.py + repack_vision.py). On the ruler above, an earlier file of this name returned all 16 bands on litert-lm 0.16.1 and 0.17.0 (each number repeated, since the fixture prints it three times per band; 2026-09-16). On the 10-target phone screenshot from LiteRT-LM#3246, an earlier file of this name scored 10/10 and the stock file of that time 2/10 (litert-lm 0.16.0, 2026-08-14). The stock files stay published in case the runtime fix lands and makes them the right choice again.
LFM2.5-VL-3B pairs Liquid AI's hybrid text backbone (22 gated short-convolution blocks + 8 grouped-query attention layers, 128k vocab) with a SigLIP2 vision tower (27 layers, hidden 1152) and a pixel-unshuffle projector. On this runtime an image is processed at 512×512 into 256 soft tokens (single image per prompt; the runtime resizes for you).
| File | Recipe | Size |
|---|---|---|
LFM2.5-VL-3B_int8.litertlm |
int8 dynamic (text linears + convs + embedding, vision tower) | 3.55 GB |
LFM2.5-VL-3B_int4.litertlm |
text int4 blockwise-32 OCTAV linears, int8 embedding + lm_head; vision tower int8 | 2.35 GB |
LFM2.5-VL-3B_int4_fixB.litertlm |
int4 as above, vision graphs re-exported with the pooling inside the encoder (full image visible on litert-lm 0.16.1 and 0.17.0, measured on an earlier file of this name) | 2.35 GB |
LFM2.5-VL-3B_int4_fixB_v0200.litertlm |
For LiteRT-LM 0.20.0: int4 text as above, on an export with GPU composites (ShortConv state channels-last), with the vision graphs of _int4_fixB |
2.37 GB |
LFM2.5-VL-3B_int4_v0200.litertlm |
For LiteRT-LM 0.20.0: int4 text as above, on the same export, with the vision graphs of _int4 |
2.37 GB |
LFM2.5-VL-3B_int8_v0200.litertlm |
For LiteRT-LM 0.20.0: text linears and embedding int8, convs float, on a separate export at the same litert-torch commit; the vision tower of _int8 |
3.57 GB |
| Context (KV cache) | 4096 max |
| Image input | 1 per prompt, resized to 512×512 → 256 tokens; PNG/JPEG via --attachment . On 0.16.0, in files with the stock vision graphs, those tokens cover only the top quarter — see the known issue |
| Backend | CPU and GPU (macOS verified by generation; Android OpenCL verified by generation on a Pixel 8a and a Galaxy S26 — device numbers, and the files they were measured on, below; iOS was not measured with any file of this repo). LFM2.5-VL-3B_int4.litertlm and LFM2.5-VL-3B_int8.litertlm ran on litert-lm 0.20.0 from PyPI on a Mac M4 Max (GPU, 2026-11-25). For the Android GPU path of LFM2.5-VL-3B_int4.litertlm and LFM2.5-VL-3B_int4_fixB.litertlm, see Known runtime issues. The _v0200 files run on the GPU with LiteRT-LM 0.20.0 (macOS verified by generation; see the top of this page). |
| Template | in the file — ChatML-style (non-thinking model) |
| Base model | LiquidAI/LFM2.5-VL-3B (LFM Open License v1.0) |
Quality
Checks on the 0.16.0 pip CLI (greedy, a new Engine for each question, --cache no), the int4-b32 rows on an earlier int4 file of this repo. Vision: five deterministic synthetic fixtures (dominant color, large-text OCR, shape, counting three squares, largest word). Text: the 8-question check used across our LiteRT conversions.
| Configuration | text (8 questions) | image (5 questions) |
|---|---|---|
| LiteRT int8, CPU | 7/8 | 5/5 |
| LiteRT int8, GPU (macOS) | 7/8 | 5/5 |
| LiteRT int4-b32, CPU | 7/8 | 5/5 |
| LiteRT int4-b32, GPU (macOS) | 7/8 | 5/5 |
All five image answers from both LiteRT variants are verbatim identical to the bf16 reference on both backends ("Red." / "Hello." / "Circle." / "Three." / "CAT."). The single text miss is the rhyme completion, answered "Purple." The 0.16.0 checks in the table above gave no degenerate output.
What the image check does not show. Four of the five vision fixtures (OCR, shape, counting, largest word) place their subject in the middle of the frame, below the cut described in the known issue above; the fifth is a solid red frame. The five fixtures therefore cannot separate "the model resolved the image" from "the model answered from priors" — a file that sees only the top quarter still scores 5/5 on them. The band ruler above is the check that does separate the two. Concretely: circle.png puts its circle at y 128–384 of 512, entirely below the cut, and the 3B still answers "Circle." The 450M answers "Square." on the same fixture and flips to "Circle." once the file is repaired, with nothing else changed.
With litert-lm 0.20.0 from PyPI on a Mac M4 Max (2026-11-24; these 8 questions with "Answer briefly." appended, greedy with --max-num-tokens 2048 and --thinking false, one process per question, one run), each of the three _v0200 files scored 7/8 on the GPU and on the CPU, missing the question that asks it to complete "Roses are red, violets are ___", and 5/5 on five image questions (dominant color, large-text OCR, shape, counting three squares, largest word; vision encoder on the CPU, text decoder on the GPU or the CPU; the check passes at 4 of 5 with no degenerate reply); no run degenerated. With the same checks on the GPU (2026-11-25), the three files without _v0200 scored 7/8 and 5/5 each; they were not run on the CPU of LiteRT-LM 0.20.0.
Usage
pip install litert-lm
litert-lm run ./LFM2.5-VL-3B_int4.litertlm --prompt "Describe this image." --attachment photo.png
Text-only prompts work the same way without --attachment. --vision-backend cpu|gpu selects the vision encoder backend independently of the text backend. With LiteRT-LM 0.19.0, --vision-backend gpu fails when the conversation is created: the GPU delegate does not take the vision encoder's RESIZE_BILINEAR op, whose input is a constant, and the runtime requires the vision encoder to be delegated in full. This was seen on macOS with LFM2.5-VL-3B_int4.litertlm and LFM2.5-VL-3B_int4_fixB.litertlm (2026-11-09) and on a Galaxy S26 with LFM2.5-VL-3B_int8.litertlm and the vision encoder set to the GPU (2026-10-30). With the vision encoder on the CPU the same files answered an image question. Later LiteRT-LM versions were not tried.
One Engine per conversation. On litert-lm 0.18.0 the runtime starts a new Conversation on an Engine that already ran another conversation from the earlier conversation's short-convolution state: it reuses the prompt tokens the two conversations share and does not reset the state (my report). In a test that asks three questions (What is the capital of France? / What is 17 times 23? / What color is the sky on a clear day?) first in a pirate-persona conversation and then in a conversation told to answer in one word, on the same Engine against a fresh Engine in a new process (answers capped at 200 tokens; CPU backend; litert-lm 0.18.0 on a Mac; 2026-10-12), the _int8 file and earlier _int4 and _int4_fixB files each gave the same three one-word answers on both Engines, in its one run. Those three short questions say nothing about longer conversations or image turns. Create a new Engine for each conversation. The first conversation on an Engine is unaffected. A fix landed on LiteRT-LM main on 2026-11-03 (e1f86b05). The LiteRT-LM v0.20.0 release contains it; this model was not tested with a shared Engine on v0.20.0.
Speed
litert-lm benchmark … --cache no, litert-lm 0.16.0 pip, Apple M4 Max (128 GB), text path (prefill/decode; image encoding is a separate one-shot vision-encoder call at prompt time; the int4 rows ran on an earlier int4 file of this repo):
CPU backend:
| Variant | Prefill (256) | Prefill (1024) | Decode | TTFT |
|---|---|---|---|---|
| int8 | 156 tok/s | 387 tok/s | 36.0 tok/s | 1.67 s |
| int4 | 141 tok/s | 181 tok/s | 40.1 tok/s | 1.84 s |
GPU backend (--backend gpu; both variants verified to generate correct text and answer the image check on GPU before quoting):
| Variant | Prefill (256) | Decode | TTFT |
|---|---|---|---|
| int8 | 1835 tok/s | 114.5 tok/s | 0.15 s |
| int4 | 1944 tok/s | 143.2 tok/s | 0.14 s |
On Android, an earlier int4 file of this repo ran GPU-accelerated on 2026-08-13. Pixel 8a (Tensor G3), litert_lm_main built from the v0.16.0 release tag, 292-token prompt, decode run to EOS (≈1.1k tokens sustained), --disable_cache (worst-case load; default caching makes subsequent loads much faster), that int4 file:
| Backend | Prefill (292 tok) | Decode | TTFT |
|---|---|---|---|
| GPU (OpenCL) | 91.6 tok/s | 10.8 tok/s | 3.3 s |
| CPU | 14.1 tok/s | 5.8 tok/s | 20.9 s |
In the GPU run the text graph delegated fully on Android OpenCL (937/937 nodes, zero rejected ops). One operational note: the GPU path writes multi-GB compile caches next to the model by default — on a nearly-full device the cache write can fail mid-initialization; run with --disable_cache or free storage first.
Galaxy S26 — GPU backend
This section describes the files this repo held on 2026-08-25: both ran on the Android GPU backend and generated. For the Android GPU path of the current LFM2.5-VL-3B_int4.litertlm, see Known runtime issues.
| file | GPU backend | delegation | peak |
|---|---|---|---|
LFM2.5-VL-3B_int4.litertlm |
ran | 11135 / 11135 ops across 12 subgraphs on LiteRT GPU |
1465 MiB |
LFM2.5-VL-3B_int8.litertlm |
ran | 11135 / 11135 ops across 12 subgraphs on LiteRT GPU |
1336 MiB |
Measured on a Samsung Galaxy S26 (SM-S942Q / SM8850, Android 16) with litert_lm_advanced_main from litert-lm 0.16.0, --backend=gpu --sampler_backend=cpu, prompt What is the capital of France?. Peak is the process high-water mark (VmHWM) sampled during that same run. Checked 2026-08-25.
The op counts above are the LiteRT GPU partitions. XNNPACK additionally takes 1 of the 4 nodes in main; the runtime accepts that split.
The test prompt carries no image, so this covers engine creation and the text path. The vision path on the GPU is not measured here.
No speed rows in this section, on purpose. A GPU throughput figure only means something beside a CPU row from the same handset. For LFM2.5-VL-3B_int8.litertlm both rows are in litertlm_manifest.json: the GPU row of 2026-08-25 and a CPU row measured on 2026-09-05 (LiteRT-LM 0.16.0), on the same file, which this repo still holds. In those rows the GPU was faster at prefill and decoded at 20.15–20.23 tok/s against 18.77–19.87 on the CPU. No Galaxy S26 CPU row exists for LFM2.5-VL-3B_int4.litertlm.
GPU wiring, including the Gallery import toggle: GPU guide.
Conversion
Converted with the open pipeline in hf-to-litertlm (lfm_work/convert_lfm25_vl.py, litert-torch 0.9.3 --task image_text_to_text): the exact recipe, the int4 post-processing (OCTAV int4-b32 + int8 embedder + zero-scale repair + executor metadata, all vision sections preserved) and the text and image check scripts are in the repo's REPRODUCE.md.
The _v0200 files have a text decoder exported with litert-torch main at commit 5d18d996e, whose default GPU composites keep the ShortConv state channels-last. int8: the exporter's dynamic_wi8_afp32 on the text decoder (convs float because they are operands of the ShortConv composite). int4: the text int4 recipe of LFM2.5-VL-3B_int4.litertlm, with the block scales floored at 2^-14. Their embedder, vision encoder and vision adapter come from the file of the same name without _v0200, so _int4_v0200 and _int4_fixB_v0200 differ as _int4 and _int4_fixB do. Their LLM metadata (chat template included) and tokenizer sections are byte-identical to those of the files without _v0200.
Known runtime issues
Measurements of LFM2.5-VL-3B_int4.litertlm and LFM2.5-VL-3B_int4_fixB.litertlm on this page made before 2026-11-09 used earlier files, not the current ones.
Android GPU with LiteRT-LM v0.18.0 and v0.18.1. LFM2.5-VL-3B_int4.litertlm and LFM2.5-VL-3B_int4_fixB.litertlm keep some of their weights outside the model graph (LiteRT's external weights), and on a Pixel 8a the GPU backend of the v0.18.0 and v0.18.1 Android builds crashes (SIGSEGV) on a Qwen3-0.6B file with external weights (LiteRT-LM#3986).
From the second turn of a conversation on, LiteRT-LM puts the previous answer's stop token into the KV cache with a zero embedding, because these files hold the embedding table in its own section and the decoder takes embeddings, so later answers in a conversation can differ from the answer the model gives to the same messages in one prompt (read in the source of LiteRT-LM 0.16.0 to 0.18.1; measured with 0.18.1 on WeVisOne-VL-2B and Qwen2.5-Coder-1.5B-Instruct, not on these files). One question per conversation avoids it, as does a new conversation that starts with the earlier messages and the new question.
License and changes
Distributed under the LFM Open License v1.0 (see LICENSE, inherited from the base model). Note the license's commercial-use limitation for organizations with annual revenue of US$10M or more. Changes from the original work: weights converted from safetensors to LiteRT flatbuffers and quantized as described above; in the _fixB files, the vision graphs re-exported so the 2×2 pixel-unshuffle happens inside the encoder; chat template replaced by a ChatML-style template written for LiteRT-LM; LiteRT-LM metadata added (the start and stop tokens, a 4096-token context limit and the lfm2 model type); the text decoder of the _v0200 files exported with litert-torch's GPU composites. This repository is a community conversion published by litert-community, not by Liquid AI.