# Fine-Tuning Small Models for On-Device Agents: Train, Convert, and Measure What Changed

DevFeed: [Fine-Tuning Small Models for On-Device Agents: Train, Convert, and Measure What Changed](<https://devfeed.tech/articles/fine-tuning-small-models-for-on-device-agents-train-convert-and-measure-what-changed-65297.md>)

Original publisher: [Read original article](<https://medium.com/google-developer-experts/fine-tuning-small-models-for-on-device-agents-train-convert-and-measure-what-changed-f7f494a044f3?source=rss----a67bd6fa7d58---4>)

Author: Sasha Denisov

Published: 2026-10-06T07:20:54Z

Content type: tutorial

Language: en

Sources: [Google Developer Experts](<https://devfeed.tech/sources/google-developer-experts-medium.md>)

Topics: [peft](<https://devfeed.tech/topics/peft.md>), [lora](<https://devfeed.tech/topics/lora.md>), [LiteRT](<https://devfeed.tech/topics/litert.md>), [Fine-tuning](<https://devfeed.tech/topics/fine-tuning.md>), [ML model versioning](<https://devfeed.tech/topics/ml-model-versioning.md>), [Deployment Strategies](<https://devfeed.tech/topics/deployment-strategies.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-on-device](<https://devfeed.tech/tags/ai-on-device.md>), [apache](<https://devfeed.tech/tags/apache.md>), [build](<https://devfeed.tech/tags/build.md>), [data](<https://devfeed.tech/tags/data.md>), [dataset](<https://devfeed.tech/tags/dataset.md>), [edge](<https://devfeed.tech/tags/edge.md>), [edge-ai](<https://devfeed.tech/tags/edge-ai.md>), [fine-tuning](<https://devfeed.tech/tags/fine-tuning.md>), [hugging-face](<https://devfeed.tech/tags/hugging-face.md>), [inference](<https://devfeed.tech/tags/inference.md>), [litert](<https://devfeed.tech/tags/litert.md>), [lora](<https://devfeed.tech/tags/lora.md>), [mediapipe](<https://devfeed.tech/tags/mediapipe.md>), [model](<https://devfeed.tech/tags/model.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [trl](<https://devfeed.tech/tags/trl.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

The article presents litetune, an open-source command-line workflow for fine-tuning small models with LoRA, converting them to LiteRT-LM, and verifying converted artifacts against float models on held-out data. In the reported tests, eight-bit conversions stayed close to float on the measured workloads, while four-bit results varied by model and recipe and could show substantial quality losses. The author emphasizes testing the converted artifact and measuring performance on its target device.

## Source excerpt

How litetune rebuilds the LoRA-to-device workflow and measures the model that actually ships. In February 2025, I published a ten-step guide to fine-tuning Gemma with LoRA in Colab, converting the model, and running it on a phone. I build Flutter Edge AI (formerly flutter_gemma), a plugin for running these models directly on the device, so fine-tuning was the natural next step. Today, following that guide step by step no longer works. I first tried to update it, but replacing one stage led to another. LoRA was the only part that stayed the same. So this is not a patched version of the old tutorial. It is a new workflow, with one stage the original did not have: verifying the converted model on held-out data. What Changed in the Workflow The old guide was built around the first Gemma models -- 2B and 7B -- and MediaPipe for on-device inference. The entire path from training to a MediaPipe-ready artifact fit inside a single Colab notebook. Today, its parts are spread across Hugging Face, TRL, litert-converter, and LiteRT-LM. They have different dependencies, and export settings vary by model architecture. LoRA training itself still looks familiar -- the complexity now sits around it. Before training, you need to validate the data and create and record a held-out split. After training, you need to merge the adapter, select the export settings, build a .litertlm file, run it through LiteRT-LM, and compare its outputs with the original model. A working checkpoint does not guarantee that the final artifact will behave the same way. When it became clear that the old notebook could not simply be updated, I decided to put the modern workflow into one tool. That is how litetune started: an open-source command-line tool, released under Apache 2.0, that takes a dataset all the way to a verified .litertlm. Its job is to remove the handwritten glue code between a dataset and a model that an application can run. Instead of maintaining separate scripts for data preparation, LoRA train