𝗜𝗠𝗣𝗥𝗢𝗩𝗜𝗡𝗚 𝗔𝗜-𝗣𝗢𝗪𝗘𝗥𝗘𝗗 𝗖𝗢𝗗𝗘 𝗥𝗘𝗩𝗜𝗘𝗪 I needed a way to review code without sharing it with a third party. My team uses GitHub Copilot, but it sends code snippets to Microsoft's cloud. This is not acceptable for our internal tools and customer-facing code.
I looked for a review bot that could:
- Accept diffs of any size
- Return structured feedback with line numbers, severity, and suggestions
- Run entirely on our infrastructure or via a trusted endpoint
I tried local LLMs and Python scripts, but the results were not good. I then wrote a thin Python module that works with any API endpoint that supports the chat completions format. This module:
- Forces structured JSON output
- Has retry and rate limiting built in
- Has minimal dependencies
You can use this module to pipe any diff into a tool and get structured feedback. I tested this with a self-hosted endpoint and it works well.
Some key takeaways:
- Model quality matters more than size
- Structured output is non-negotiable
- Privacy does not have to mean running on your own hardware
- Latency is real, but acceptable for CI/CD
How do you handle AI-powered code review in a privacy-sensitive environment? Are you running local models or trusting a provider? I'd love to hear what's working for you. Source: https://dev.to/__c1b9e06dc90a7e0a676b/i-tried-to-build-an-ai-code-reviewer-without-sharing-my-code-heres-what-worked-212f