# 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: tutorial

Language: en

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

Topics: [lora](<https://devfeed.tech/topics/lora.md>), [gemma](<https://devfeed.tech/topics/gemma.md>), [Fine-tuning](<https://devfeed.tech/topics/fine-tuning.md>), [On-device AI](<https://devfeed.tech/topics/on-device-ai.md>), [Enhancing AI model performance](<https://devfeed.tech/topics/enhancing-ai-model-performance.md>), [ai-experiments](<https://devfeed.tech/topics/ai-experiments.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [app](<https://devfeed.tech/tags/app.md>), [basketball](<https://devfeed.tech/tags/basketball.md>), [behaviour](<https://devfeed.tech/tags/behaviour.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [clip](<https://devfeed.tech/tags/clip.md>), [coaching](<https://devfeed.tech/tags/coaching.md>), [data-quality](<https://devfeed.tech/tags/data-quality.md>), [device](<https://devfeed.tech/tags/device.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [experiments](<https://devfeed.tech/tags/experiments.md>), [fine-tuning](<https://devfeed.tech/tags/fine-tuning.md>), [gemma](<https://devfeed.tech/tags/gemma.md>), [gemma-4](<https://devfeed.tech/tags/gemma-4.md>), [lora](<https://devfeed.tech/tags/lora.md>), [measurements](<https://devfeed.tech/tags/measurements.md>), [on-device](<https://devfeed.tech/tags/on-device.md>)

## AI overview

FormAI's prototype explores moving sports-form coaching from Gemini's cloud API to on-device inference by fine-tuning Gemma 4 E4B (4.5B effective parameters) with LoRA. It uses Gemini as a teacher on rights-cleared Pexels golf clips, filters clips that cannot support a critique, extracts still frames for training, then merges, quantizes, and converts the model to LiteRT-LM for Android. The excerpt reports that a close-up clip showing only the ball and club impact produced a cautious refusal to assess stance, grip, or swing arc; it identifies such responses as a data-quality concern. This is an AI-generated account of a prototype, and the excerpt does not provide training results or evidence of deployed on-device coaching.

## 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.