litetune fine-tunes a small language model, converts it into a file that runs wherever your app does — phone, desktop, embedded board, robot — and checks that the converted model still does the job.
Supported runtimes
LiteRT-LM
Google's on-device LLM runtime
$pip install litetune
$
brew install DenisovAV/tap/litetune
Why it exists
Converting a model so it fits on a device changes it. The file still loads, the tools still report success, and the model can still be worse at your task than it was before. litetune runs the converted model on data it was never trained on, compares it with the version it came from, and tells you the difference.
Measured end to end so far
FunctionGemma 270M
tool-call scoring, 640 held-out rows
Also run on a Snapdragon Galaxy S24.
Gemma 3 270M
exact-text scoring, 600 held-out rows
verify refused to score the untuned base at all.
Both on CPU. Conversion cost came out small on both, and at these sample sizes the method is near its limit. The numbers, and what they do not establish
Supported formats
Output
.litertlm — the format LiteRT-LM loads
Platforms
Android, iOS, macOS, Linux and Windows natively
— web runs as a text-only preview with no function calling and no LoRA, so a tuned tool-calling model is native-only for now
Acceleration
CPU everywhere; GPU through OpenCL, Metal, Vulkan or DirectX 12; NPU on Snapdragon and Intel
— litetune measures on CPU, except training and the float reference, which use a GPU when the host has one; every result records which backend produced it, or records it as unknown
Models
Gemma 3 (text), Gemma 4 E2B/E4B, Qwen3.5, FunctionGemma
— measured end to end on FunctionGemma and Gemma 3 270M so far
Where to run it
flutter_gemma
A Flutter plugin that runs .litertlm through the LiteRT-LM C API on five native platforms and a web preview. The same package also does embeddings and RAG.
Google AI Edge Gallery
Google's Android app for running local models on the device. Side-load the file to try it without writing an app first.
What it does
prepare
splits your data and drops the rows it cannot score
tune
fine-tunes it, with the settings the export step will need
convert
turns the result into the file the phone runtime loads
verify
compares that file with the model it came from
bundle
packages it together with what the comparison found