Instructions to use litert-community/LFM2.5-1.2B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT-LM
How to use litert-community/LFM2.5-1.2B-Instruct with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install -U litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli # A single .litertlm file in the repo is picked automatically; otherwise the CLI asks which one to run # (or pass its name right after the repo id). litert-lm run \ --from-huggingface-repo=litert-community/LFM2.5-1.2B-Instruct \ --prompt="Write me a poem"
- LiteRT
How to use litert-community/LFM2.5-1.2B-Instruct with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
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, lfm2.5-1.2b-instruct-int4): Galaxy S26 Β· LiteRT-LM 0.16.0 Β· GPU Β· did not run: engine_create_failed (2026-08-23); Raspberry Pi 5 Β· LiteRT-LM 0.16.1 Β· CPU, 4 threads Β· decode 9.3 tok/s Β· prefill 54 tok/s Β· TTFT 4.84 s (2026-09-01). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/lfm2.5-1.2b-instruct-int4/CARD.md
Measured on device (edge-compat, lfm2.5-1.2b-instruct-int8): Galaxy S26 Β· LiteRT-LM 0.16.0 Β· CPU Β· decode 41.0 tok/s Β· prefill 491 tok/s Β· TTFT 440 ms (2026-09-05); Pixel 8a Β· LiteRT-LM 0.16.0 Β· CPU Β· decode 20.4 tok/s Β· prefill 143 tok/s Β· TTFT 1.48 s (2026-09-05); Raspberry Pi 5 Β· LiteRT-LM 0.16.1 Β· CPU, 4 threads Β· decode 7.0 tok/s Β· prefill 75 tok/s Β· TTFT 3.56 s (2026-09-01). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/lfm2.5-1.2b-instruct-int8/CARD.md
LFM2.5-1.2B-Instruct β LiteRT-LM
LiquidAI/LFM2.5-1.2B-Instruct converted to the LiteRT-LM (.litertlm) format for on-device inference with Google's LiteRT-LM runtime (the files without _v0200 require litert-lm β₯ 0.15 / a recent AI Edge Gallery). For the GPU on LiteRT-LM 0.20.0, use LFM2.5-1.2B-Instruct_int8_v0200.litertlm, one of the two _v0200 files added for it. On a Mac M4 Max with litert-lm 0.20.0 from PyPI, this command, run from an empty directory, printed an answer that begins A hybrid conv-attention LLM combines convolutional and attention mechanisms to process sequential data more efficiently, enhancing both local feature extraction and global context understanding.
uvx --from litert-lm==0.20.0 litert-lm run --from-huggingface-repo=litert-community/LFM2.5-1.2B-Instruct LFM2.5-1.2B-Instruct_int8_v0200.litertlm --backend gpu --cache no --prompt "Explain what a hybrid conv-attention LLM is in two sentences."
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 two _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 with LiteRT-LM 0.20.0, or on iOS.
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-1.2B-Instruct/ and uses it again on later runs without checking its size. Delete that file and run the command again.
LFM2.5-1.2B-Instruct is Liquid AI's flagship on-device model: a hybrid architecture mixing gated short-convolution blocks with grouped-query attention. Per the base model card it outperforms Qwen3-1.7B and Gemma 3 1B on knowledge and instruction-following benchmarks at a smaller footprint.
Verified on a Pixel 8a (Android 16, LiteRT-LM 0.16.1, 2026-09-07): the _int4_gpu file, downloaded from this repository and checked against its SHA-256, answered one text turn on the GPU and one on the CPU.
| File | Recipe | Size | GSM8K (n=100) |
|---|---|---|---|
LFM2.5-1.2B-Instruct_int8.litertlm |
int8 dynamic (linears + convs + embedding) | 1.25 GB | 81% (bf16 reference: 79%) |
LFM2.5-1.2B-Instruct_int4.litertlm |
int4 blockwise-32 + OCTAV linears, int8 embedding, convs float | 736 MB | 72% |
LFM2.5-1.2B-Instruct_int4_gpu.litertlm |
same int4 recipe, re-exported so it runs on the GPU | 736 MB | = int4 (A/B in notes) |
LFM2.5-1.2B-Instruct_int8_v0200.litertlm |
For LiteRT-LM 0.20.0: int8 on linears + embedding, convs float, on an export with GPU composites (ShortConv state channels-last) | 1.25 GB | not measured |
LFM2.5-1.2B-Instruct_int4_v0200.litertlm |
For LiteRT-LM 0.20.0: the int4 recipe above, on a separate export at the same litert-torch commit | 737 MB | not measured |
The chat template accepts both the string form and the 0.18 content-parts form of a message.
| Context (KV cache) | 4096 max (see --max-num-tokens note) |
| Backend | CPU for every file. The _v0200 files run on the CPU and the GPU with LiteRT-LM 0.20.0 (macOS verified by generation; see the top of this page). Of the other files, only _int4_gpu also runs on the GPU, with litert-lm β₯ 0.16.0 β Android OpenCL, macOS, and iOS Metal, all verified by generation. On iOS set maxNumTokens to 1024 (see the iPhone section β a mismatched value breaks engine creation) |
| Template | in the file β full chat template incl. tool-list support + <think> channel declaration |
| Base model | LiquidAI/LFM2.5-1.2B-Instruct (LFM Open License v1.0) |
Quality β GSM8K
GSM8K, greedy, 0-shot chain-of-thought, max-tokens 1024, n=100, run the same way for all rows:
| Configuration | GSM8K |
|---|---|
| PyTorch bf16 (reference) | 79% |
| LiteRT int8 (this repo) | 81% |
| LiteRT int4-b32 OCTAV (this repo) | 72% |
LFM2.5-1.2B-Instruct_int8.litertlm scores within noise of the PyTorch reference (+2pt). LFM2.5-1.2B-Instruct_int4.litertlm trades β7pt for a 41% smaller download.
With litert-lm 0.20.0 from PyPI on a Mac M4 Max (2026-11-24 and 2026-11-25; these 8 questions with "Answer briefly." appended, greedy with --max-num-tokens 2048 and --thinking false, one process per question, one run), LFM2.5-1.2B-Instruct_int8_v0200.litertlm scored 8/8 on the GPU and on the CPU, and LFM2.5-1.2B-Instruct_int4_v0200.litertlm 8/8 on the CPU and 7/8 on the GPU, where it missed the question that asks it to complete "Roses are red, violets are ___"; no run degenerated. Of the files without _v0200, _int4 on the CPU and _int4_gpu on the GPU scored 7/8 on the same check, and _int8 on the CPU 8/8. On the GPU of litert-lm 0.20.0 from PyPI (Mac M4 Max, 2026-11-24), LFM2.5-1.2B-Instruct_int8.litertlm printed An error occurred in place of every answer of the 8-question check above, with exit status 0. On a Snapdragon Galaxy S26 GPU on 2026-11-12, both _v0200 files gave 8/8 with a LiteRT-LM main build (LiteRT-LM 1d378fca with LiteRT bf49eb62, 2026-11-07) that has LiteRT #11565, which makes channels-last the only layout of the GPU short_conv_step.
Usage
litert-lm run ./LFM2.5-1.2B-Instruct_int8.litertlm --prompt "Explain what a hybrid conv-attention LLM is in two sentences."
The file carries the tokenizer and the full chat template (ChatML-style <|im_start|>β¦<|im_end|> with tool-calling support). Generation stops cleanly at <|im_end|>.
--max-num-tokens tip: decode speed drops as the token budget grows (int8 decode: 101 tok/s at 1024 β 77 tok/s at 4096 on an M4 Max) β set it to the smallest value your use case needs (1024 is a good chat default; the file allows up to 4096).
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 open 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, also for _int4_gpu; litert-lm 0.18.0 on a Mac), the _int8 file gave the same three one-word answers on both Engines, in its one run. Those three short questions say nothing about longer conversations. The test could not measure the _int4 and _int4_gpu files: each file's fresh-Engine baseline did not pass the test's own check (all three expected answers present: Paris, 391, blue) in either of its two runs (a test is run a second time only when its first run does not pass), so there was nothing to compare. 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.
Tool calls on litert-lm 0.18.0. The files without _v0200 carry llm_model_type lfm2 and a chat template that renders tool calls and tool results; on litert-lm 0.18.0 the runtime parses the LFM2 tool call and the tool result reaches the model. The lfm2 model type needs litert-lm β₯ 0.15.0; the tool-call parser is 0.18.0's β on 0.15β0.17 the tool call still arrives as text (read from the runtime source, not run here). For _int4_gpu, the GPU file: the model type lfm2 sets the runtime's GPU executor defaults (every non-generic LiteRT-LM model type shares them: allow_src_quantized_fc_conv_ops on, OpenCL hint_waiting_for_completion off, kernel batch size unset); the phone GPU rows on this card from LiteRT-LM 0.16.0 and 0.16.1 were measured with earlier versions of the files.
Performance
litert-lm benchmark (litert-lm 0.15.0), CPU backend, Apple M4 Max, -p 256 -d 256 --runs 3 (the tool averages three iterations), warm-up run discarded, otherwise idle machine: decode depends strongly on the KV budget, so both settings are listed:
| Variant | --max-num-tokens |
Prefill (256) | Decode | TTFT |
|---|---|---|---|---|
| int8 | 1024 | 1592 tok/s | 93.1 tok/s | 0.17 s |
| int4 | 1024 | 381 tok/s | 109.4 tok/s | 0.68 s |
| int8 | 4096 | 1121 tok/s | 78.9 tok/s | 0.24 s |
| int4 | 4096 | 343 tok/s | 74.9 tok/s | 0.76 s |
On a Pixel 8a (Tensor G3, CPU backend, measured in AI Edge Gallery): int8 decodes at ~19 tok/s and int4 at ~31 tok/s β on phone-class memory bandwidth the int4 file is ~1.7Γ faster as well as 41% smaller, so prefer int4 on mid-range devices unless you need the last few GSM8K points.
GPU β the _int4_gpu file
Pixel 8a (Tensor G3), litert_lm_main built from the litert-lm v0.16.0 release tag, 263-token prompt, generation capped at 256, 3 runs per backend:
| Backend | Prefill (263 tok) | Decode | TTFT |
|---|---|---|---|
| GPU (OpenCL) | 188β193 tok/s | 21.0β21.2 tok/s | 1.41β1.44 s |
| CPU | 38β54 tok/s | 15.2β24.3 tok/s | 4.9β7.0 s |
On phone-class hardware the GPU's win is prefill and time-to-first-token (3β6Γ both); decode is bandwidth-bound and roughly a wash, so long prompts gain far more than long answers. The CPU rows spread because the phone throttles across a run series; the GPU rows repeat to within 2%.
Apple M4 Max (litert-lm benchmark --cache no, litert-lm 0.16.0, -p 256 -d 256 --runs 3, otherwise idle machine; both backends were verified to generate correct text before these numbers were quoted):
| Backend | Prefill (256) | Decode | TTFT |
|---|---|---|---|
| GPU | 3765 tok/s | 318.3 tok/s | 0.07 s |
| CPU | 337.0 tok/s | 80.5 tok/s | 0.78 s |
On a desktop GPU the gain is across the board β roughly 11Γ prefill and 4Γ decode against the same file on CPU.
Apple M4 Max β litert-lm 0.20.0
Apple M4 Max, litert-lm 0.20.0 from PyPI (litert-lm benchmark <file> -p 1024 -d 256 --max-num-tokens 2048 --runs 1 --backend gpu|cpu --cache no, one process per run, each timing one iteration after the tool's warm-up; a 300 s rest before each GPU run and a 60 s rest before each CPU run). The files were downloaded from this repository on 2026-11-29 and checked against their SHA-256. On 2026-11-29, _int4_gpu and _int4_v0200 ran three times each on the GPU and then on the CPU, the two files alternating. On 2026-11-30, _int8_v0200 ran three times on the GPU, and then _int8 and _int8_v0200 ran three times each on the CPU, alternating. In one-question checks with this version, each file generated text on each backend it was timed on. In those checks on the GPU, _int8 printed An error occurred in place of an answer, so it was not timed there. Median of three runs; the three runs are within 1% of each other in the three GPU rows and the two int4 CPU rows, and within 2.2% in the two int8 CPU rows:
| File | Backend | Prefill (1024) | Decode | TTFT |
|---|---|---|---|---|
_int4_gpu |
GPU | 6206 tok/s | 354.3 tok/s | 0.168 s |
_int4_v0200 |
GPU | 6343 tok/s | 444.1 tok/s | 0.164 s |
_int8_v0200 |
GPU | 6277 tok/s | 321.5 tok/s | 0.166 s |
_int4_gpu |
CPU | 471.1 tok/s | 117.7 tok/s | 2.18 s |
_int4_v0200 |
CPU | 424.8 tok/s | 127.1 tok/s | 2.42 s |
_int8 |
CPU | 1888 tok/s | 97.8 tok/s | 0.553 s |
_int8_v0200 |
CPU | 1502 tok/s | 111.4 tok/s | 0.691 s |
GPU β Galaxy S26 (Snapdragon 8 Elite Gen 5)
Galaxy S26 (SM-S942Q / SM8850, Android 16), litert_lm_main from litert-lm 0.16.0, the _int4_gpu file, 19-token prompt, one run per backend:
| Backend | Prefill (19 tok) | Decode | TTFT | Init |
|---|---|---|---|---|
| GPU (OpenCL) | 80.3 tok/s | 24.7 tok/s | 0.28 s | 15.0 s |
| CPU (XNNPACK) | 10.3 tok/s | 24.1 tok/s | 1.89 s | 6.5 s |
The prompt was 19 tokens, so read the prefill column as a floor rather than a throughput figure β at that length the fixed per-call cost dominates. The 263-token Pixel 8a rows above are the throughput measurement. Decode is a wash (24.7 against 24.1), which is what bandwidth-bound decode looks like; the GPU's win here is time-to-first-token, 6.7Γ. The GPU took the whole graph, 542 of 542 ops on LITERT_CL; on CPU, XNNPACK took 469 of 542.
GPU β iPhone 17 Pro (iOS Metal)
The engine-creation failure previously tracked in LiteRT-LM#3129 turned out to be a context-sizing issue on the integration side, not a runtime bug. The Metal delegate compiles its kernels against the KV cache that maxNumTokens pre-allocates; a value that does not match this file's exported plan (our test app derived ~650) makes engine creation fail with a shader-compile error. On iOS Metal, set maxNumTokens to 1024 (Swift EngineConfig(maxNumTokens:), C API litert_lm_engine_settings_set_max_num_tokens).
iPhone 17 Pro, litert-lm v0.16.0 xcframework, maxNumTokens 1024, single run, device charging: decode 67.7 tok/s (the int4 file on CPU on the same phone: 52.6), TTFT 109 ms on a short prompt, prefill 1,982 tok/s at p=128, peak ~470 MB. All Metal kernels compile, generation is coherent, and the file scores the same 8-question check as on CPU (7/8).
Of the files without _v0200, only _int4_gpu loads on the GPU. LFM2.5-1.2B-Instruct_int4.litertlm delegates 536 of its 579 ops and then fails to create the engine, because the remaining 43 do not lower (GATHER_ND: Operation is not supported, plus several INT64 tensors). Use _int4_gpu on the GPU backend and _int4 or _int8 on CPU.
Run on Android
Install a recent Google AI Edge Gallery (1.0.16+ imports .litertlm directly from Hugging Face), import this repo (or adb push a file and use local import), select the CPU backend, and chat. GPU acceleration on Android uses the _int4_gpu file and litert-lm β₯ 0.16.0 (litert_lm_main --backend=gpu, or the SDKs; the _v0200 files were not run on a phone with LiteRT-LM 0.20.0); the Gallery ships its own runtime, which may lag that version β if its GPU toggle fails there, use CPU.
β Gallery's import dialog defaults to CPU-only. Scroll it to Compatible accelerators and tick GPU at import time; a model already imported has to be deleted and re-imported. Nothing in the file sets this. Full recipe: Running converted models on GPU (Android).
In a Flutter app, flutter_edge_ai_litertlm (1.14.0) installs this repo's file through FlutterEdgeAi.resolveHuggingFace('litert-community/LFM2.5-1.2B-Instruct'), which reads the repo's litertlm_manifest.json and picks the file and backend for the device; in React Native, react-native-litert-lm (0.8.0) does the same through resolveFromManifest(). Neither route is device-verified by this card; each package's README states its tested platforms.
For sample apps, see google-ai-edge/litert-samples.
Conversion notes
Converted with released litert-torch 0.9.1 (which ships the lfm2 hybrid model support), with one exporter patch: the stock LFM2 short-conv block saves its conv state from the last columns of the prefill chunk, which are padding whenever the prompt does not exactly fill a prefill signature β corrupting the first generated token of nearly every reply. The patch derives the valid length from the attention mask in-graph and gathers the conv state from the last valid columns instead; with it, LiteRT-LM's output is token-identical to an exact per-token reference loop at every prompt length. Multi-length prefill signatures (1β1024) are exported so the runtime can pick tight chunks.
Quantization targets fully-connected + embedding ops (plus convs in LFM2.5-1.2B-Instruct_int8.litertlm, quantized at export time).
Why there is a separate _int4_gpu file. The exporter patch above reads the chunk's valid length with index_select and a mask sum, which lower to GATHER_ND and INT64 ops, and GPU delegates reject both β the CPU-only files take 536 of 579 operations on the GPU and the runtime then refuses the partial split. litert-torch 0.9.2 fixed the underlying conv-state bug upstream using valid-token masking and a one-hot matmul state select, which emits neither op. _int4_gpu is that export: litert-torch 0.9.3 + litert-converter 0.3.1, the same int4 recipe and the same weights as the int4 file, plus the executor-metadata section litert-lm β₯ 0.15 needs. It delegates fully on Android OpenCL β 501/501 and 519/519 nodes, zero rejected ops β and runs on the macOS GPU backend. Quality is unchanged: run head to head against the int4 file on identical prompts, decoding and scoring, both score 38/50 on GSM8K (CPU, n=50), and the GPU file passes an 8-question check on both backends.
The _v0200 files were 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 (linears and embedding int8, convs float because they are operands of the ShortConv composite). int4: the int4 recipe of LFM2.5-1.2B-Instruct_int4.litertlm, with the block scales floored at 2^-14. Both have a 4096-token KV cache and prefill signatures from 1 to 1024 tokens. Their LLM metadata (chat template included) and tokenizer sections are byte-identical to those of the files without _v0200.
Raspberry Pi 5 (CPU)
Measured on a Raspberry Pi 5 Model B Rev 1.1 (8 GB, Raspberry Pi OS 64-bit) with litert-lm benchmark 0.16.1: CPU backend, 4 threads, 256 prefill + 256 decode tokens, --cache memory (the compile cache lives and dies with the process, so every invocation compiles the model from scratch; nothing is reused between runs), one warm-up plus one timed iteration per invocation, 3 invocations per file with cooldown in between. Values are the median across invocations (minβmax in parentheses). No thermal throttling occurred during these runs (vcgencmd get_throttled stayed 0x0). Every file listed produced coherent text in a real generation on this backend before its numbers were recorded.
| File | Prefill (tok/s) | Decode (tok/s) | TTFT | Peak RSS |
|---|---|---|---|---|
LFM2.5-1.2B-Instruct_int4.litertlm |
54.1 (53.7β54.2) | 9.3 (9.3β9.3) | 4.8 s | 1.4 GB |
LFM2.5-1.2B-Instruct_int4_gpu.litertlm |
54.6 (53.5β54.6) | 9.3 (9.3β9.3) | 4.8 s | 1.4 GB |
LFM2.5-1.2B-Instruct_int8.litertlm |
75.0 (74.5β75.7) | 7.0 (7.0β7.1) | 3.6 s | 1.9 GB |
Known runtime issues
The Mac GPU's default path broke another model's long code. By default, LiteRT-LM's GPU sampler, when it can, also writes the next step's decode inputs. The log line Sampler will handle decode input tensors. marks that path. With litert-lm 0.19.0 from PyPI, which runs that path on a Mac GPU (WebGPU), long greedy replies of Qwen3.5-4B-3D-Coder, a 4B code model, had syntax errors in their code: 6 of 10 replies with its earlier 32K file and all 3 with its earlier 16K file. With the C++ CLI litert_lm_advanced_main, built from the LiteRT-LM source, and its flag --sampler_handles_input=false, none of each file's 7 replies had a syntax error. The Python, Kotlin and Swift APIs of 0.19.0 and 0.20.0 have no such setting. Long replies of this repo's files were not checked this way.
<|pad|> in a prompt. _int4_gpu and the two _v0200 files read token id 0 (<|pad|>) as padding in their prefill signatures of 2 to 1024 tokens: at that token, the short-convolution layers get a zero input. _int4 and _int8 have no token-id mask. This was read from these files' graphs on 2026-11-25 and 2026-11-30.
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.
On the iPhone the Metal GPU can still fail to create the _int4_gpu file's engine, on LiteRT-LM v0.18.0 too. On an iPhone 17 Pro with v0.18.0 on 2026-10-19, a test app's chat launches at maxNumTokens 672 failed at engine creation, 2 of 2: a generated Metal kernel did not compile (implicit conversions between vector types), then Failed to modify graph with delegate. About two minutes later, on the same phone and app build, benchmark() at a context of 2048 ran on the GPU, 4 of 4 (1024 prefill tokens at 2,194β2,280 tok/s, 256 decode tokens at 70.3β74.4 tok/s). Those launches differ in the context and in the API; which of the two decides was not checked, and maxNumTokens 1024 (GPU β iPhone 17 Pro, above) was not run on v0.18.0.
Structured output: LFM2.5-1.2B-Instruct_int4.litertlm does not take a JSON ResponseFormat. It carries llm_model_type lfm2, and LiteRT-LM refuses constrained decoding for that type when the conversation is created (Constrained decoding is not supported for Lfm2DataProcessor.; measured with litert-lm 0.16.0 and 0.19.1 on a Mac CPU). The other files here were not run with constrained decoding.
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 above US$10M annual revenue. Changes from the original work: weights converted from safetensors bf16 to LiteRT flatbuffers and quantized as described above; tokenizer repackaged unmodified into the .litertlm file; chat template changed to accept the 0.18 content-parts form of a message and to take its tool-call and tool-result rendering from LiteRT-LM's lfm2 template; exporter conv-state fix as described in Conversion notes; the _v0200 files exported with litert-torch's GPU composites. This repository is a community conversion and is not affiliated with Liquid AI.
- Downloads last month
- 4,513
Model tree for litert-community/LFM2.5-1.2B-Instruct
Base model
LiquidAI/LFM2.5-1.2B-Base