Skip to content
Reality Graph

Local-first

Local LLM Code Review

Last updated: 2026-11-044 min read

Sources checked 2026-11-049 sourced figures

Local LLM code review works when the model filters and a person decides. Pass 1a runs the deterministic checks, pass 1b lets the local model screen only what survived them, and pass 2 is human review, which owns the merge: the two-pass review workflow, with the model placed inside the machine pass. A model flag is never validation evidence, so it cannot lower your unverified-merge rate; only recorded checks and the human decision do. Hardware comes second: a 7–9B model at Q4 fits in about 6–8GB of VRAM, a 22–35B model in 16–24GB (LocalLLM.in, 2026, checked 4 November 2026).

your machineRepositoryruns & evidenceDashboardlicence checksemantic reviewoptionalrevocation listoptional
Contents

Why teams do this at all

The motivation is the data boundary, not the benchmark. A local model means the review step adds no provider to your jurisdiction analysis, no entry in the transmission-path map, and no per-query cost that grows with AI volume. The check itself stays wherever the model runs: in the joint BSI/ANSSI report on AI coding assistants (2024, checked 4 November 2026), generated source code should generally be checked and reproduced by the developers. A local filter is one way to add a model to that check where the code must not travel.

The method: two passes, the machine pass split in two

The order is the method. Each step sees only what the step before it let through, and hands the next one a record, not a verdict. Take the model out and a working two-pass review remains; take out the checks or the human and none does. That is how you test whether the model sits in the right place.

  1. Pass 1a: deterministic checks
    In:
    The diff, the written task with its boundaries and acceptance criteria, and tests written before the change.
    Out:
    One result per check (format, lint, types, build, tests, scope against the declared boundaries), each with its exit code. A red result stops the change here; the model never sees it.
    The human still decides:
    Which checks are required, what the tests must cover, and whether a red check may ever be waived. A waiver is a recorded decision, not a skipped step.
  2. Pass 1b: the local model as filter
    In:
    Only changes that passed 1a, one at a time, with the task text, cut to fit the model's context window.
    Out:
    A short list of hypotheses (suspected problems, each pointing at a line and at the criterion it may break) or an empty list. No score, no approval, no blocking status.
    The human still decides:
    The threshold for what gets surfaced, and whether any single flag is real. A flag can ask for a closer look; it cannot pass or fail the change.
  3. Pass 2: human review
    In:
    The diff, the pass 1a results and the pass 1b flags, shown apart so a reader can tell what came from a check and what came from a model.
    Out:
    The merge decision, with what was checked, what was flagged and what was dismissed on record.
    The human still decides:
    Everything that needs judgment: whether the approach is right, whether it fits the system, whether the change should exist at all.

Rules that keep the model in its place

  • Nothing decidable goes to the model. If a check can answer yes or no, it belongs in pass 1a. The model gets the questions no check settles, such as a missed edge case or a misleading name.
  • The filter never gates. Model output can change between two runs and between model versions. A flag may hold a merge for a human look; it never blocks or approves one on its own.
  • The task travels with the diff. Without written intent the model guesses what the change was for and reviews its guess. With a written task, a small model can check scope and criteria, which is focused work it handles well.
  • One change per run. On local hardware the context window is the tight limit. Review per change, not per branch, and the limit mostly stops mattering.
  • Flags stay labelled as flags. In the record and in the pull request, a model hypothesis never sits in the same list as a test result. Mixing the two is how a guess turns into evidence.

How to tell whether the filter earns its place

Count two things for a few weeks: how many flags the human acted on and how many were dismissed. If most are dismissed, raise the threshold or narrow what the model is asked; if that does not help, drop pass 1b. Pass 1a and pass 2 keep working without it, which is exactly why the model sits in the middle. Any target for that share is yours to set; this page gives none.

What the count cannot show is what the filter missed. Misses surface later, as fixes to code that passed all three steps. So read the dismissal count next to how often merged changes need another fix soon after.

What the method needs from the hardware

The filter’s job sets the size. The model has to read one change plus its task inside its context window, at a speed that does not hold up CI. Past that point, a larger model mainly means fewer empty or wrong flags.

Read the tiers as the floor for pass 1b, not as a quality ranking: the pairs say what fits in memory, the third column what a filter of that size can carry. A larger tier buys fewer wrong flags, not a different method.
VRAMModel size that fits (Q4_K_M)What a filter at this size carries
Entry6–8GBLocalLLM.in VRAM guide (community reading), checked 4 November 2026 · 20267–9BLocalLLM.in VRAM guide (community reading), checked 4 November 2026 · 2026Small single-file diffs; expect to tune the thresholdThis page's assessment · 2026-11
Mid10–12GBLocalLLM.in VRAM guide (community reading), checked 4 November 2026 · 202612–14BLocalLLM.in VRAM guide (community reading), checked 4 November 2026 · 2026Typical single-change diffs with a written taskThis page's assessment · 2026-11
Serious16–24GBLocalLLM.in VRAM guide (community reading), checked 4 November 2026 · 202622–35BLocalLLM.in VRAM guide (community reading), checked 4 November 2026 · 2026Multi-file changes within the context windowThis page's assessment · 2026-11
Team server48GB or more, or 2×24GBLocalLLM.in VRAM guide (community reading), checked 4 November 2026 · 202670B and aboveLocalLLM.in VRAM guide (community reading), checked 4 November 2026 · 2026One shared filter endpoint for a team's CIThis page's assessment · 2026-11
Read the tiers as the floor for pass 1b, not as a quality ranking: the pairs say what fits in memory, the third column what a filter of that size can carry. A larger tier buys fewer wrong flags, not a different method.

Two facts sit behind the table. Q4_K_M quantisation needs about 75% less VRAM than FP16, according to the LocalLLM.in guide (updated February 2026, checked 4 November 2026). Ollama serves a subset of the OpenAI API (documentation checked 4 November 2026), so most tools that accept a custom endpoint can call a local model; llama.cpp is the lower-level alternative.

The honest limits

A local model filters less well than a frontier model on reasoning across many files, cross-cutting effects and rare stacks. This page states that as an assessment, not a measurement, and cites no benchmark for it. In this method the gap costs less than it would if the model were the reviewer: what the filter misses still meets the checks before it and the human after it.

Throughput is the other limit, because a shared server needs sizing and a laptop filters one change at a time. The decision rule from the local review guide applies: local where the data boundary binds, stronger models where it does not, by repository, not by ideology.

Where Reality Graph fits

Reality Graph supplies the structure this method assumes. It holds the written task with its boundaries and acceptance criteria, runs the approved checks itself, records a verdict for each run and writes an evidence report, all on your own machine. It ships no LLM and requires no particular model, so the filter in pass 1b stays your choice. Which bytes stay on your hardware is written out separately, including the exceptions.

The concrete setup steps this points to

  • Pick the largest coder model your VRAM runs at Q4 with usable speed
  • Serve it locally behind an OpenAI-compatible endpoint with Ollama
  • Feed it the written task and only what survived types, tests and linters
  • Wire it into pre-commit or CI and review per change, not per branch

What it does not give you

  • Frontier-model quality from a small local model – the gap is real
  • An evergreen model pick – check a current list at setup time
  • A data-privacy verdict – local removes a transmission path, hygiene still applies
  • A reason to skip the deterministic layer – it carries the base load offline
Local and local-first keep the code in your environment, which removes a transmission path – it is not a privacy guarantee, and the deterministic layer still carries the base load.

FAQ

How do you run code review with a local LLM?
In three steps with one decision at the end. Deterministic checks run first and stop anything red. The local model then reads each surviving change with its task and returns hypotheses, never a verdict. A human reviews the diff with both results in view and decides the merge. The model sits in the middle because the method still works without it and does not work without the other two.
What hardware does a local review model need?
Less than the model lists suggest, because a filter reads one change at a time. Start at the smallest tier that fits one change plus its task in context at a speed CI can wait for; in the LocalLLM.in guide (updated February 2026, checked 4 November 2026) that is 6–8GB of VRAM for a 7–9B model at Q4_K_M. Move up a tier when the acted-on count shows the flags are too noisy to use, not because a leaderboard changed.
Why is the local model a filter and not the reviewer?
Because its output is not stable enough to carry a decision. The same diff can draw different flags on two runs or after a model update, and a small model misses more than a large one. As a filter that is acceptable: a wrong flag costs a human a minute, and a missed problem still meets the checks before it and the reviewer after it. As a gate it would turn a guess into a merge rule.
Which model should we pick?
This page names none on purpose. The community list it cited in July 2026 had replaced those models with others when it was checked again on 4 November 2026. The rule that outlasts the lists: the largest coder model your VRAM runs at Q4 with a speed your CI can wait for, compared against a current list in the week you set it up. After that, the count of flags acted on decides whether it stays.
How hard is the setup?
The runtime is the small part: Ollama or llama.cpp serves a quantised model behind a local API, and most tools with a custom endpoint can call it. The work is the order around it. Wire pass 1a as a required check, feed pass 1b only what passed, and show flags apart from check results in pass 2. Budget for that wiring, not for the model.
When is local LLM review the wrong choice?
When nothing stops you from using stronger options. If your policies permit cloud processing for the code in question, a frontier model or a good cloud reviewer will usually catch more per run; that is this page's assessment, not a measurement. Local review earns its keep where the data boundary is the constraint (client code, regulated repositories, air-gapped environments) or as the always-available filter that costs nothing per query. Choosing it for ideology rather than constraints usually ends in quiet disuse.

Keep reading

Sources

Want to see what your last agent run would have looked like?

Request access