Below is the full README as normal formatted text (no outer source/code fence), so you can copy it directly as markdown.
Private AI code review for local Git repositories. Analyze diffs between branches using local or cloud LLMs — without requiring GitHub, PRs, or code uploads.
LlamaDiff runs directly on your machine, works with local repos, and supports offline-first workflows using Ollama.
Most AI code review tools require:
- pushing code to GitHub/GitLab
- sending diffs to cloud APIs
- exposing proprietary code
LlamaDiff is built for:
- local Git workflows
- privacy-sensitive projects
- offline environments
- self-hosted development setups
- developers working with code under NDA
Run reviews on:
- local repositories
- uncommitted changes
- internal projects
- air-gapped systems (with local models)
-
Compare any two git branches and get AI-powered code review
-
Works directly with local Git repositories (no PR required)
-
Review uncommitted changes
-
Supports multiple LLM providers via LiteLLM:
- Ollama (local, default)
- OpenAI
- Anthropic
- OpenRouter
-
Filter review to specific files or patterns
-
Export reviews as Markdown
-
Interactive HTML review output
-
CLI-first workflow
# Run directly without installing
pipx run llama-diff -s feature -t main
# Or install globally
pipx install llama-diffpip install llama-diffgit clone https://github.com/ernestp/LlamaDiff.git
cd LlamaDiff
pip install -e .Copy .env.example to .env and configure your preferred provider:
cp .env.example .envBy default, LlamaDiff uses Ollama for local model inference.
# Compare current branch to main
llama-diff --source feature-branch --target mainllama-diff -s feature -t main --model ollama/codellamallama-diff -s feature -t main --model gpt-4ollama-diff -s feature -t main --files "*.py"llama-diff -s feature -t main --output review.mdllama-diff -s feature -t main --htmlllama-diff --uncommitted| Provider | Model Example |
|---|---|
| Ollama | ollama/llama3.2, ollama/codellama |
| OpenAI | gpt-5.2, gpt-5.1, gpt-4o, gpt-4o-mini |
| Anthropic | claude-sonnet-4.5, claude-opus-4.5 |
| OpenRouter | openrouter/anthropic/claude-sonnet-4.5, openrouter/anthropic/claude-opus-4.5 |
- Make changes locally
- Run LlamaDiff
- Get structured review before pushing
git diff → llama-diff → AI review → fix → commit/push
No PR required. No cloud dependency (when using local models).
- Developers working with code under NDA
- Teams with proprietary or confidential repositories
- Self-hosted / privacy-first environments
- Offline or restricted networks
- OSS maintainers reviewing patches locally
- Git hooks (pre-commit / pre-push)
- CI integrations
- Better diff summarization
- Model-specific review tuning
- IDE integrations
Licensed under the Apache License, Version 2.0.