llamaperf
← All articles

Coding workflows

How to evaluate a local coding model on your repository

By llamaperf · · 5 min read

Quick answer

Give a local coding model small changes you can check, in a throwaway copy of your repo. Score it on the tests it passes and on how much you had to fix before you'd merge the patch. Leaderboards are fine for a shortlist. Your repo is what picks the winner.

Pick changes you can check

Tasks from work you know

Pull five or so tasks from your own backlog or history. A bug you've already fixed is the best kind, since you know what the right answer looks like, and a small, well-defined feature is nearly as good. Each one should be something you can judge in a few minutes and cover with tests you can run.

Before the first run, write down what done means for each task: the behaviour you expect, the files that should stay untouched, the tests that should pass and any command it mustn't run. Every candidate gets the same instructions and starts from the same commit.

Use a throwaway checkout

Do all of this in a disposable clone with no production credentials in it, and read every command the model wants to run before you let it. If a patch goes wrong, a git reset puts things back and your real work never notices. Starting each run from the same state also means you can repeat the test later.

Control what the model sees

A fixed context package

Write down which files, tool output and chat history the model gets. Hand one model the failing test and the right source file, make another find everything itself, and you've run two different tests.

For a first comparison, give every model the same fixed bundle of files. An agent that searches the repo on its own is a separate experiment, and when you get to one, note its tools and permissions too. The tools around a model move the results about as much as the model does.

Record the setup

Save the exact model build, quantization, runtime and context size. The coding reports show setups other people run on hardware like yours. They're community tags, so read them as ideas to try on your own repo. Choosing between two files of one model? The quantization test follows the same steps.

Score the patch before the explanation

Run the tests, then read the diff

Passing tests are good evidence. You still read the diff, to check it handles the case in the ticket and leaves alone any interface or code it had no reason to change. Formal benchmarks start from the same place:

"SWE-bench evaluates models by applying their generated patches to real-world repositories and running the repository's tests to verify if the issue is resolved." (SWE-bench evaluation guide)

SWE-bench Verified, the best-known version, has 500 tasks (dataset on Hugging Face). Five tasks from your repo won't give you a score you can set beside that, and they don't need to. They answer the narrower question you care about when you're picking a model: does it help on your code?

Count the repair work

Note how much you had to fix. Merging after a quick read and rewriting half the patch are very different outcomes, even when both end with the tests passing.

MeasureWhy it goes in the record
Acceptance criteria passedThe actual task outcome
Relevant tests passedA check you can repeat
Unrelated changesExtra review and regression risk
Manual repairWork that came back to you
Full task timeIncludes retries and tool calls

Keep the model's explanation as a note beside the score. However sure of itself it sounds, it can't tell you the change works.

Use a model where it earns its place

Time to a merged patch

Compare total task time, with retries and your own review included. A quick answer that needs three rounds of fixes can cost you more than a slower one that lands first time, and tokens per second is a small slice of that total.

Keep a running record

Write down which jobs each setup handles well enough that you'd rely on it, and where you still reach for something else. When you change the model or runtime, rerun the same tasks. Add new ones as your work shifts, and keep the old results labelled with their versions so you can see what moved.

The calculator narrows the field to models that fit your hardware, and the benchmark guide is worth a read before you trust a leaderboard number. Past that point it's your repo's call. A coding report helps the next reader most when it says what kind of change the model handled, so if you share your results, put the task types next to the setup.

Frequently asked questions

What is the best local model for coding on my GPU?

Whichever one passes the most of your own tasks with the least repair, at a speed you can live with. Community reports will give you a shortlist of two or three that fit your memory. After that, run them on real changes from your repo.

How do I benchmark a local coding model on my own codebase?

Take five or so real tasks that have tests. In a throwaway clone, give each model the same files and instructions, then score tests passed, unrelated changes and how much you fixed by hand.

Are coding benchmark scores comparable to my own tests?

No. SWE-bench Verified is 500 tasks from public Python repositories, graded with its own test setup. Your tasks, tools and grading are different, so keep the two as separate evidence.

What makes a local coding agent safe enough to leave running unattended?

Watch it on small tasks first, until you've seen how it fails. When you do let it run alone, keep it in a disposable checkout with no production credentials, review commands before they run and give it only the tools it needs.

Should I use a bigger quant for coding models?

Test it on your tasks. Code with exact formats and tests shows quantization losses sooner than chat does, so run your task set on both files and only keep the smaller one if it passes the same tests.

Does tokens per second matter for coding?

Less than you'd expect. Retries, test runs and your own review usually take longer than generation, so total time to a patch you can merge is the better thing to measure.