Work · Code

pr-reviewer.

A pull request goes in. Inline comments land on the lines that need them, and a summary sits at the top.

Companion tool: jira-bridge (posts review findings to Jira)

12 November 2026 v1 · 0.1.0 Python 3.11+ MIT CI

CLI review of a diff: inline comments name an out-of-bounds check, a double subtraction, and a string-formatted SQL query, followed by a summary; the same comments appear in the local Gradio demo.
CLI review and the local Gradio demo. The comments were produced by Qwen2.5-Coder-7B-Instruct (Q4_K_M). The reviewer is not shown as a GitHub bot.

The problem

A comment on the exact line, naming the bug and a fix.

Imagine a pull request with a one-line change that subtracts the same reserved quantity twice. A reviewer who is already late opens the diff, looks for that kind of mistake, and writes a comment on the line.

The useful result is not a model that “reviews code.” It is a comment on the exact line, naming the bug and a fix, that a person can accept or dismiss.

What we built

Inline comments on the lines they refer to, and one summary.

The pipeline is five steps. A pull request (or a unified diff on disk) is reviewed in short hunks, against a YAML rules file that sets what to check, what to ignore, and how strict to be. Inline comments land on the lines they refer to; comments on lines that are not in the diff are dropped. One summary comment sits at the top. The backend can be a hosted API or an open model on your own machine. An optional companion, jira-bridge, posts those findings to Jira when it is enabled.

Pipeline: a pull request diff is fetched; a YAML rules file sets what to check; a code model reviews each hunk; inline comments land on the lines they refer to, plus one summary. Optional companion: jira-bridge.
The same five steps, whether the backend is your API or open models on your own machine. Companion: jira-bridge, which posts review findings to Jira when it is enabled.
Left: CLI output of pr-reviewer review, with inline comments and a summary. Right: the same comments in the Gradio demo. Model: Qwen2.5-Coder-7B-Instruct Q4_K_M. No GitHub identity is shown.
CLI review and the local Gradio demo. Comments produced by Qwen2.5-Coder-7B-Instruct (Q4_K_M).
CLI output of pr-reviewer review: three inline comments and a summary, produced by Qwen2.5-Coder-7B-Instruct Q4_K_M. No GitHub identity is shown.
CLI review of a warehouse diff. Three inline comments and a summary. Qwen2.5-Coder-7B-Instruct (Q4_K_M).
Local Gradio demo showing the same review comments, without a GitHub commenter identity.
The same comments in the local Gradio demo. The page is the tool’s own UI, not a GitHub pull request.

A general “this looks risky” comment at the bottom of a pull request is easy to scroll past. A comment on the exact line, naming the bug and a fix, is something a person can accept, edit, or dismiss — and the rules file is how a team says what is worth commenting on.

Results

5 of 5 seeded bugs found.

On six diffs — five with a seeded bug, and one documentation-only change that the default rules ignore — the API backend with Qwen2.5-Coder-7B-Instruct (Q4_K_M) found 5 of 5 seeded bugs. The documentation-only diff produced no comments, as intended.

A finding counts as found when a comment is on the same file and side, the line is within the finding’s window, and the comment body contains one of the expected keywords (and does not agree with the bug instead of reporting it).

Seeded-bug evaluation on six diffs.
DiffBugPathExpected findings
picker-index.diff off-by-one (index <= len(bins))picker.py1
double-subtract.diff reserved quantity subtracted twicestock.py1
query-concat.diff SQL built by string formattingquery.py1
total-returns-count.diff len(items) where a total was wantedtotals.py1
discount-formula.diff price / percent where a fraction was wantedbilling.py1
docs-only.diff documentation only (ignored)—0
All5 of 5 seeded bugs found5 + 0

Methodology. Six diffs in samples/diffs, with ground truth in the matching *.truth.json files. API backend, Qwen2.5-Coder-7B-Instruct (Q4_K_M) behind a local llama.cpp server. The raw table is in docs/eval.md. The script is scripts/evaluate.py; the samples are in samples/.

Run it yourself

Three commands, then the demo.

Quickstart
git clone https://github.com/ModelShifts/pr-reviewer
cd pr-reviewer && python -m venv .venv && source .venv/bin/activate
pip install -e ".[api,demo]" && pr-reviewer serve

The 7B figures used a Q4_K_M GGUF through llama.cpp (API backend). On the Hugging Face backend, a CPU-only machine should set MS_HF_MODEL=Qwen/Qwen2.5-Coder-1.5B-Instruct. Python 3.11 or newer.