Can a local model review a real codebase?

Yes. It also took all day. We gave a compressed open model, running on a laptop, a real review job: a hands-on fine-tuning tutorial, text and code. Then we gave Claude Sonnet 5.5 the same prompts, at far less effort, and checked every finding from both.

Setup

ModelQwen3.8 Flash Next Coder, GSQ-RCO build by ISTA-DASLab, under 2 bits per weight, 58.4 GB
Serverllama.cpp on a MacBook Pro M3 Max with 48 GB, 131,072-token context, thinking unbounded
AgentPi 1.5.2 with its default tools: read, write, edit, bash
JobA fine-tuning tutorial: 35,000 words in seven chapters and an appendix, and the Python and shell scripts they run
BaselineClaude Sonnet 5.5 in Claude Code, same prompts, same files. It ran no scripts.

The tutorial was split in nine units. Each unit got a fresh session and one prompt: find wrong facts, commands that fail as written, and bugs, and quote the file and line for each. A separate agent then checked every finding of both reviewers against the repository and recomputed the numbers from the shipped data. The checking agents were Claude models, from the same vendor as the baseline, and we spot-checked their verdicts.

Results

Local QwenSonnet 5.5
Findings filed7234
True5831
Overstated103
False30
Not verifiable without a run10
Confirmed defects found, of 7966 (84%)31 (39%)
Found by this reviewer only4813
Time6.9 hours17 minutes

The 79 are the distinct defects that at least one reviewer found and the check confirmed. Defects that both missed are not counted, so 84% is a share of what we know, not of what exists.

The local model found more than twice as many confirmed defects. It also had far more time: 40 to 60 minutes per unit, against about 2 for Sonnet, and it ran scripts where Sonnet only read. It was 24 times slower, and it was wrong three times where Sonnet was never wrong.

The best catch

The most damaging bug in the tutorial was found by the local model only. The script that writes the training pairs had no guard for a model server that is down or still loading:

What it flagged
rows = [r for r in pmap(one, records, workers=a.workers) if r]
write_jsonl(DATA / "pairs" / "pairs.jsonl", rows)
The fix
first = pmap(one, records[:1], workers=1)
if records and not first[0]:
    raise SystemExit("no teacher call succeeded, "
                     "so pairs.jsonl is left as it was")
rows = [r for r in first + pmap(one, records[1:], ...) if r]
write_jsonl(DATA / "pairs" / "pairs.jsonl", rows)

Every failed request was retried six times, then dropped. With the server down, the script ran for hours, wrote an empty file over the existing dataset, and exited with success. The model traced this through three files, computed the retry time, and noted that a sibling command already had the guard. Its own summary: "it looks like progress for hours, then 'succeeds', then destroys the copy's data."

It did not guess. It ran 701 shell commands over the nine units, many of them small Python scripts that recount the shipped data to test a claim before reporting it.

Where it was wrong

  • Three false findings, all on numbers. It took a correct Wilson confidence interval for a wrong one because it expected a symmetric interval. It read two separate time columns as one. It miscounted a line range that was exact.
  • Inflated severity. It rated 12 minor issues "medium", and gave "high" to one medium issue and one minor one. Its labels cannot be trusted without a second look.
  • Two misses that matter. Sonnet caught a leak check that could be defeated by renaming a ticket, and a step that tested the wrong access token. The local model saw neither.

What it cost

Model time6.9 hours: 6.0 generating at 29.5 tokens per second, 0.9 reading prompts
Tokens598,000 generated, 1.19 million read, 36 million read from cache
Calls611 model calls, 773 tool calls
MemoryA 58 GB model on a 48 GB laptop: up to 12.5 GB of swap, and a laptop too slow to use for anything else

The same tokens would cost about 12 dollars at Sonnet's list prices, and about 24 at Opus's, for one review of the tutorial. Sonnet's own review used about 350,000 tokens, far fewer. So the saving in money is small. The case for a local model is that the work does not leave the machine.

The model, the agent, or us

Three things were under test at once: the model, the agent that drives it, and our setup. Here is who owns each problem.

ProblemThe model (Qwen)The agent (Pi)Our setup
Three false findingsYes. It misread the numbers.NoNo
Inflated severityYes. Its judgment.NoOur prompt gave no scale for severity.
Whole-disk searches with find /Yes. It chose the command, three times.Its default prompt tells the model to use bash for find.The copy of the repository had no installed packages, so the model went looking for them.
A search that hung for 43 minutesNoYes. Pi put no time limit on the command.A network backup was mounted on the laptop.
No stopping on its ownYes. It kept checking instead of writing up.Yes. Pi has no budget in time or steps unless you add one.We let it think without limit.
Reading files outside its folderIt went where the search led.Yes. Pi does not confine the model to the working folder.No
A laptop too slow to useNoNoYes. A 58 GB model on 48 GB of memory.

The quality of the findings, good and bad, is the model's. The lack of guard rails is the agent's: no time limit on a command, no budget, no sandbox. We worked around all three from the outside, with a note listing the paths it needed, a watchdog that kills long searches, and a cap per unit.

What this is not

It is not a fair fight between two models. Sonnet ran in a different agent, Claude Code, so the comparison mixes the model and the agent: we did not run Sonnet in Pi, or Qwen in another agent. Sonnet could be given the same time and told to run scripts. We did not test what it finds then. And it is one codebase, one model and one run.

Takeaways

  • A compressed open model on a laptop can do a thorough, evidence-backed review of real code and documentation. 84% of the defects we know of, 4% false findings.
  • It is a batch tool, not an assistant. Run it overnight, on work that should not leave the machine. The price is time, and a laptop that you cannot use meanwhile.
  • The model is ready for this job before the agent is. Check the model's severity labels, and give the agent what it lacks: the paths it needs, a time cap and a sandbox.

We have fixed the ten most serious defects it and Sonnet found. To see what open models can do on your own code and hardware, work with us.