Views
No views yet
.litertlm) format for on-device inference with
Google's LiteRT-LM runtime (the
engine behind the official litert-community/* models).| File | model.litertlm (~1.9 GB) |
| Quantization | int4 weights — blockwise (block 32) + OCTAV optimal-clipping, symmetric; embedding INT8 |
| Compute | integer |
| Context (KV cache) | 4096 |
| Base model | HuggingFaceTB/SmolLM3-3B |
| Decode speed | ~22.5 tok/s (iPhone 17 Pro, Metal GPU; loads 7.7 s, ~1.24 GB footprint) · ~93 tok/s (Mac M-series, LiteRT-LM, Metal GPU, greedy) |
1# build litert-lm from https://github.com/google-ai-edge/litert-lm, then:
2litert_lm_main \
3 --model_path model.litertlm \
4 --backend gpu \
5 --input_prompt "Explain on-device AI in one sentence.".litertlm bundle carries the tokenizer and the prompt template (ChatML —
<|im_start|>role / <|im_end|>, stop token <|im_end|>), so no separate
tokenizer files are needed.Update (July 2026): Google AI Edge Gallery v1.0.16+ can import litert-lm models directly from Hugging Face inside the app (tap +) — no computer oradbneeded. The manual steps below are only required on older builds or for sideloading a local file.
.litertlm models fully on-device and can import your own:com.google.ai.edge.gallery, APK from the repo's
releases — 1.0.15+ supports
.litertlm). Older 1.0.x builds (package com.google.aiedge.gallery) only accept the
legacy MediaPipe .task format and reject .litertlm.model.litertlm from this repo and push it to the device:
adb push model.litertlm /sdcard/Download/.litertlm bundle already carries the
tokenizer and ChatML prompt template.com.google.ai.edge.litertlm:litertlm-android,
getting started)..litertlm bundle runs on macOS / Linux / Windows with the official
LiteRT-LM CLI — including as a
local OpenAI-compatible API server:1pip install litert-lm
2litert-lm import --from-huggingface-repo mlboydaisuke/SmolLM3-3B-LiteRT model.litertlm smollm3-3b-litert
3litert-lm run smollm3-3b-litert # interactive chat in the terminal
4litert-lm serve # local OpenAI-compatible API server#### <n>,
identical prompt and answer-extraction for both rows — only the quantization differs).| Configuration | GSM8K |
|---|---|
| bf16 (reference) | 81.0% |
| This model — LiteRT int4 (BOCTAV4) | 81.0% |
<|im_end|> (no rambling).litert-torch via its
generic export_hf path. SmolLM3ForCausalLM rides the existing converter with no
custom code: the NoPE attention schedule (rotary disabled on every 4th layer,
no_rope_layer_interval=4) lowers to generic ops with no custom kernel. The int4
recipe is blockwise (block 32) + OCTAV optimal-clipping with the embedding kept
at INT8; the embedding is externalized into its own bundle section so the main
weights section stays under the iOS ~2 GiB single-mmap limit. Blockwise (not
channelwise) int4 plus OCTAV is what holds reasoning accuracy at parity.