How to tell whether a cheaper coding model actually saves money

Use inference spend, retries and maintainer time to compare coding models on a patch that has to pass tests and review.
Count the work that reaches review
AWS made Amazon Ergo available on Bedrock on 1 December 2026. It is an open-weight model aimed at software engineering and workflows where the model takes several steps to finish a task.
A token price helps you estimate the invoice for a single call. A coding task can involve several calls, a rejected patch and another attempt. The change eventually needs a maintainer who can explain why it works and decide whether it can merge.
I recommend tracking two figures side by side. Divide all inference spend by the number of tasks accepted as submitted, including spend on failed attempts in the numerator. Then add human screening and review time at a stated hourly rate and divide again. Report the share of assigned tasks accepted as submitted beside both figures. Record any patch that needs human edits as repair-assisted and track its repair time separately. When zero tasks are accepted, say so and report total spend. There is no cost per accepted task to calculate.
Replay a real fix on a frozen checkout
CPython’s pathlib treated a trailing dot as if there were no suffix. A public fix for Python 3.14 made a lone dot a valid suffix and updated the methods that split or replace suffixes.
Use the linked CPython checkout immediately before the fix. Give both models the same brief. Treat a trailing dot as a single-dot suffix on a regular filename, apply the rule consistently when splitting or replacing suffixes, and preserve the behavior of ordinary names and dotfiles. Ask for a regression check that fails on the starting revision and passes on the proposed patch.
On a POSIX host with the CPython build tools installed, run ./configure and make -j2 at the root of each checkout. Save the acceptance check below outside the candidate tree. Run ./python /absolute/path/to/check_suffix.py from each checkout. Use ./python.exe in both commands if the build emits that name on a case-insensitive filesystem. Expect the starting checkout to fail and the patched checkout to pass. In the patched checkout, run ./python -m test test_pathlib. Update the old tests that explicitly expected lone-dot suffixes to be rejected and keep the unrelated cases.
Run the same acceptance checks on both candidates, alongside the repository’s existing checks. Keep the historical solution and evaluation checks outside the candidate worktrees. Exclude the Git history and remote access from the trial environment if the objective is to solve the issue from the starting files. A public historical patch is still a weak test of unseen work because it could have appeared in model training.
from pathlib import PurePosixPath, PureWindowsPath
for path_type in (PurePosixPath, PureWindowsPath):
archive = path_type("archive.tar.")
assert archive.suffix == "."
assert archive.suffixes == [".tar", "."]
assert archive.stem == "archive.tar"
assert archive.with_suffix(".zip") == path_type("archive.tar.zip")
assert path_type("archive.tar").with_suffix(".") == path_type("archive.")
assert path_type(".profile").suffix == ""
Put failed attempts and review time in the calculation
The costs and times below are invented to show the calculation. We did not run Ergo or a second model on this task, and the historical code change supplies a trial input rather than a model result.
In the fixture, model A spends eighteen cents on an accepted attempt and ten more on a rejected attempt. Model B spends seventy-two cents on its one accepted attempt. At a hypothetical sixty dollars per hour, eight minutes of review for A changes the result to $8.28 per accepted task. Three minutes for B puts it at $3.72.
The example counts review minutes once per model. The same calculation works over several tasks if the totals include the rejected work. Keep elapsed time in its own column. For example, an invented twelve-minute run for A and a seven-minute run for B would give the reader a time comparison alongside the dollar totals.
from decimal import Decimal
hourly_rate = Decimal("60")
runs = [
("A", [Decimal("0.18"), Decimal("0.10")], 8, 1),
("B", [Decimal("0.72")], 3, 1),
]
for name, attempt_costs, human_minutes, accepted_tasks in runs:
spend = sum(attempt_costs)
labor = hourly_rate * Decimal(human_minutes) / 60
if accepted_tasks == 0:
print(f"{name}: no accepted tasks; inference ${spend:.2f}; total ${spend + labor:.2f}")
continue
inference = spend / accepted_tasks
total = (spend + labor) / accepted_tasks
print(f"{name}: inference ${inference:.2f}; total ${total:.2f}")
Record enough to repeat the comparison
Give both candidates fresh copies of the same starting tree, the same prompt and tool permissions, and the same attempt and elapsed-time limits. Record the model and harness versions and the pricing date. Keep the scope fixed when retrying, and preserve the original patch even if a human repairs it.
Before running, define what interaction is allowed within the harness and keep human patch edits outside the as-submitted trial. For each task, record the time from the first request until submission of the accepted patch or exhaustion of the agreed budget. Include inference charges and screening or review minutes for every attempt. Record any later repair minutes and tool or compute charges separately. If possible, let the maintainer review a candidate without knowing which model produced it.
Use the result to decide what to test next. One path-handling fix can expose differences in test selection and review effort, but it says little about a model’s performance on a migration or a larger feature. Repeat the same measurement across the types of work the team actually assigns before changing its default model.

