# Engineering log: fine-tuning Gemma 4 E4B with LoRA to bring FormAI's coaching on-device

DevFeed: [Engineering log: fine-tuning Gemma 4 E4B with LoRA to bring FormAI's coaching on-device](<https://devfeed.tech/articles/engineering-log-fine-tuning-gemma-4-e4b-with-lora-to-bring-formai-s-coaching-on-device-25192.md>)

Original publisher: [Read original article](<https://johnoreilly.dev/posts/formai-gemma4-lora/>)

Published: 2026-08-28T23:00:00Z

Content type: article

Language: en

Sources: [John O'Reilly](<https://devfeed.tech/sources/john-o-reilly.md>)

Topics: [gemma4](<https://devfeed.tech/topics/gemma4.md>), [Fine-tuning](<https://devfeed.tech/topics/fine-tuning.md>), [lora](<https://devfeed.tech/topics/lora.md>), [On-device AI](<https://devfeed.tech/topics/on-device-ai.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [LiteRT](<https://devfeed.tech/topics/litert.md>), [Android](<https://devfeed.tech/topics/android.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [data](<https://devfeed.tech/tags/data.md>), [data-quality](<https://devfeed.tech/tags/data-quality.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [fine-tuning](<https://devfeed.tech/tags/fine-tuning.md>), [gemini](<https://devfeed.tech/tags/gemini.md>), [gemma](<https://devfeed.tech/tags/gemma.md>), [gemma-4](<https://devfeed.tech/tags/gemma-4.md>), [inference](<https://devfeed.tech/tags/inference.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [litert](<https://devfeed.tech/tags/litert.md>), [lora](<https://devfeed.tech/tags/lora.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [on-device](<https://devfeed.tech/tags/on-device.md>)

## AI overview

This engineering log describes a prototype that distils FormAI's Gemini-based sports coaching feedback into Gemma 4 E4B fine-tuned with LoRA. The local pipeline uses seed videos, filters inadequate critiques, extracts frames, trains and merges the adapter, then converts the model to LiteRT-LM for possible on-device Android inference.

## Source excerpt

⚠ Note: this post is AI-generated. The text below was written by Claude, and documents findings from a series of Claude Code sessions working on this project -- the experiments, bugs and measurements described are ones that came out of those sessions. The engineering work is real and the numbers were measured rather than estimated, but the write-up is the model's own account of what it did, not a human's independent retelling of it.