A CLI that reviews a GitHub pull request using a local LLM — no API key, no cloud billing, runs entirely on your machine via Ollama.
reviewer review --pull-request-url https://github.com/owner/repo/pull/123
- Fetches the PR diff using pure
gitover SSH — no GitHub API token needed. It uses your existing GitHub SSH key to fetchrefs/pull/<N>/headandrefs/pull/<N>/mergedirectly, falling back to diffing against the repo's default branch if the merge ref isn't available. - Sends the diff to a local model running in Ollama, in two stages: a free-form review pass (so the model can actually reason about the diff) followed by a cheap extraction pass into structured findings.
- Prints the files reviewed, what was checked, the model's reasoning, and any findings — all to your terminal.
Because everything runs locally, the diff and review never leave your machine, and there's no per-review cost.
- Node.js >= 18
git, with SSH access to GitHub already configured (ssh -T git@github.comshould work)- Ollama — no system install required; see setup below
npm install
npm run build
npm link # makes the `reviewer` command available globallymkdir -p ~/ollama-local
curl -sL https://github.com/ollama/ollama/releases/latest/download/ollama-linux-amd64.tar.zst -o /tmp/ollama.tar.zst
tar --zstd -C ~/ollama-local -xf /tmp/ollama.tar.zst~/ollama-local/bin/ollama serve & # one-time, to pull the model
~/ollama-local/bin/ollama pull qwen2.5-coder:3breviewer ollama start # start the local model server (background, idempotent)
reviewer ollama stop # stop it
reviewer review --pull-request-url <url> [--base-ref <branch>]--base-ref <branch>— diff against this branch instead of auto-detecting the PR's base. Only needed if a PR targets a non-default branch and the automatic detection picks the wrong one (you'll see a warning when this happens).
Leave the Ollama server running between reviews — the first request after starting it pays a one-time model-load cost (tens of seconds); every request after that is fast.
All optional, via environment variables:
| Variable | Default | Purpose |
|---|---|---|
OLLAMA_MODEL |
qwen2.5-coder:3b |
Which pulled model to use for reviews |
OLLAMA_HOST |
http://127.0.0.1:11434 |
Where the Ollama server is listening |
OLLAMA_BIN |
~/ollama-local/bin/ollama |
Path to the Ollama binary, used by reviewer ollama start |
Reviewing owner/repo#123 with a local model (this may take a while on CPU)...
Files reviewed (1):
src/auth.js +12 -3
Checked for:
- Correctness bugs (logic errors, off-by-one, null/undefined handling, race conditions)
- Security issues (injection, unsafe input handling, secrets)
- Clear maintainability problems introduced by this diff
Review notes:
The diff adds a checkPassword function that compares passwords with ==
instead of a constant-time comparison, which is a timing-attack risk for
auth code.
src/auth.js:14 [WARNING] Password comparison uses == instead of a constant-time check.
1 finding (1 warning)
- GitHub only for now — no Bitbucket/GitLab support.
- Diff-only context — the model only sees the code diff, not the PR title, description, or discussion, since that would require the GitHub API (and a token) rather than plain git.
- Model quality ceiling —
qwen2.5-coder:3bis small and fast but noticeably weaker than a hosted model like Claude; it can miss subtler bugs and occasionally contradicts itself between its reasoning and its conclusion. Swap in a larger model (e.g.qwen2.5-coder:7b) viaOLLAMA_MODELfor better quality at the cost of speed and memory. - CPU inference is the bottleneck — review time is dominated by token generation speed, not the CLI itself. GPU offload was tested on integrated graphics and made no measurable difference; the effective levers are model size and response length.