Skip to main content

AI-powered code reviewer for GitHub and GitLab

Project description

Reviewate - AI-Powered Code Review

Reviewate is a multi-agent code review system for GitHub and GitLab pull requests. It explores your codebase, verifies every finding against actual code, and posts only fact-checked feedback.

Quick Start

Run without installing (recommended)

# From a PR/MR URL (platform, repo, PR auto-detected):
uvx reviewate https://github.com/facebook/react/pull/28000

# Or with owner/repo + PR number:
uvx reviewate facebook/react -p 28000

# First run: prompts for your LLM provider + API key
# Saves config to ~/.reviewate/config.toml — all future runs just work

Requires uv.

Or install globally

uv tool install reviewate   # or: pip install reviewate
reviewate facebook/react -p 28000

No token needed if the gh or glab CLI is logged in.

From source (for development)

git clone https://github.com/numberly/reviewate.git
cd reviewate/code_reviewer
uv sync

uv run python main.py facebook/react -p 28000

LLM Providers

Reviewate works with any LLM provider via LiteLLM. Browse all supported models at models.litellm.ai.

Provider Setup
Google Gemini GEMINI_API_KEY
Anthropic Claude ANTHROPIC_API_KEY
OpenAI OPENAI_API_KEY
OpenRouter OPENROUTER_API_KEY
OpenAI-compatible (Ollama, vLLM, LiteLLM proxy, etc.) OPENAI_API_KEY + custom URL

On first run, Reviewate prompts you to pick a provider and saves your config to ~/.reviewate/config.toml:

[models]
review = "gemini/gemini-2.5-flash"
utility = "gemini/gemini-2.5-flash-lite"

# Optional: custom API URLs for OpenAI-compatible providers
[urls]
openai = "http://localhost:11434/v1"  # e.g. Ollama

API keys are read from environment variables only (not stored in the config file).

You can also set env vars or pass CLI args — they take priority over the config file.

Authentication

Method Best for Setup
CLI Auth Local development Log in with gh auth login or glab auth login
API Token CI pipelines, Docker, self-hosted Set GITHUB_API_TOKEN or GITLAB_API_TOKEN

CLI Options

# From PR/MR URL (auto-detects platform, repo, PR number):
reviewate https://github.com/org/repo/pull/48
reviewate https://gitlab.com/group/repo/-/merge_requests/1
reviewate https://gitlab.example.com/group/sub/project/-/merge_requests/352

# Classic format:
reviewate owner/repo -p 123                    # review (default)
reviewate summary owner/repo -p 123            # summary only
reviewate full owner/repo -p 123               # review + summary
reviewate review owner/repo -p 123 --dry-run   # explicit review

# Configuration
reviewate config                               # re-run setup wizard

# Additional flags
reviewate owner/repo -p 123 \
  --platform gitlab \          # GitLab (default: github)
  --dry-run \                  # Don't post comments
  --debug \                    # Show tracebacks on error
  --review-model anthropic/claude-sonnet-4  # Override review tier model
  --utility-model gemini/gemini-2.5-flash-lite  # Override utility tier model

Architecture

Multi-Agent Pipeline

PR Diff
  │
  ▼
Triage ──▶ 2 Review Agents (parallel, with grep/read tools)
                │
                ▼
           Synthesizer ──▶ Deduplicate ──▶ Fact Checker ──▶ Style
                                                              │
                                                              ▼
                                                        Post Comments
  1. TriageAgent — Analyzes PR complexity, determines reasoning effort
  2. IssueExplorerAgent — Finds and summarizes linked issues
  3. SimpleReviewAgent (x2, parallel) — Reviews code with search/read tools
  4. SynthesizerAgent — Combines findings from both reviewers
  5. DuplicateAgent — Removes duplicates with existing human comments
  6. FactCheckerAgent — Verifies every claim against actual code
  7. StyleAgent — Final formatting (makes reviews concise)

Two-Tier Model Configuration

Agents are grouped into tiers so you can use a strong model for critical analysis and a fast/cheap model for supporting tasks:

Tier Agents Purpose
REVIEW triage, review (x2), fact_checker Critical analysis
UTILITY style, duplicate, issue_explorer, summarizer, output_parser Supporting tasks

Code Structure

code_reviewer/
├── main.py              # CLI entry point & main() loop
├── cli.py               # Argument parsing & URL resolution
├── runner.py            # Config validation & workflow execution
├── config.py            # Two-tier model configuration
├── config_file.py       # ~/.reviewate/config.toml handling
├── output.py            # Progress tracking & result output
├── adaptors/
│   ├── factory.py       # Platform handler factory
│   ├── _transport.py    # Abstract transport (APIClient protocol)
│   ├── _http.py         # HTTP client (httpx)
│   ├── _cli.py          # CLI fallback (gh api / glab api)
│   ├── repository/      # PR/MR diffs, reviews, comments
│   └── issue/           # Linked issue fetching
├── agents/
│   ├── base.py          # BaseAgentImpl (LLM calls, tool loop, retry)
│   ├── specialized.py   # SimpleReviewAgent, SynthesizerAgent
│   ├── triage.py        # TriageAgent
│   ├── fact_checker.py  # FactCheckerAgent
│   ├── issue_explorer.py
│   ├── duplicate.py     # DuplicateAgent
│   ├── style.py         # StyleAgent
│   ├── summarizer.py    # SummarizerAgent
│   └── tools.py         # Tool definitions for agents
├── explorer/
│   ├── explorer.py      # CodeExplorer (ripgrep search + file reads)
│   └── builder.py       # Explorer factory
├── workflows/
│   ├── review.py        # ReviewWorkflow (main pipeline)
│   ├── summary.py       # SummaryWorkflow (PR summaries)
│   └── context.py       # Linked repos, team guidelines
├── prompts/             # Jinja2 prompt templates (.txt)
└── schema/              # Data models

Environment Variables

All env vars are optional if you have a config file (~/.reviewate/config.toml). Env vars override config file values when set.

Model configuration:

Variable Description
REVIEW_AGENT_MODEL Model for review tier agents
REVIEW_AGENT_PROVIDER Provider for review tier
UTILITY_AGENT_MODEL Model for utility tier agents
UTILITY_AGENT_PROVIDER Provider for utility tier

API keys:

Variable Description
GEMINI_API_KEY Google Gemini API key
ANTHROPIC_API_KEY Anthropic Claude API key
OPENAI_API_KEY OpenAI API key (also used for OpenAI-compatible providers)
OPENROUTER_API_KEY OpenRouter API key

Platform tokens:

Variable Description
GITHUB_API_TOKEN GitHub token (optional with gh CLI)
GITLAB_API_TOKEN GitLab token (optional with glab CLI)

OpenAI-compatible providers (Ollama, vLLM, etc.):

Variable Description
REVIEW_OPENAI_URL Custom API URL for review tier
REVIEW_OPENAI_KEY Custom API key for review tier
UTILITY_OPENAI_URL Custom API URL for utility tier
UTILITY_OPENAI_KEY Custom API key for utility tier

OpenRouter provider order:

Variable Description
OPENROUTER_PROVIDER_ORDER Global provider order (e.g. Anthropic,Google)
REVIEW_OPENROUTER_PROVIDER_ORDER Provider order for review tier only
UTILITY_OPENROUTER_PROVIDER_ORDER Provider order for utility tier only

Override priority: CLI args > env vars > config file

Development

# From monorepo root
make code-review-test  # Run tests
make qa                # Run linters and type checks

License

AGPL-3.0 — see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reviewate-0.4.5.tar.gz (88.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reviewate-0.4.5-py3-none-any.whl (129.9 kB view details)

Uploaded Python 3

File details

Details for the file reviewate-0.4.5.tar.gz.

File metadata

  • Download URL: reviewate-0.4.5.tar.gz
  • Upload date:
  • Size: 88.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for reviewate-0.4.5.tar.gz
Algorithm Hash digest
SHA256 46526b4fd19818e5d441ffee8027bf2cbc58676c33d8adf06c5b7e9112dff1fa
MD5 859018d6e48841ec66557fa1cf777087
BLAKE2b-256 29e69bf017b471e0ef61bf9128ca18e9bc69dd036d666210b74b123400e8105b

See more details on using hashes here.

File details

Details for the file reviewate-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: reviewate-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 129.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for reviewate-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 433dd20b3f477d58e80842b3308057d3a6f43bdefb74d5861aae5640a189b4ef
MD5 4dc467252bebb3abb345ba47b20f4e0f
BLAKE2b-256 0af948c2fb48febdeba201385f0991327f2528a71884645f93aab010bec5d9fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page