Contenox

How to compare AI coding models on your own codebase

Updated Fact-checked

Choose a coding model

To compare AI coding models on your own codebase, give each model the same five tasks from the same commit. Check which tests pass, what changed outside the request, and how long it took to get a patch you would merge. For a paid API model, include the cost of retries in the price of a finished task.

Run a five-task comparison#

Choose two models you could actually use on this repository. Give each run a fresh session with the same coding agent, instructions, tools and permissions. For local models, record the machine, model tag, quantization and context size. For any model with adjustable reasoning, record the setting you used.

Take the tasks from recent work whose outcome you can verify. For example, if checkout once accepted an expired coupon, start both models on the commit that still has the bug. Give both the same request: “Reject expired coupons at checkout and add a regression test.” Run that test yourself and check that a valid coupon still works.

Task What counts as a pass
Fix a bug Reproduce the failure first. Check that the fix passes the regression test and preserves the working case.
Add a small feature Try the new behavior against one acceptance criterion you wrote before the run.
Write a missing test Run the test against a known broken version and the corrected version. It should fail on one and pass on the other.
Refactor existing code Run the existing tests and inspect the diff for changes beyond the requested cleanup.
Answer a repository question Ask where a specific decision happens, such as when a refund is issued. Open the named files and check the explanation against the code.

Keep one row per run. Count elapsed time and API cost across all attempts, including a run you stopped. Record the final outcome separately so a fast failure never looks like a cheap fix.

Task and model Pass or fail Unrequested changes Elapsed time API cost, if billed
Bug fix · model A
Bug fix · model B

If you already have your two candidates, you can run the comparison in separate worktrees. To narrow a longer list, start with the four questions below.

1. What do you need it for?#

“Coding model” is three different jobs, and a model built for one is wrong for another:

  • An agentic coder reads files, runs commands and loops over a task until it is done. This is what Claude Code, Codex and OpenCode drive, and the rest of this page is about it.
  • An autocomplete model finishes the line as you type, through fill-in-the-middle. Qwen2.5-Coder and StarCoder2 ship FIM variants for this; they are small and fast and do not run tools.
  • An embedding model turns code into vectors for search and retrieval. Qwen3-Embedding and its kind never write code; they feed the agent’s context.

Pick the job first. A FIM model will not drive an agent, and a chat model makes slow, expensive autocomplete.

2. Can it actually run a tool loop?#

This is the question leaderboards hide. A high SWE-bench score or a million-token context window does not mean a model can sustain a multi-step tool loop. It can have the window and still emit malformed tool calls, repeat the same call, edit the wrong file, or announce “done” with the tests still red. A large window on a model that cannot drive a loop is not a capability.

The signals that match agent work:

  • Multi-turn tool use. The Berkeley Function Calling Leaderboard’s multi-turn rows and benchmarks like tau2 measure a model that called a tool, read the result, corrected itself, and called again. That predicts agent behavior far better than SWE-bench, which scores the model inside someone else’s harness.
  • It knows when to stop. Good agent models finish, report and ask. Weaker ones loop, or wander into refactors you never requested.
  • It holds instructions deep in a full context. “Don’t touch the tests” must still hold on turn forty. Accuracy drops as the context fills; Anthropic’s docs call the decline “context rot”, and the advertised maximum says little about it.

In the Contenox team’s tests, models below roughly 3 to 4 billion parameters reliably fail multi-step tool use. They answer a question or make one edit; they do not sustain an agent. Size is a floor here, not a ranking.

3. Who do you trust with your code?#

Origin and license decide where your code goes, and whether anyone is watching the model while it runs.

  • Hosted frontier models — Anthropic’s Claude, OpenAI’s GPT and Codex, Google’s Gemini, all made and run in the US. Your code leaves your machine, so you trust the vendor’s retention and training terms and its stability. In return the model runs behind the lab’s safety layer: safety training, refusals and abuse monitoring you never see.
  • Open-weight models you self-host — your code never leaves the machine. Qwen (Alibaba, Apache-2.0), DeepSeek (MIT), GLM (Z.ai) and Kimi (Moonshot) are China-origin but run fully offline; Mistral’s Devstral and Ministral are EU-made and Apache-2.0; gpt-oss (OpenAI, Apache-2.0), IBM’s Granite (Apache-2.0) and Microsoft’s Phi (MIT) are US open weights.
  • Read the license before you ship. Open weights are not automatically free for commercial use. Codestral is license-restricted; GLM and Kimi carry custom terms. Apache-2.0 and MIT are the clean ones.

When you self-host, origin matters less for data and more for the license and the model’s own behavior — because your code stays put, but the safety net is gone. There is no frontier lab behind a model you run yourself, one instance or a fleet of agents. If the weights carry a trained-in pattern you cannot see — a backdoor, a poisoned behavior — nothing server-side catches it firing. If the model is prompt-injected mid-run, by hostile text in a web page, an issue or a search result, nothing moderates what it does next. With broad permissions and network access, an injected agent, or a fleet of them, becomes the attack: hammering a target, or uploading your code and secrets.

The guardrails are then the ones you wire: a sandbox, network and egress limits, secrets kept out of the agent’s reach, and rules on what may run and what may touch the internet. See AI agent permissions and how to sandbox an AI coding agent. This is the gap Contenox Runtime’s permission envelopes are built for: the routine work runs free, and the dangerous reach still asks.

4. What can your hardware run?#

If you self-host, capacity and memory bandwidth cap the model before quality does. Rough tiers, with the full breakdown on the local pages:

  • 8 to 12 GB GPU: qwen3.5:9b, for short, focused tasks.
  • 24 GB GPU: qwen3.8:27b, usable for real agent work.
  • 48 GB or more: qwen3-coder-next and other large models.
  • Won’t fit: a hosted model, or Ollama Cloud.

A mixture-of-experts model stretches a given card: Qwen3-30B-A3B holds 30.5B parameters but activates 3.3B per token, so it runs near a 3B’s speed while needing memory for the full 30B. Best Ollama models for coding gives the pick per GPU size, and how to run local LLMs for coding covers the bandwidth that sets token speed.

Once you have a shortlist, go back to the five-task comparison. In Contenox Harness, start a fresh session for each run and choose the model from the Model chip. Keep the task text and permissions the same. How to review the resulting diff

Can I automate the comparison?#

Yes. Give each model its own git worktree, run the same task in script mode, and commit what each produced. With Claude Code:

task="Expired coupons are still accepted at checkout. Fix it and add a test. Done when npm test passes."
for model in opus sonnet; do
  git worktree add -b "try-$model" "../try-$model"
  cd "../try-$model"
  npm install
  claude -p "$task" --model "$model" --max-turns 40 --allowedTools "Read" "Edit" "Write" "Bash(npm *)" > "../result-$model.md"
  git add -A && git commit -qm "$model attempt"
  cd -
done

Then compare: git diff main..try-opus --stat and git diff main..try-sonnet --stat show how much each touched, and the result-*.md files hold each model’s own summary. Run your tests on each branch yourself rather than trusting those summaries.

Two things to watch: each worktree needs its own dependency install, and two runs at once can collide on ports or a shared database, so run them one after another. The same loop works with any agent that has a script mode and a model flag. In Codex the claude -p line becomes codex exec -m "$model" --sandbox workspace-write "$task"; in OpenCode, opencode run -m "provider/$model" "$task".

Is the most expensive model worth it?#

Compare cost per finished task, not price per token. A cheap model that needs three attempts and your help can cost more than an expensive one that gets it right once; your review time is part of the price. Once a model clears the bar on the five tasks above, a stronger one buys little for that kind of work — the question is whether one model is good enough, not which ranks highest.

Reasoning (“thinking”) settings matter as much as the model. Higher settings spend more output tokens every turn. Use them for hard debugging and design, not for renaming a variable. More in AI coding costs.

Should I use more than one model?#

The local AI vs cloud AI guide compares where to run the work, what stays on your computer and how to try both on the same task.

Usually, yes. A common split:

  • A strong model for planning, hard bugs and code nobody on the team knows well.
  • A faster, cheaper model for routine edits, tests and boilerplate.
  • A local model for code that must not leave your machine, or for offline work.

Claude Code’s own cost guide suggests the same: the cheaper model for most coding tasks, the top one kept for complex reasoning. Two models in one agent, switched with /model, is cheap. A pipeline of specialised models — one routes, one retrieves, one writes — is an engineering project: every extra model cuts the token bill and adds routing, latency and error handling someone has to maintain.