---
license: other
license_name: lfm1.0
license_link: https://huggingface.co/LiquidAI/LFM2.5-350M/blob/main/LICENSE
base_model: LiquidAI/LFM2.5-350M
tags:
- litert
- litert-lm
- litertlm
- on-device
- edge
- liquid
- lfm2.5
pipeline_tag: text-generation
library_name: litert-lm
base_model_relation: quantized
---
# LFM2.5-350M — LiteRT-LM
This repository is a conversion of [LiquidAI/LFM2.5-350M](https://huggingface.co/LiquidAI/LFM2.5-350M) to the **LiteRT-LM** (`.litertlm`) format for Google's [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM) runtime, made with litert-torch: on a Galaxy S26 GPU with LiteRT-LM 0.19.1, `LFM2.5-350M_int4_gpu_composite_v0190.litertlm` decodes at 148.7 tokens per second, against 107.1 for `LFM2.5-350M_int4.litertlm` in the same session (2026-11-14). The int8 and int4 files were tested on litert-lm 0.18.0 on a Mac; their phone rows ran the prebuilt Android binary named below. On litert-lm 0.17.1 the int8 file answered as if no question had been asked: the runtime prefilled 9 tokens for a one-question turn where 0.18.0 prefilled 16, the full turn (the int4 file was not tried on 0.17.1).
Liquid AI describes LFM2.5-350M as a general-purpose text-only model and recommends it for data extraction, structured outputs and tool use, not for knowledge-intensive tasks and programming. It has 350M parameters in 16 layers (10 double-gated convolution blocks + 6 grouped-query attention blocks), tied embeddings and a 65,536-token vocabulary; Liquid AI lists English, Arabic, Chinese, French, German, Japanese, Korean, Portuguese and Spanish and states a 32,768-token context (4096 in these files).
Which file to use, by runtime and backend (⭐ = recommended). The `_v0190` file ran on a Mac M4 Max GPU with litert-lm 0.19.0, 0.19.1 and 0.19.2 from PyPI (0.19.2 is on PyPI only; on 2026-11-14 the newest GitHub release was v0.19.1) and on a Galaxy S26 GPU with LiteRT-LM 0.19.1; it was not run on iOS or on other phones.
| Runtime | Backend | File |
|---|---|---|
| LiteRT-LM 0.19.0 to 0.19.2 | GPU | ⭐ `LFM2.5-350M_int4_gpu_composite_v0190.litertlm` |
| LiteRT-LM 0.19.0 to 0.19.2 | CPU | `LFM2.5-350M_int4.litertlm` or `LFM2.5-350M_int8.litertlm` |
| A build with LiteRT #11565: LiteRT-LM main since commit b1dcfbd0 (2026-11-07), litert-lm-nightly 0.20.0.dev20261112 | CPU, GPU | `LFM2.5-350M_int4.litertlm` or `LFM2.5-350M_int8.litertlm` (such a build refuses the `_v0190` file on the GPU; Known runtime issues) |
| File | Recipe | Size | sha256 |
|---|---|---|---|
| ⭐ `LFM2.5-350M_int4_gpu_composite_v0190.litertlm` | **For the GPU on LiteRT-LM 0.19.0 to 0.19.2** (2026-11-14 entry below): the int4 recipe on an export with GPU composites | 249.2 MB | `18ef9e32a82ba6c45818275c53253bbac80e7e8f826092228e3d446816fb5ae7` |
| `LFM2.5-350M_int8.litertlm` | int8 dynamic on linears + int8 embedding, convs float | 403.5 MB | `a6b191d201e96b876d14eefb9bc34b7da05cc3951e28d06c3ad252481b36c121` |
| `LFM2.5-350M_int4.litertlm` | int4 blockwise-32 + OCTAV on linears, int8 lm_head + embedding | 247.8 MB | `c29a41cdf4148ec9f4b6e57f8e598728a05a189fdc7ca0764b013b78f9dfd52f` |
The int8 and int4 results in the time table below, in Accuracy, in the first paragraph of Correctness and in the first three tables of Performance (Mac M4 Max, Galaxy S26, Pixel 8a) were measured on earlier versions of the two files. The card's other int8 and int4 tests with litert-lm 0.17.1 or 0.18.0 or the prebuilt Android binary also ran on those earlier versions. The earlier int8 version has sha256 `6a78c7a2…` and the earlier int4 version has sha256 `272b0a1c…`; both had been replaced by 2026-11-09. The current files have the same weights, chat template and tokenizer (Known runtime issues says what changed and links the earlier versions).
On IFEval-lite (n=120) the three scores are within three prompts of each other (table in Accuracy); int4 is 38.6 % smaller. Time for a 1024-token prefill plus 256 decoded tokens at context 2048 with `LFM2.5-350M_int8.litertlm` (int8) and `LFM2.5-350M_int4.litertlm` (int4), from the rates in Performance (the `_v0190` file's Galaxy S26 rows are in their own table there):
| Seconds | Mac M4 Max | Galaxy S26 | Pixel 8a |
|---|---|---|---|
| int8 GPU | 0.68 | 2.94 | 5.77 |
| int4 GPU | 0.67 | 2.63 | 5.94 |
| int8 CPU | 2.38 | 3.77 | 8.13 |
| int4 CPU | 2.94 | 3.99 | 7.97 |
Which file is faster differs by device: int4 on the Galaxy S26 GPU, int8 on the Pixel 8a GPU, the two within 1 % on the Mac GPU. Not measured on iOS.
2026-11-14: added `LFM2.5-350M_int4_gpu_composite_v0190.litertlm` (sha256 `18ef9e32…`, 249,184,256 B) for the GPU on LiteRT-LM 0.19.0 to 0.19.2: on a Galaxy S26 GPU with LiteRT-LM 0.19.1, in one session, it decodes at 148.7 tok/s against 107.1 for `LFM2.5-350M_int4.litertlm` (Performance). It is the int4 recipe on an export with litert-torch's GPU composites; its LLM metadata (chat template included) and tokenizer sections are byte-identical to those of `LFM2.5-350M_int4.litertlm`. Check: the 8 questions (Correctness), one process per question, give 7/8 on the GPU and the CPU of a Mac M4 Max (litert-lm 0.19.1 from PyPI) and on the Galaxy S26 GPU (LiteRT-LM 0.19.1 built from its tag), the same as `LFM2.5-350M_int4.litertlm` in the same runs. A build with LiteRT #11565 refuses it on the GPU (Known runtime issues). `LFM2.5-350M_int8.litertlm` and `LFM2.5-350M_int4.litertlm` are unchanged. How it was made: Conversion notes.
## Correctness
8-question check on the Mac M4 Max ([the questions](https://github.com/john-rocky/hf-to-litertlm/blob/main/scripts/verify_quality.py) with "Answer briefly." appended, greedy, one `litert-lm run` process each): int8 6/8 on CPU and on GPU (misses: "What is 8 times 7?" → "64"; "Which is larger: 0.9 or 0.11?" → "0.11 is larger."), int4 7/8 on CPU and on GPU (missing only the second: "0.11 is larger than 0.9."), bf16 (transformers) 7/8, missing the same question.
`LFM2.5-350M_int4_gpu_composite_v0190.litertlm` (2026-11-14), the same questions, one fresh process each: 7/8 on the Mac GPU and on the Mac CPU (litert-lm 0.19.1 from PyPI, `--temperature 0 --seed 0`) and on the Galaxy S26 GPU (LiteRT-LM v0.19.1 built from its tag, top-k 1). All three missed "Which is larger: 0.9 or 0.11?": "0.11 is larger." on both GPUs, "0.11 is larger than 0.9." on the CPU (`scripts/verify_quality.py` before commit [ebc0684](https://github.com/john-rocky/hf-to-litertlm/commit/ebc068427bfc19df0137c12c9a6ff09471079118) counted that reply as correct because it contains "0.9"; the reply is wrong). `LFM2.5-350M_int4.litertlm` gave the same count and the same wrong reply in the same runs.
All 12 signatures of the int8 and int4 files were fully delegated on the three GPUs measured (LITERT_WEBGPU on the Mac, LITERT_CL on both phones), so were the 12 of the 2026-11-14 file on the Galaxy S26 GPU, and every phone run answered "What is the capital of France? Answer in one sentence." correctly. A prompt-length check on CPU (41 prompt lengths, 19 and 21 to 60 tokens, a fresh engine each) returned the expected word at every length from both files; it was not run on GPU. In a three-turn conversation on CPU, int8 gave bf16's three replies word for word; int4 answered with a different word ("large") and completed all three turns.
## Accuracy
IFEval-lite scores the first 120 rows of google/IFEval whose instruction types it checks mechanically: prompt-level strict, greedy; the litert-lm rows ran one `litert-lm run` process per prompt. The scores are comparable only within this table, not with published IFEval scores.
| Configuration | Prompts passed (n=120) | Same file, Mac GPU (WebGPU on Metal) |
|---|---|---|
| bf16 reference (transformers, MPS) | 81 (67.5 %) | — |
| int8, litert-lm CPU | 82 (68.3 %) | 86 (71.7 %) |
| int4, litert-lm CPU | 79 (65.8 %) | 78 (65.0 %) |
Prompt by prompt, int8 on CPU failed 6 prompts that bf16 passed and passed 7 that bf16 failed; int4 failed 9 and passed 7. Between the CPU and Mac GPU runs of the same file, 8 (int8) and 13 (int4) prompts flipped, in both directions. On GSM8K (test questions 0–99, greedy, at most 1024 output tokens; bf16 in transformers, int8 and int4 on litert-lm CPU) bf16, int8 and int4 answered 2, 2 and 8 of 100 correctly with the harness's prompt and 7, 5 and 14 with a second wording of it; both wordings ask for step-by-step reasoning, and most bf16 and int8 replies were the final-answer line alone, with no working.
## Usage
```bash
litert-lm run ./LFM2.5-350M_int8.litertlm --prompt "Extract the dates from: The meeting moved from May 3 to May 17."
litert-lm run ./LFM2.5-350M_int8.litertlm --prompt "Extract the dates from: The meeting moved from May 3 to May 17." --backend gpu --cache no
litert-lm benchmark ./LFM2.5-350M_int8.litertlm -p 1024 -d 256 --max-num-tokens 2048 --runs 3 --cache no --backend cpu
```
Both `run` commands printed `May 3, May 17`; `LFM2.5-350M_int4.litertlm` answered with a list of the two dates, and no reply contained a chat marker such as `<|im_end|>`. Without `--backend`, `run` uses the CPU; without `--cache`, it writes a compiled-weights cache next to the model (358 MB for int8, 231 MB for int4 on CPU). For Android, see [android-gpu.md](https://github.com/john-rocky/hf-to-litertlm/blob/main/docs/android-gpu.md).
The GPU file for LiteRT-LM 0.19.0 to 0.19.2 (2026-11-14), from an empty directory:
```bash
uvx --from litert-lm==0.19.2 litert-lm run --from-huggingface-repo=litert-community/LFM2.5-350M LFM2.5-350M_int4_gpu_composite_v0190.litertlm --backend gpu --cache no --prompt "Extract the dates from: The meeting moved from May 3 to May 17."
```
On a Mac M4 Max, from an empty directory with an empty home directory (the first run, 0.19.2 on the GPU, downloaded the file from this repo and the later runs used that copy; `litert-lm==0.19.0` or `litert-lm==0.19.1` in place of `litert-lm==0.19.2` for those two versions), this command printed the two dates as a list on litert-lm 0.19.0, 0.19.1 and 0.19.2, and on 0.19.2 without `--backend gpu` (CPU); on litert-lm-nightly 0.20.0.dev20261112 it printed `An error occurred` and exited with status 0 (Known runtime issues).
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 have the same download code) can keep an incomplete download in `~/.litert-lm/cache/huggingface/litert-community/LFM2.5-350M/` and uses it again on later runs without checking its size. Delete that file and run the command again.
The bundle's default sampler is temperature 0.1, top-k 50, top-p 1.0 (Liquid AI's recommended temperature and top_k; its recommended repetition_penalty 1.05 is not carried). `run` uses that sampler unless you pass `--top-k`, `--top-p`, `--temperature` or `--seed`; `--top-k 1` gives greedy output.
The chat template is byte-identical to LiteRT-LM's [`models/lfm2/chat_template.jinja` at commit 86a7e6d0](https://github.com/google-ai-edge/LiteRT-LM/blob/86a7e6d098c3a6578208fc8538228fa704ca2e8b/models/lfm2/chat_template.jinja), with its stops `<|im_end|>` and `<|endoftext|>` and start token `<|startoftext|>`. The metadata marks the model non-thinking (supports_thinking false) and keeps that configuration's `thought` channel (`` / ``).
Tool calling is declared (model type lfm2). The template lists tools in the system turn as `List of tools: [ … ]`, the same text Liquid AI's template renders for one tool; after a tool call the two templates differ in two places (call arguments in double quotes, the tool result wrapped in `[ … ]`). On litert-lm 0.18.0 (Python API, CPU, greedy) the int8 and int4 files returned a parsed `get_weather` call with `{"city": "Paris"}` (not run on the 2026-11-14 file), and with automatic tool calling the reply used the tool's result.
Engine reuse (int8 file, Python API, CPU, greedy, the same in 3 of 3 processes): on an Engine that had already served one conversation, 2 of the next conversation's 3 answers changed — "What is 17 times 23?" got 323, where a fresh Engine answered 391, the correct product — while both conversations still followed their system prompts. A related open issue is [LiteRT-LM #3165](https://github.com/google-ai-edge/LiteRT-LM/issues/3165). Open a new Engine for each conversation. A fix landed on LiteRT-LM main on 2026-11-03 ([e1f86b05](https://github.com/google-ai-edge/LiteRT-LM/commit/e1f86b05bf8a731331622a2622440e9f93d9a9f5)). It is not in v0.19.1, the newest GitHub release, and PyPI's 0.19.2 was not checked for it; this note will be updated when a release carries it.
## Performance
Mac M4 Max, litert-lm 0.18.0: the benchmark command above with `--backend cpu` or `gpu` (1024-token prefill, 256-token decode, context 2048), one warmup, then the mean of 3 iterations; GPU is WebGPU on Metal, after a 300 s rest. Init is the first iteration's `Init time` as the CLI prints it; that value includes both `Init Total` and the phases inside it, so it counts engine creation twice ([LiteRT-LM #4057](https://github.com/google-ai-edge/LiteRT-LM/issues/4057)).
| Mac M4 Max | Prefill 1024 (tok/s) | Decode 256 (tok/s) | TTFT (s) | Init (s) |
|---|---|---|---|---|
| int8 GPU | 13556.05 | 423.73 | 0.0780 | 1.0924 |
| int4 GPU | 13965.02 | 425.85 | 0.0757 | 1.1679 |
| int8 CPU | 2200.63 | 134.00 | 0.4730 | 3.7308 |
| int4 CPU | 1195.41 | 123.11 | 0.8649 | 1.1431 |
Phones, Android 16: Galaxy S26 (SM-S942Q, Qualcomm SM8850, Adreno) and Pixel 8a (Tensor G3), the same workload through the prebuilt `litert_lm_advanced_main` (sha256 adac974b…, 40,382,152 bytes) published 2026-09-18 in LiteRT-LM's public binary bucket (`binaries/latest/android_arm64/litert_lm/`) with `--benchmark=true --benchmark_prefill_tokens=1024 --benchmark_decode_tokens=256 --max_num_tokens=2048 --num_iterations=3 --report_peak_memory_footprint=true`. Rates are the mean of iterations 2 and 3 (GPU: LITERT_CL). Init cold = the first process after the compiled-program caches were removed, warm = the benchmark process, which read those caches; peak = the runtime's `Peak system ram usage` line, the maximum of the 3 iterations.
| Galaxy S26 | Prefill 1024 (tok/s) | Decode 256 (tok/s) | TTFT (s) | Init cold / warm (s) | Peak (MB) |
|---|---|---|---|---|---|
| int8 GPU | 5660.6 | 92.9 | 0.19 | 4.07 / 0.95 | 506.7 |
| int4 GPU | 4391.3 | 106.9 | 0.24 | 4.04 / 1.19 | 472.2 |
| int8 CPU | 1752.7 | 80.31 | 0.60 | 0.52 / 0.12 | 1274.0 |
| int4 CPU | 875.9 | 90.63 | 1.19 | 0.82 / 0.60 | 1120.9 |
The CPU rows ran with the clock lowering during them (lowered in 3 of 6 samples for int8 and 5 of 7 for int4, read every 2 s); decode fell across the three iterations (89.63 → 87.28 → 73.34 tok/s int8; 101.67 → 97.12 → 84.14 int4).
| Pixel 8a | Prefill 1024 (tok/s) | Decode 256 (tok/s) | TTFT (s) | Init cold / warm (s) | Peak (MB) |
|---|---|---|---|---|---|
| int8 GPU | 2410.6 | 47.9 | 0.445 | 11.56 / 1.56 | 939.2 |
| int4 GPU | 1245.9 | 50.06 | 0.84 | 6.08 / 1.83 | 872.2 |
| int8 CPU | 509.1 | 41.81 | 2.04 | 0.77 / 0.46 | 979.0 |
| int4 CPU | 342.1 | 51.41 | 3.02 | 1.46 / 1.25 | 836.0 |
In the two Galaxy S26 GPU runs the CPU clock was lowered too (in 3 of 4 samples for int8 and 4 of 4 for int4, read every 2 s while the benchmark process ran); the GPU clock was at its maximum in every sample. In the four Pixel 8a runs the CPU clock was not lowered. The Pixel 8a's GPU clock cannot be read by the benchmark harness, so whether it was lowered during the Pixel 8a GPU runs is not known. Not run on the NPU.
`LFM2.5-350M_int4_gpu_composite_v0190.litertlm` against `LFM2.5-350M_int4.litertlm` on the same Galaxy S26 GPU, 2026-11-14: `litert_lm_advanced_main` built from LiteRT-LM's v0.19.1 tag (commit 7a03724c), the same benchmark flags, the two files in one session, four benchmark processes in the order of the Run column. The default build of that tag links a GPU accelerator compiled from source (its log says `Statically linked GPU accelerator registered.`); the prebuilt binary of the two phone tables above loads Google's prebuilt one (`Dynamically loaded GPU accelerator(libLiteRtOpenClAccelerator.so) registered.`). Each benchmark process started 31 to 71 s after the cold-start process of the same file ended, with every CPU and GPU clock ceiling at its top. While the four processes ran (read every 2 s), the GPU clock ceiling was at its top in every sample, and the phone lowered the CPU clock ceiling in 2 of 4, 3 of 3, 3 of 3 and 4 of 4 samples (at the lowest to 91 % and 77 % of the two CPU clusters' maxima in the int4 file's runs, 97 % and 84 % in the `_v0190` file's). Rates are the mean of iterations 2 and 3; init cold / warm and peak are read as for the phone tables above. This table and the Galaxy S26 table above ran different binaries, so compare rows within a table.
| Run | Galaxy S26 GPU, LiteRT-LM 0.19.1 | Prefill 1024 (tok/s) | Decode 256 (tok/s) | TTFT (s) | Init cold / warm (s) | Peak (MB) |
|---|---|---|---|---|---|---|
| 1 | int4 | 2793.6 | 107.7 | 0.38 | 3.60 / 1.03 | 407.9 |
| 2 | `_gpu_composite_v0190` | 3595.1 | 148.0 | 0.29 | 3.02 / 0.99 | 428.0 |
| 3 | `_gpu_composite_v0190` | 3609.4 | 149.3 | 0.29 | 3.03 / 0.99 | 428.3 |
| 4 | int4 | 2781.5 | 106.5 | 0.38 | 3.63 / 1.03 | 408.4 |
Mean of the two runs of each file: decode 148.7 against 107.1 tok/s (1.39 times), prefill 3602.3 against 2787.5 tok/s (1.29 times). In a separate process that ran one prompt after each of the four benchmark processes, both files answered "What is the capital of France? Answer in one sentence." with "The capital of France is Paris."
## Conversion notes
- **Source and stack:** LiquidAI/LFM2.5-350M at revision 9e6c6ccf; litert-torch 0.9.4, litert-converter 0.4.0, ai-edge-quantizer 0.9.0, ai-edge-litert 2.2.0, transformers 5.14.1, torch 2.13.0 (released wheels); packed by the litert-lm 0.18.0 CLI. `lfm_work/convert_lfm25_350m.sh` in [hf-to-litertlm](https://github.com/john-rocky/hf-to-litertlm) runs the steps listed under Order up to the metadata repack, and [`tools/externalize/externalize_repo.sh`](https://github.com/john-rocky/hf-to-litertlm/tree/main/tools/externalize) in the same repository runs the last step (LiteRT's externalize tools at commit 8761012b, litert-lm-builder 0.18.0).
- **Order:** unquantized export (11 prefill signatures, 1024 down to 1, plus decode, over a 4096-position KV cache; 22 state buffers: 10 ShortConv states, 6 key and 6 value caches) → post-hoc int8 and int4 quantization → a scan of the int4 block scales (none of the 92 blockwise tensors has a zero or subnormal scale) → metadata repack with LiteRT-LM's lfm2 configuration → linear-layer and embedding weights moved to a TFLiteWeights section at the end of the file, float weights kept in the graph (`bash tools/externalize/externalize_repo.sh litert-community/LFM2.5-350M --revision --keep-float-inline`; each file's commit is in [`tools/externalize/moves/2026-11-09.tsv`](https://github.com/john-rocky/hf-to-litertlm/blob/main/tools/externalize/moves/2026-11-09.tsv)).
- **Template:** Liquid AI's chat template fails at template creation on litert-lm 0.18.0 (`{% generation %}` markers), so the bundle carries LiteRT-LM's lfm2 template, which reads message content as a list of parts.
- **The 2026-11-14 file (`LFM2.5-350M_int4_gpu_composite_v0190.litertlm`):** the same checkpoint exported with litert-torch at commit 65aafa4 (`export_hf --apply_gpu_composites=True --use_short_conv_composite=True`; litert-converter 0.6.0.dev20261103, transformers 5.22.1, torch 2.14.0; one local change in the packaging step, the model-type enum names passed to the bundle builder, leaves the export untouched), which writes the ShortConv state channels-first; the int4 recipe of `LFM2.5-350M_int4.litertlm` (file table) with ai-edge-quantizer 0.9.0, the lm_head int8 in all 12 signatures; no zero or subnormal block scale; the LLM metadata and tokenizer sections of `LFM2.5-350M_int4.litertlm` put back byte for byte; external weights with the float ShortConv filters kept in the graph, packed with litert-lm 0.19.1. Composites over the 12 signatures: KV cache write 72, attention 72, ShortConv step 120, q/k norm with RoPE 72, RMSNorm 396, SwiGLU 192.
## Known runtime issues
**`LFM2.5-350M_int4_gpu_composite_v0190.litertlm` and LiteRT #11565.** This file keeps the ShortConv state channels-first. [LiteRT #11565](https://github.com/google-ai-edge/LiteRT/pull/11565) makes channels-last the only layout the GPU `short_conv_step` accepts, so a build that carries it refuses the file at engine creation with `ShortConvStep supports only a channels-last conv_state [1, 2, H], but got [1, 1024, 2]`. LiteRT-LM main has carried it since commit [b1dcfbd0](https://github.com/google-ai-edge/LiteRT-LM/commit/b1dcfbd0b14f415ce67e19fd11421b340776845f) (2026-11-07). litert-lm-nightly 0.20.0.dev20261112 refuses the file this way on a Mac, and its CLI prints `An error occurred` and exits with status 0 (the nightlies 0.20.0.dev20261106 to 0.20.0.dev20261111 were not tried). LiteRT-LM main at commit 1d378fca (two commits before b1dcfbd0), built with its LiteRT pin moved to bf49eb62 (the pin b1dcfbd0 adopted), refuses it with the same message on a Mac and on the Galaxy S26 (`litert_lm_advanced_main` exits with status 2). On such a build use `LFM2.5-350M_int4.litertlm` or `LFM2.5-350M_int8.litertlm`: they have no ShortConv composite and run with or without #11565. When a LiteRT-LM release carries #11565, a channels-last build replaces this file here.
**External weights.** In `LFM2.5-350M_int4.litertlm` and `LFM2.5-350M_int8.litertlm`, the linear-layer and embedding weights sit in a TFLiteWeights section at the end of the file (LiteRT's external weights) instead of inside the model graph. `LFM2.5-350M_int4_gpu_composite_v0190.litertlm` (2026-11-14) has its linear-layer and embedding weights in such a section too. On Android, `LFM2.5-350M_int4.litertlm` and `LFM2.5-350M_int4_gpu_composite_v0190.litertlm` ran on the GPU of a Galaxy S26 with LiteRT-LM 0.19.1 (2026-11-14, Performance); `LFM2.5-350M_int8.litertlm` was not run on an Android GPU in this form. On a Pixel 8a, the GPU engine 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](https://github.com/google-ai-edge/LiteRT-LM/issues/3986)). The earlier files with the weights inside the graph stay at revision [`f8e0303`](https://huggingface.co/litert-community/LFM2.5-350M/tree/f8e0303a31396638011af4901c056aa99385e9fb). `lfm_work/convert_lfm25_350m.sh` in [hf-to-litertlm](https://github.com/john-rocky/hf-to-litertlm) rebuilt both earlier files with all four sections (metadata, state binding, tokenizer, model) byte-identical (the whole-file sha256 differs only by the packer's uuid and timestamp).
**Long greedy replies on the GPU may vary between runs.** On the GPU's default path, where the sampler writes the inputs of the next decode step, a long greedy reply of [LFM2.5-2.6B](https://huggingface.co/litert-community/LFM2.5-2.6B) differed from one process to the next on a Mac (WebGPU, LiteRT-LM 0.19.1 from PyPI and built from source) and on a Pixel 11 Pro GPU (PyPI `litert-lm-api` 0.19.0); with `--sampler_handles_input=false` (`litert_lm_advanced_main` built from source; the Python, Kotlin and Swift APIs of 0.19.1 have no such setting) it gave one reply. The files here run the same GPU path; this was not measured on them.
From a conversation preface (the system message, initial messages, tools and extra context a conversation is created with) that has tools and no messages, LiteRT-LM renders these files' chat template with an empty message list, and the template reads `messages[0]` without checking that the list is non-empty, so the render fails with `Failed to apply template: undefined value`. This happens in two places: when the preface is prefilled at creation (`prefillPrefaceOnInit = true` in Kotlin, `prefillPrefaceOnInit: true` on the web, `SetPrefillPrefaceOnInit(true)` in C++; the default is false), where creating the conversation fails with that error, and in the preface render (`renderPrefaceIntoString()` in Kotlin and Swift, `RenderPrefaceIntoString()` in C++, `litert_lm_conversation_render_preface_to_string` in the C API). The same happens with extra context (such as `enable_thinking`) and no messages, and in the preface render with an empty preface (run in the runtime on one Qwen3 template; the other templates rendered with minijinja 2.14 and jinja2). Read in the source of LiteRT-LM 0.17.0, 0.18.1 and main; measured with LiteRT-LM 0.18.1 (the litert-lm package from PyPI) through its C API on these files' template text. The default path, where the first message is rendered together with the preface, is not affected: the Python API and the CLI of 0.18.1 expose neither the flag nor the preface render, and Google AI Edge Gallery sets neither (its source as read on 2026-10-25). A system message or any initial message in the conversation config avoids it.
## License and changes
Distributed under the **LFM Open License v1.0** inherited from the base model ([LICENSE](https://huggingface.co/LiquidAI/LFM2.5-350M/blob/main/LICENSE)); its section 5 conditions commercial use on an annual revenue below 10 million US dollars. **Changes from the original work:** exported to the LiteRT-LM format and quantized to int8 and int4 as described above; chat template and stop tokens taken from LiteRT-LM's `models/lfm2` configuration, with max_num_tokens changed from 32768 to 4096 and supports_thinking from true to false; `LFM2.5-350M_int4_gpu_composite_v0190.litertlm` (2026-11-14) exported with litert-torch's GPU composites. This conversion was made and is published independently of Liquid AI.