Instructions to use litert-community/LFM2.5-1.2B-JP 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-JP 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 litert-lm run \ --from-huggingface-repo=litert-community/LFM2.5-1.2B-JP \ --prompt="Write me a poem"
- LiteRT
How to use litert-community/LFM2.5-1.2B-JP 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
LFM2.5-1.2B-JP โ LiteRT-LM
LiquidAI/LFM2.5-1.2B-JP converted to the LiteRT-LM (.litertlm) format for on-device inference with Google's LiteRT-LM runtime (requires litert-lm โฅ 0.14 / a recent AI Edge Gallery). Sibling of litert-community/LFM2.5-1.2B-Instruct.
Update (2026-08-04): the
.litertlmfiles were updated in place to add theExecutorMetadatasection that litert-lm โฅ 0.15 requires to bind the hybrid conv/attention state buffers (without it, 0.15 fails at inference withmissing some output TensorBuffers). Weights and graph are byte-identical to the original release, and the files continue to run on litert-lm 0.14.
LFM2.5-1.2B-JP is the Japanese-optimized chat variant of Liquid AI's hybrid conv-attention flagship โ a 1.2B model tuned for natural Japanese conversation that runs fully on-device at ~100 tok/s on a laptop CPU.
ๆฅๆฌ่ชใซๆ้ฉๅใใใ 1.2B ใชใณใใใคในใขใใซใงใใ ในใใใฎ CPU ใ ใใงๅไฝใใใใใๆฅ็ถใชใใง่ช็ถใชๆฅๆฌ่ชใใฃใใใใงใใพใใAI Edge Gallery ใซใคใณใใผใใใใ ใใง่ฉฆใใพใใ
| File | Recipe | Size | GSM8K (n=100) |
|---|---|---|---|
LFM2.5-1.2B-JP_int8.litertlm |
int8 dynamic (linears + embedding; convs float) | 1.24 GB | 65% (bf16 reference: 63%) |
LFM2.5-1.2B-JP_int4.litertlm |
int4 blockwise-32 + OCTAV linears, int8 embedding, convs float | 736 MB | 55% |
LFM2.5-1.2B-JP_int4_gpu.litertlm |
same int4 recipe, re-exported so it runs on the GPU | 736 MB | = int4 (see notes) |
| Context (KV cache) | 4096 max |
| Backend | CPU for every file; the _int4_gpu file also runs on the GPU with litert-lm โฅ 0.16.0 (Android OpenCL and macOS โ verified by generation, not just by a benchmark table; iOS Metal still fails at engine creation, tracked upstream in LiteRT-LM#3129) |
| Template | bundled โ full chat template (tool-calling supported) |
| Base model | LiquidAI/LFM2.5-1.2B-JP (LFM Open License v1.0) |
Accuracy
GSM8K (English, greedy, 0-shot CoT, max-tokens 1024, n=100, same harness for all rows): PyTorch bf16 63% ยท LiteRT int8 65% (full parity, +2pt within noise) ยท int4 55%. English math undersells a Japanese-optimized tune โ it is reported for quantization-fidelity transparency, not as this model's headline; both files pass an 8-question sanity gate (7/8, zero degenerate) and Japanese conversation quality was verified by inspection. Note the int8 file quantizes linears only (convs stay float): quantizing this tune's convs costs ~9pt, unlike the Instruct sibling where conv-int8 is free.
Usage
litert-lm run ./LFM2.5-1.2B-JP_int8.litertlm --prompt "ๆตทใซใคใใฆไธๆใงๆธใใฆใใ ใใใ"
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) | 190โ194 tok/s | 19.8โ21.2 tok/s | 1.40โ1.44 s |
| CPU | 35โ60 tok/s | 13.2โ20.0 tok/s | 4.4โ7.5 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 | 3682 tok/s | 316.0 tok/s | 0.07 s |
| CPU | 334.6 tok/s | 80.3 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.
Run on Android
Install a recent Google AI Edge Gallery, import this repo (or adb push a file and use local import: menu โ Models โ โ+โ โ From local model file), select the CPU backend, and chat โ in Japanese. GPU acceleration needs the _int4_gpu file and litert-lm โฅ 0.16.0; the Gallery bundles its own runtime, which may lag that version โ if its GPU toggle fails there, use CPU.
Performance
litert-lm benchmark (litert-lm 0.15.0) on an Apple M4 Max, CPU backend, -p 256 -d 256 --runs 3 (the tool averages three iterations), warm-up run discarded, otherwise idle machine. Decode on this family depends strongly on the KV budget, so both settings are listed:
| Variant | --max-num-tokens |
Prefill (256) | Decode | TTFT |
|---|---|---|---|---|
| int8 | 1024 | 1526 tok/s | 98.5 tok/s | 0.18 s |
| int4 | 1024 | 387 tok/s | 119.0 tok/s | 0.67 s |
| int8 | 4096 | 1071 tok/s | 82.5 tok/s | 0.25 s |
| int4 | 4096 | 340 tok/s | 79.3 tok/s | 0.76 s |
Set --max-num-tokens to the smallest value your use case needs โ 1024 is a good chat default, and the file allows up to 4096. At 1024 the int4 file decodes fastest; at 4096 the two variants converge.
Use the CPU backend โ this bundle cannot create a GPU engine. It comes from the pre-0.9.2 ShortConv export generation, whose prefill graph still carries INT64 ADD/CAST inside Lfm2ShortConv, plus GATHER_ND and a GREATER_EQUAL with const inputs. The GPU delegate takes 536 of the 579 operations and leaves 43 on the CPU, and the runtime then refuses the partial split: Hint fully delegated to single delegate is set, but the graph is not fully delegated. Re-exporting from the post-0.9.2 lineage removes those INT64 ops and does run fully delegated on the macOS GPU; the remaining iOS Metal failure is tracked upstream in LiteRT-LM#3129.
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 about 1.7ร faster as well as 41% smaller, so prefer int4 on mid-range devices. Those Android figures are single ship-gate runs, not medians. First device load compiles the graph and can take about a minute; later loads are instant.
Conversion notes
Converted with released litert-torch 0.9.1 with the same exporter fix as the Instruct sibling: the stock LFM2 short-conv block saves its conv state from padded prefill columns, corrupting the first generated token of nearly every reply; the fix derives the chunk's valid length from the attention mask in-graph and gathers the state from the last valid columns (verified token-identical to an exact per-token reference loop). Multi-length prefill signatures (1โ1024). Quantization: export-time int8 including convs, or post-hoc int4 on linears only โ post-hoc conv quantization breaks generation.
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 published 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 sanity gate on both backends. The CPU-only files are left exactly as they are rather than replaced, so nothing changes for anyone already using them.
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 and chat template repackaged unmodified; exporter conv-state fix as described in Conversion notes. This repository is a community conversion and is not affiliated with Liquid AI.
- Downloads last month
- 252