Why Gemma-4-31B is a gem for PLC logic — and why I couldn't ship it
Relay, the AI assistant inside Rungs Studio, runs on Google's Gemini-3-Flash. It's currently free, I want to keep it free, and every message sent costs me about a cent. That sounds trivial until you multiply it by a user base that keeps growing — so I went looking for a model that was just as good at PLC code but cheaper to run.
Relay is a tutor — it won't write a student's program for them, it nudges one step at a time. So why benchmark raw code generation at all? Because of a failure mode I kept watching. When a student is stuck on an exercise, Relay sometimes reasons its way to a wrong first answer and only corrects itself a few turns later, once the compiler and the unit tests push back. For a patient student that detour can build real understanding. More often it misleads and wears them out. The fix is a model good enough to one-shot the solution to every exercise on learn.rungs.dev — because one-shotting is the closest proxy I have for actually understands the problem, and a model that understands the problem is far less likely to walk a student into a wall. So I benchmarked models on three things: tutoring conversations, generating Structured Text, and generating Ladder Logic.
What I found was a model that writes Ladder Logic as well as Gemini for roughly a tenth of the price. And then I couldn't use it. This is the story of both halves.
