Try Chat Free Docs Pricing AI Analysis Repo Insights Free Tools About Blog
Sign in Get started free
< Back to blog
Guide Velona Team ·19 October 2026 ·14 min read

How to Evaluate AI Coding Models on Your Own Code: Cost per Solved Task in ₹ (2026 Guide)

GUIDE · OCTOBER 2026 Evaluate coding models on your own code, and measure cost per solved task in ₹ 20 to 30 tasks, repeated runs, honest metrics tasks × runssuccess₹ / solvepassfail

The cheapest model per token is often not the cheapest model per finished task, and public leaderboards can no longer settle the question for you. In February 2026 OpenAI stopped reporting SWE-bench Verified after finding contamination and flawed tests. The same model can score differently on two identical runs. The reliable answer comes from a small private evaluation on your own code: 20 to 30 tasks with tests, a few runs each, and one number that matters for your budget, the rupee cost per solved task.

This guide shows how to set that up in an afternoon, what to log, how to compute the metrics, and how to read the results without fooling yourself. It works for comparing models, comparing agents, or testing whether routing cheap and strong models saves money without hurting quality.

Feb 2026

OpenAI stopped reporting SWE-bench Verified, citing contamination and flawed tests

up to 15%

accuracy variation across identical runs at temperature 0 in one study

<25%

pass^8 for GPT-4o on tau-bench retail: success on all 8 tries of the same task

Why public coding benchmarks are not enough in 2026

Leaderboards are still useful for a shortlist. They are a poor basis for spending decisions, for three reasons.

That is why our coding agents research overview warned against treating a benchmark score as proof a model will work on your codebase. A private eval fixes all three problems: the tasks are unseen, you choose the difficulty, and you see the bill.

The metrics that matter

Metrics

What to measure for each model or setup

Run every task the same number of times for every model.

MetricHow to compute itWhat it tells you
Success ratePassing runs ÷ all runsHow often the model gets it right on one try
pass^kShare of tasks solved on all k runsConsistency. A model you can trust to repeat
Median cost per taskMiddle value of ₹ spent per runTypical bill per attempt, ignoring outliers
Cost per solved taskTotal ₹ across all runs ÷ number of passing runsThe real price of a working result
Time to passing solutionMedian wall clock time of passing runsHow long you wait for a good answer
Regression rateRuns where the target test passes but another test breaks ÷ passing runsHidden damage a pass hides

pass^k comes from the tau-bench paper (Yao et al., ICLR 2025), which showed agents that look good on one try can be far less consistent across many.

cost per solved task = total ₹ spent on all runs ÷ number of runs that passed
success rate = runs that passed ÷ all runs
pass^3 = tasks solved on all 3 runs ÷ all tasks

Cost per solved task is the one to put at the top of your report. It folds in failed attempts, retries and long runs, which per token prices hide.

Why cheap per token is not always cheap per solve

Here is the arithmetic with illustrative numbers. These are not benchmark results. They show how the metric works.

Illustrative example

Two models on the same 24 tasks, 3 runs each

Hypothetical figures to show the calculation. Per step prices are Velona list prices on 16 October 2026 for 30,000 input and 1,000 output tokens.

Model A (budget)Model B (frontier)
Cost per step₹0.30₹7.16
Average steps per run4020
Cost per run₹12.00₹143.20
Success rate60%90%
Cost per solved task₹20.00₹159.11

In this example the budget model is still about 8 times cheaper per solve even though it needs twice the steps and fails more often. With different numbers the answer can flip, which is exactly why you measure.

Two things often change the picture on real code: a cheap model that loops for 100 steps on hard tasks, and a cheap model whose passing runs quietly break other tests. The regression rate and the cost distribution catch both.

Step by step: build your own coding model evaluation

Step 1. Pick 20 to 30 tasks with objective pass or fail checks

Use work from your own repositories, ideally from after the models' training cutoffs, so nobody has seen the answer. Every task needs a check a script can run: a failing test that should pass, a type check, or a command with an expected output.

Task mix

A balanced set of 24 tasks

CategoryCountExamplePass check
Bug fix8Duplicate email sent on retryNew regression test passes, full suite green
Feature6Add a CSV export endpointProvided acceptance tests pass
Refactor5Split a 600 line module without behaviour changeAll existing tests still pass, lint clean
Test writing5Cover the discount calculatorTests pass on correct code and fail on a planted bug

For test writing tasks, a mutation check (plant a bug and confirm the new tests catch it) stops a model from passing with empty tests.

Write each task as a short markdown file: the instruction exactly as the agent will see it, the starting commit, and the command that decides pass or fail. Mix easy and hard. If every model solves every task, the eval tells you nothing.

Step 2. Standardise everything except the thing you are testing

Same starting pointSame repository, same commit, a clean checkout or git worktree for every run.

Same instructionsIdentical task text, identical system prompt and AGENTS.md for every model.

Same agent and permissionsSame agent version, same tools, same shell access, same network rules.

Same limitsSame maximum steps, same wall clock limit, same max output tokens.

Same judgeThe same test command decides pass or fail, run after the agent stops, not by the agent.

Record settingsLog model ID, temperature, agent version and date for every run.

If you are testing context engineering instead of models, hold the model fixed and change only the context, for example with and without your AGENTS.md. Our context engineering research review lists seven practices worth testing this way.

Step 3. Repeat each run

Model output varies even at temperature 0. One study found accuracy swings of up to 15% across identical runs, and the tau-bench authors found GPT-4o succeeded on fewer than 25% of retail tasks across all 8 of 8 tries even though it passed about 61% on a single try. Three runs per task is a practical minimum. Five is better for close calls.

Step 4. Log the evidence for every API call

Every OpenAI compatible API returns token counts with each response. Log them per call, tagged with the task and run, and keep measured values apart from estimates. If you use an agent that does not expose usage, the per request rupee cost in your Velona usage dashboard is the measured source.

import csv, os, time
from openai import OpenAI

client = OpenAI(api_key=os.environ["VELONA_API_KEY"], base_url="https://velona.in/v1")

def logged_call(task_id, run_id, model, messages, log="calls.csv"):
    t0 = time.time()
    resp = client.chat.completions.create(model=model, messages=messages, max_tokens=2000)
    u = resp.usage
    with open(log, "a", newline="") as f:
        csv.writer(f).writerow([task_id, run_id, model, u.prompt_tokens,
                                u.completion_tokens, round(time.time() - t0, 2)])
    return resp

Log schema

Two files are enough

FileColumnsMeasured or estimated
calls.csvtask, run, model, input tokens, output tokens, secondsMeasured from the API response
runs.csvtask, run, model, passed, regressions, steps, retries, total ₹, wall timePassed and regressions measured by the test command. ₹ measured from the dashboard, or estimated from tokens × list price

Mark any rupee figure computed from tokens and list prices as an estimate. Caching discounts and price changes mean the bill can differ.

Step 5. Compute the metrics

import pandas as pd

runs = pd.read_csv("runs.csv")
summary = runs.groupby("model").agg(
    success_rate=("passed", "mean"),
    median_cost=("total_inr", "median"),
    total_cost=("total_inr", "sum"),
    solved=("passed", "sum"),
)
summary["cost_per_solve"] = summary.total_cost / summary.solved

per_task = runs.groupby(["model", "task"]).passed.all()
summary["pass_all_runs"] = per_task.groupby("model").mean()

passed = runs[runs.passed == 1]
summary["regression_rate"] = passed.groupby("model").regressions.apply(lambda s: (s > 0).mean())
summary["median_time_to_pass"] = passed.groupby("model").wall_time.median()
print(summary.round(2))

Step 6. Read the results honestly

Use the same eval to test routing and trust

Once the task set exists, two more questions cost almost nothing to answer.

Does routing save money?Add a routed arm

Run a third setup where a strong model plans and reviews and a cheap model does the edits. Compare its cost per solved task and regression rate with each model alone. Keep it only if quality holds.

Can the agent be trusted?Track regressions and pass^k

A model that passes the target test but breaks two others, or solves a task on one run out of three, needs closer review. These two numbers tell you how much checking each model's work needs.

For a starting point on routing code, see our tutorial on building an AI model router in Python.

Do Habits that give trustworthy results

  • Tasks from your own code, written after the models' cutoffs
  • A test command that decides pass or fail, run outside the agent
  • At least 3 runs per task per model
  • Measured token and rupee logs, with estimates labelled
  • The full test suite after every run, to catch regressions
  • Reading a sample of failed runs by hand
  • Writing down the limitations next to the results

Avoid Habits that mislead

  • Copying tasks from public benchmarks or famous repositories
  • Letting the agent report its own success
  • One run per task and a winner declared on a two task gap
  • Mixing measured costs with guesses in one column
  • Checking only the target test
  • Changing prompts or agent versions between models
  • Treating your result as true for every codebase

Frequently asked questions

How do I choose the best AI coding model for my project?

Run a small private evaluation: 20 to 30 tasks from your own code, each with a test that decides pass or fail, at least 3 runs per task, and identical setup for every model. Compare success rate, regressions and cost per solved task in rupees rather than relying on public leaderboards.

What is cost per solved task?

It is the total amount spent across all runs divided by the number of runs that passed. It includes failed attempts and long runs, so it shows the real price of a working result better than the price per token.

Is SWE-bench Verified still a reliable benchmark?

Not on its own. In February 2026 OpenAI stopped reporting SWE-bench Verified because of contamination and flawed tests, and recommended SWE-bench Pro instead. Use public benchmarks for a shortlist and your own tasks for the final decision.

How many times should I run each task?

At least 3 times per model. Model output varies even at temperature 0, with one study finding accuracy swings of up to 15% across identical runs. Repeated runs also let you measure pass^k, the share of tasks solved on every attempt.

How do I track the cost of each coding task in rupees?

Log the input and output token counts returned with every API response and tag them by task and run. On Velona, the usage dashboard also shows the exact rupee cost of each request, which is the measured figure to use.

Can I use this method to test model routing?

Yes. Add a routed setup, for example a strong model for planning and review and a cheap model for edits, and run it on the same tasks. Keep it only if its cost per solved task is lower and its success and regression rates hold.

Test 300+ models with one key.
Every request shows its exact cost in rupees. Top up with UPI from ₹10.

Get your API key

Sources and method

This guide describes a method. It does not report benchmark results from Velona, and the worked example uses hypothetical success rates and step counts to illustrate the calculation. Per step rupee costs use Velona list prices on 16 October 2026 for 30,000 input and 1,000 output tokens.