Private AI code review in VS Code with a local Ollama model
- Hardware
- Tested on an Intel MacBook with no GPU
- Models & engines
- Ollama with qwen2.5-coder:7b (about a 5 GB download, wants around 8 GB of free memory)
VS Code with the AI Code Review extension set to the Ollama (local) provider at http://localhost:11434 - Key gotcha
- Small models sometimes invent findings.
What they built
Ritom Puzari wanted AI code review for client work, where sending a diff to an outside service is often not allowed. The answer was a local model: Ollama serves qwen2.5-coder:7b and a VS Code extension sends it the uncommitted changes.
He wrote the extension he uses (AI Code Review, on the VS Code Marketplace and Open VSX) and says so up front. The local path has no sign-in and no limit; the extension also has a paid tier for branch review and applying fixes.
Findings appear as squiggles, in the Problems panel and in a tree grouped by file, each tagged security, bug, performance or style with a suggested fix on hover.
Setup
- Ollama with qwen2.5-coder:7b (about a 5 GB download, wants around 8 GB of free memory)
- VS Code with the AI Code Review extension set to the Ollama (local) provider at http://localhost:11434
- Tested on an Intel MacBook with no GPU
How it works
- The extension's "Choose AI Provider and Model" command picks Ollama and the model; "Test Connection" loads the model on first call.
- "Review Uncommitted Changes" in Source Control sends the diff to the local model.
- A "quick" profile asks only for bugs and security problems, and maxTokensPerRequest 6000 splits big diffs into more requests so nothing is cut off.
Results & numbers
- On the Intel MacBook with no GPU, an 8B model needed 165 seconds for a 15-line change.
- It found both bugs he planted.
- Reviews still work with wifi off; the only address called is localhost:11434.
Gotchas
- Small models sometimes invent findings.
- The model sees only the diff, not the whole repository.
- The first call is slow while the model loads.
“Treat it as a second pair of eyes before a human review.”— Ritom Puzari
Do it yourself
- Install Ollama and run `ollama pull qwen2.5-coder:7b`, then check `curl http://localhost:11434/api/tags`.
- Install a review extension that can talk to Ollama and choose the Ollama provider and model.
- Set a quick bugs-and-security profile and a lower per-request token budget for small models.
- Turn wifi off (or watch connections with Little Snitch or LuLu) and run a review to confirm nothing leaves the machine.
{
"aiCodeReview.profile": "quick",
"aiCodeReview.maxTokensPerRequest": 6000
}Similar setups
PatchPal TinyAgent: a coding agent on a 4B model and a 6GB laptop GPU
WiseProbe adapted its PatchPal coding agent to run Gemma 4 E4B or Qwen3.5 4B through Ollama on a 6GB RTX A1000, using handoff-note compaction and capped file reads to work inside a 16K or 32K window.
OpenCode on a CPU-only Intel i7 laptop talking to local Ollama coder models
Idada Osaigbovo James wires OpenCode on a Dell Latitude 5430 (i7-1265U, 32 GB RAM, Iris Xe) to Ollama’s local OpenAI-compatible API and runs Qwen2.5-Coder 1.5B/7B with no cloud subscription.
A €200 mini PC as an offline AI box: a week with Gemma and Qwen
Diogo Soares ran Gemma 4 E4B and Qwen2.5-Coder 7B on a cheap NiPoGi P1 mini PC firewalled off the internet, used it from his Mac for a week, and measured what was fast and what wasn't.
Getting OpenCode to work with a local Ollama model by fixing the 4,096-token context
OpenCode on a local Ollama model ignored files, invented tasks or looped, because each ~23k-token request was silently cut to fit Ollama's default 4,096-token context on a 16 GB GPU.