litetune fine-tunes a small language model, converts it into a file that runs through LiteRT-LM on supported native devices — phone, desktop, embedded board, robot — and checks that the converted model still does the job.
Supported runtimes
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: 12 language models and 1 embedding model, each converted and compared with its float reference on held-out data.
Supported formats
Where to run it
What it does
How to fine-tune a model for LiteRT-LM
The README's example, prepare → tune → convert → verify: FunctionGemma 270M fine-tuned with LoRA (leave out --method for a full fine-tune, the default), converted to .litertlm with two quantization recipes, and compared with the float model on the held-out split.
# 1. Validate and split the data. Seconds.
litetune prepare --data raw.jsonl --output-dir data --context-length 1024 \
--tokenizer google/functiongemma-270m-it
# 2. Fine-tune. Chooses CUDA, then MPS on a Mac, then CPU.
litetune tune --model google/functiongemma-270m-it --data data/train.jsonl \
--output-dir tuned --method lora --prompt-mode prerendered
# 3. Convert, sweeping recipes rather than trusting a default.
litetune convert --model tuned/model --output-dir artifacts \
--recipe dynamic_wi8_afp32 --recipe weight_only_wi8_afp32
# 4. Compare the converted model with its float twin.
litetune verify --model artifacts/weight_only_wi8_afp32/<name>.litertlm \
--reference tuned/model --data data/heldout.jsonl \
--json > manifest.json