Palahepitiya Gamage Amila · Weekly Learnings
Testing cheaper AI models for coding agents: check the route, not just the model
· Palahepitiya Gamage Amila

The short answer. A cheaper AI model can do real coding agent work, but you only learn that by testing it on your own tasks through the exact service you'll pay for. When I tried this in late October, the failures I saw came from the middleman service, not the model, and I couldn't find out where that service would store my prompts.
Some context. I run AI agents across a few companies, and the model bill grows with every agent I add. So I wanted to know whether cheaper models would hold up in the setup I already use. I didn't go to the model makers directly. I went through a middleman, a routing service that sells access to many models from one account.
How did I test cheaper models with my coding agent?
I pointed my coding agent at the cheaper models and ran the same kind of agent task through each one. Nothing clever. The same harness I use every day, the same sort of work, repeated enough times to see a pattern.
That last part matters. One good run tells you almost nothing. Agents fail in ways that only show up when you repeat the job.
What happened when I ran them?
The results split cleanly:
- One model came back clean on 21 out of 21 runs.
- Another got through only 6 of 10.
- The errors on that second model came from the middleman's side.
- The same model worked when I reached it through a different route.

Was the model the problem, or the service in the middle?
The service. If I had only looked at the 6 of 10, I would have written that model off. That would have been the wrong conclusion. The model was fine. The path to it wasn't.
This is easy to miss because the middleman is invisible when it works. You send a request, you get an answer, and you think of it as talking to the model. But every request goes through someone else's systems first, and those systems can fail on their own.
So a test of a cheaper model is really a test of two things at once: the model, and the route to it. If you only test one route, you can't tell which one let you down.
What couldn't I find on the service's site?
Two things.
The first was what it charges when the same context is sent again. That sounds like a detail, but it isn't for coding agents. They resend context all the time. If the service doesn't say how it prices that, you can't work out what the cheaper model will really cost you.
The second was where my prompts would be stored. Coding agent prompts carry code, and sometimes things worse than code, like keys or config. I couldn't find terms that told me which region the data would sit in or how it would be handled. Without that, I wasn't going to send it anything real.
Neither of these shows up in a quick test. The runs can all pass and you still won't know either answer.
How should you test a cheaper AI model before switching?
A short checklist, from what I'd do again:
- Run your own tasks, not a benchmark. Use the work your agents actually do.
- Run each task many times. Ten runs showed me a problem one run would have hidden.
- Test through the exact service you'll pay for, not a different one.
- If a model fails, try it through a second route before you blame the model.
- Find the price for resent context in writing.
- Find where your prompts are stored, and under what terms, before you send real code.
If you're thinking about moving to a cheaper model, test it on your own tasks through the exact service you'll pay for, and find out where it keeps your data before you send it anything real.
Questions this note answers
Are cheaper AI models good enough for coding agents?
Some are. In my test one cheaper model came back clean on 21 out of 21 runs. Whether one works for you depends on your own tasks, so test on those.
Why would a model fail through one service and work through another?
Because the service in the middle has its own systems that can fail. One model got through only 6 of 10 runs with errors on the middleman's side, then worked when I reached it through a different route.
Why does pricing for resent context matter for coding agents?
Coding agents resend the same context over and over, so most of what you pay for can be repeated input. If a service doesn't publish how it prices that, you can't work out your real cost.
What should you check about data before using a model routing service?
Where your prompts are stored and under what terms. I couldn't find either on the service I tested, so I didn't send it anything real.