r/ChatGPTCoding • • 2d ago

Resources And Tips I measured cost per finished coding task instead of per token. Cheap models still won, but not the way I expected

I ran 4 real tasks on a small Node app (a bug fix, input validation, duration parsing, a dark mode toggle). Each one is checked by hidden tests, so "done" means the tests pass, not "the model said it's done."

Two setups:

  • Claude Sonnet on every step
  • A cheap coding model on every step, handing off to a strong model only after 3 failed attempts

Results:

  • Bug fix: $0.104 vs $0.003
  • Input validation: $0.094 vs $0.013
  • Duration parsing: $0.114 vs $0.009
  • Dark mode: $0.158 vs $0.006
  • Total: $0.469 vs $0.031. Every task passed in both setups.

What surprised me:

  • The cheap model took more steps: up to 13, where Sonnet took 5–8. It also needed a few recoveries.
  • It still won on price because each step costs a tiny fraction of a Sonnet call.
  • The handoff rule matters most. Without a cap, cheap models can spin forever and eat the savings.

Most agent steps are reading files and small edits. Paying frontier prices for those is where the usage limits go.

Happy to share the tasks and raw numbers if anyone wants to check them.

12 Upvotes

30 comments sorted by

2

u/SilencedObserver 1d ago

Can you be more descriptive about what you mean when you say cheap models?

Are these local models on local hardware or models via hugging face or what?

1

u/ActuatorGlittering94 1d ago

if it was local hardware how would they even price a single bug fix at $0.003

1

u/SilencedObserver 1d ago

Since people have hardware regardless of inferencing so running models it’s possible.

0

u/Jumpy_Invite_7473 1d ago

These are models like Qwen3 Coder or Gemini Flash and these are provided via puffin coder itself not local hosting.

1

u/SilencedObserver 1d ago

Thank you.😊

1

u/Best_Researcher491 2d ago

I added the four rows in your post. The cheap path is $0.031 against $0.469, which is 6.6% of the Sonnet total.

The gap is not even across tasks. Input validation is $0.094 vs $0.013 (7.2x). Duration parsing is $0.114 vs $0.009 (12.7x). Dark mode is $0.158 vs $0.006 (26.3x). The bug fix is $0.104 vs $0.003 (34.7x). Extra steps ate most of the savings on validation, and almost none on the bug fix.

1

u/Jumpy_Invite_7473 2d ago

Good breakdown, and you're right about the cause. I split it per step:

  • Cost per step is fairly stable: the cheap model runs about 18–32x cheaper than Sonnet on every task.
  • Step count is what swings the total. On validation the cheap model took 13 steps vs Sonnet's 5, which pulled a ~18x per-step advantage down to 7.2x overall. On the bug fix it actually took one fewer step (5 vs 6), so the advantage grew to 34.7x.

One correction to my own post: recoveries were about even (4 for the cheap model, 5 for Sonnet). The real cost is extra steps, not extra failures.

So the lever isn't model price, it's keeping the cheap model from wandering. That's why I cap attempts and hand off to the strong model after 3 failures. Validation is the case where that cap matters most.

1

u/Best_Researcher491 1d ago

That correction changes the read. I had the validation gap as extra failures, but 4 recoveries against Sonnet's 5 means the cheap run mostly just kept going: 13 steps to 5. A handoff after 3 failures would have cut it while the per-step gap was still near 18x, before that diluted to 7.2x. The bug fix never reaches the cap, 5 steps against 6, so the 34.7x still stands on its own.

1

u/xapep 21h ago

Your cap counts attempts, and validation blew the budget inside one of them. 13 steps against Sonnet's 5 with recoveries roughly even, so that's most of the extra spend happening in a single pass that never reached a handoff.

A step or token ceiling per attempt is the number that binds. The other half is input: retries re-read the same files, and resuming the session keeps the prefix cached instead of paying for it twice.

I work on PAYG inference at Entrim, so I read this from the bill side.

2

u/VridhiMehta 1d ago

the 'done means tests pass' framing is what makes this measurement mean anything. most cost comparisons stop at tokens, which quietly rewards models that give up early. the 13 steps vs 5-8 is the real tradeoff though - cheap wins on price, you pay in wall time and babysitting recoveries

2

u/kaijurules 1d ago

Looks like the handoff never fired in these four runs. Sonnet took 5 steps and $0.094 on validation, so about $0.019 a step, and your most expensive cheap run was $0.013 in total. One Sonnet step would have cost more than that.

So the numbers show the cheap model alone can do these tasks. They don't say anything yet about the 3-attempt rule, you'd need a task it fails to see what the escalation costs.

3

u/timelinextreme 1d ago

I'm a bit confused. This is a chatgpt forum that you came to post about a Claude model vs an undesclosed cheap model?

1

u/Kooky-Treat-4416 2d ago

yeah measuring done-when-tests-pass is more honest than token price. cheap models still win for me, but only if i cap the retries and hand off after a few fails, otherwise they just burn the savings on longer loops.

1

u/hieuphung97 1d ago

The 3-attempt handoff rule is the key insight here. Without hard ceilings on mechanical exploration, small models burn their entire cost advantage thrashing on bad AST diffs before ever asking a frontier model for help.

1

u/uselesslogin 1d ago

How does the handoff work?

1

u/magicdoorai 1d ago

Checking against hidden tests is the right yardstick. Before I'd trust the 15x gap, two things:

  1. Is each task a single run? Agents are non-deterministic, so one run per task can flatter either setup. Run each task 5 or so times per setup and report pass rate plus the cost range, not one number. A cheap model that passes 4 of 5 and then escalates changes the average a lot.
  2. Is the cost counted per step from the actual usage fields? Agent loops resend the whole history every step, so the bill is mostly input tokens, and cached input is much cheaper than fresh input. Anthropic's prompt caching docs list cache reads at 10% of base input price by default (lower on some models), with a 5 minute default lifetime. Writing a cache costs 125% of base input for the 5 minute TTL. That matters for your handoff: when the strong model takes over after 3 failed attempts, it has to read the whole accumulated context cold, and that bill belongs to the cheap path too. The same goes for the tokens spent on the 3 failed attempts.

If both setups already include all of that, the result is a lot more convincing. I'd also try handing off on a signal other than a failure count, for example tests still failing after N steps with no change in the diff, since 13 steps of thrashing is where your savings go.

1

u/notarshzzz 1d ago

i do basically the same split, cheap model for the boring reading and tiny edits, strong one only when it gets stuck. the amount of money i used to burn letting the expensive one do file reads was silly lol

1

u/adlx 1d ago

Have you tried Opus with all the tasks at once? Instead of one task for each model (eating up context for each task instead of one single session with opus).

1

u/ThisGermanEngineer 1d ago

Good idea! Did you run the same tasks several times or just once each? Would be interesting to see for the same run how much it might differ.

1

u/Difficult_Duty2198 1d ago

did the 6.6% figure count the time you spent reviewing the cheap model's output? curious if the gap holds once you include that.

1

u/tanyadev4827 1d ago

The step count vs. per-step cost distinction is the right frame. A cheap model running 13 steps at 1/18th the per-step cost of Sonnet still wins, but only if the step count is bounded. Without the handoff cap, a model that gets confused and keeps reading the same files repeatedly will burn through the savings quickly on longer tasks. The other thing worth tracking is what kind of steps inflate the count: file reads and routine confirmation calls are almost always cheaper to tolerate than extra planning steps, so a model that adds 5 redundant verification steps is a very different problem from one adding 5 extra reasoning steps. If you share the raw step logs, the breakdown by step type would probably show you which task types the cheap model stays cheap on and which ones it does not.

1

u/nur_plano 1d ago

Love that "done" = hidden tests pass, not "model said done". That's the only metric that matters.

One variant worth measuring: cheap model writes, a different strong model only reviews (with the test/lint commands it ran as proof) instead of taking over after 3 failures. In my experience the reviewer catches the "passes tests but wrong approach" cases earlier and costs far fewer tokens than a full handoff. Would be curious if your numbers agree.

1

u/Ctznsvn7 1d ago

The handoff cap is the real finding here innit? Without it the cheap model's step count blows up and the savings vanish fast. Would love to see the same test on a messier task, like a refactor across 10+ files where reading context dominates. That's where cheap models usually lose the plot and the escalations start piling up. Please do share the raw numbers, especially how many tasks hit the 3 attempt handoff, curious