DEV Community

Abhisek Roy
Abhisek Roy

Posted on

Built a Local AI Code Reviewer with Ollama | Private & Open Source 🚀

Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady Submission 🦥

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady

What I Built

Code reviews are essential but draining. Reading every changed line of a junior’s or colleague’s PR, spotting edge cases, and explaining fixes takes focus that’s hard to find at the end of a long day, so issues slip through.

Local AI PR Reviewer does the first pass for you. It watches your chosen repos, reviews every new or updated PR with a local open-weight model on Ollama, and posts senior-engineer-style feedback: critical issues, why they matter, and suggested fixes. It’s comment-only, free to run, and your code never leaves your machine.

Demo

AI_Review

Code

GitHub logo abhisek247767 / local-ai-pr-reviewer

A Python-based GitHub Pull Request reviewer powered by a local Ollama LLM. Manually review PR diffs for potential bugs, security issues, logic errors, and missing tests, with human-controlled review comments.




How I Built It

The whole project runs on open-source, local AI. No paid APIs, no cloud model calls.

The model

Reviews are generated by Qwen2.5-Coder, an open-weight coding model, running locally through Ollama. The model is set with a single line in .env, so I can switch to a bigger or different model without changing any code:

OLLAMA_MODEL=qwen2.5-coder:3b
GITHUB_TOKEN= Your GitHub access token
Enter fullscreen mode Exit fullscreen mode

The stack

  • Python, managed with uv
  • Ollama for local inference (/api/chat in JSON mode)
  • GitHub REST API for reading pull requests and posting reviews
  • python-dotenv for configuration

Why Does Open Innovation Matter?

Code is sensitive, and many teams can't send it to third-party AI APIs. Because this reviewer runs an open-weight model locally through Ollama, every diff stays on my own machine. It also costs nothing to run, so I can review every PR and every new commit without worrying about API bills. Open tools give me full control: I can swap models with one line, tune the prompt, and never deal with rate limits or deprecated models. A local model isn't as sharp as the biggest closed ones, but for a first-pass reviewer, being private, free, and always on matters more.

The Lazy Payoff

I ran it on my own demo repo this week. On the note deletion and search PR, it posted a review in about 2 minutes without me opening a single file, and caught two real bugs: a missing useEffect cleanup and unhandled errors in deleteNote. Normally a careful first pass on a PR like that takes me [15–20 minutes]. Now I start from a list of real issues instead of a blank diff, and spend my time only on design decisions. The reviewer works while I don't, which is exactly how a sloth would want it. 🦥

Prize Categories

  • Best Use of ElevenLabs
  • Best Use of MongoDB Atlas
  • Best Use of Mastra
  • Best Use of GitHub Copilot
  • Best Use of Auth0 for AI Agents

Top comments (0)