Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

AI ReviewBot

PyPI version Python 3.13+ License Tests codecov

AI-powered code review tool for GitHub and GitLab that provides intelligent feedback with inline suggestions and one-click "Apply" button.

📚 Documentation🚀 Quick Start🛒 GitHub Marketplace


✨ Features

  • 🤖 AI-Powered Analysis — Uses Google Gemini or Mistral AI for deep code understanding
  • 💡 Inline Suggestions — Comments directly on code lines with GitHub's "Apply suggestion" button
  • 🔒 Security Focus — Identifies vulnerabilities with severity levels (Critical, Warning, Info)
  • 🌍 Multi-Language — Responds in your PR/MR language (adaptive mode)
  • Good Practices — Highlights what you're doing right, not just issues
  • 📊 Transparent Metrics — Shows tokens, latency, and estimated cost
  • 🦊 GitHub & GitLab — Native support for both platforms

🔍 Project Discovery

AI ReviewBot automatically analyzes your repository before each review:

  • Languages & frameworks detected from GitHub/GitLab API
  • CI pipeline parsed to understand what's already automated (linters, formatters, type checkers)
  • Config files read to understand project conventions
  • Attention Zones classify each quality area as ✅ Well Covered, ⚠️ Weakly Covered, or ❌ Not Covered

This means the bot won't duplicate feedback that your CI already catches — no formatting nits when you run Prettier, no type errors when you run mypy. Discovery results are cached via watch-files, so repeated PRs cost 0 extra tokens.

Create .reviewbot.md in your repo root to customize. You can also run ai-review discover owner/repo to preview what the bot sees.

Variable Default Description
AI_REVIEWER_DISCOVERY_ENABLED true Enable/disable project discovery
AI_REVIEWER_DISCOVERY_VERBOSE false Always post discovery comment
AI_REVIEWER_DISCOVERY_TIMEOUT 30 Discovery timeout in seconds

See Discovery documentation for details.

🚀 Quick Start

GitHub Actions (Recommended)

# .github/workflows/ai-review.yml
name: AI Code Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write

    steps:
      - uses: KonstZiv/ai-code-reviewer@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          google_api_key: ${{ secrets.AI_REVIEWER_GOOGLE_API_KEY }}
          # Or use Mistral:
          # mistral_api_key: ${{ secrets.AI_REVIEWER_MISTRAL_API_KEY }}
          # llm_provider: mistral

GitLab CI

# .gitlab-ci.yml
ai-review:
  image: ghcr.io/konstziv/ai-code-reviewer:1
  script:
    - ai-review
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

Note: Set LLM API key (AI_REVIEWER_GOOGLE_API_KEY or AI_REVIEWER_MISTRAL_API_KEY) and AI_REVIEWER_GITLAB_TOKEN as CI/CD variables in Settings.

PyPI

pip install ai-reviewbot

# Set environment variables (Google)
export AI_REVIEWER_GOOGLE_API_KEY="your-key"
export AI_REVIEWER_GITHUB_TOKEN="your-token"

# Or use Mistral
# export AI_REVIEWER_MISTRAL_API_KEY="your-key"
# export AI_REVIEWER_LLM_PROVIDER=mistral

# Run review
ai-review --repo owner/repo --pr 123

Docker

# DockerHub
docker pull koszivdocker/ai-reviewbot:1

# GitHub Container Registry
docker pull ghcr.io/konstziv/ai-code-reviewer:1

📖 Documentation

Full documentation available in 6 languages:

Language Link
🇬🇧 English Documentation
🇺🇦 Українська Документація
🇩🇪 Deutsch Dokumentation
🇪🇸 Español Documentación
🇲🇪 Crnogorski Dokumentacija
🇮🇹 Italiano Documentazione

⚙️ Configuration

Variable Default Description
AI_REVIEWER_GOOGLE_API_KEY Google Gemini API key
AI_REVIEWER_MISTRAL_API_KEY Mistral API key
AI_REVIEWER_LLM_PROVIDER google Primary LLM provider (google, mistral)
AI_REVIEWER_LLM_FALLBACK_PROVIDER Fallback provider when primary is exhausted
AI_REVIEWER_GITHUB_TOKEN GitHub token (for GitHub)
AI_REVIEWER_GITLAB_TOKEN GitLab token (for GitLab)
AI_REVIEWER_LANGUAGE en Response language (ISO 639 code)
AI_REVIEWER_LANGUAGE_MODE adaptive adaptive (detect from PR) or fixed
AI_REVIEWER_GEMINI_MODEL gemini-2.5-flash Gemini model to use
AI_REVIEWER_MISTRAL_MODEL mistral-large-latest Mistral model to use
AI_REVIEWER_MISTRAL_API_URL Custom Mistral API URL (e.g. https://codestral.mistral.ai)
AI_REVIEWER_LOG_LEVEL INFO Logging level
AI_REVIEWER_DISCOVERY_ENABLED true Enable project discovery before review

Note: At least one LLM API key is required. Old variable names without AI_REVIEWER_ prefix still work as fallback.

See Configuration Guide for all options.

🎯 Example Output

The reviewer provides structured feedback with inline suggestions:

Summary Comment

🤖 AI Code Review

📊 Summary — Found 2 issues and 1 good practice.

Category Critical Warning Info
Security 1 0 0
Code Quality 0 1 0

✨ Good Practices — Excellent error handling in api/handlers.py


⏱️ 1.2s | 🪙 1,540 tokens | 💰 ~$0.002

Inline Comment with "Apply" Button

⚠️ SQL Injection Risk

User input is concatenated directly into SQL query.

cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))

💡 Why this matters: SQL injection allows attackers to execute arbitrary SQL commands. Always use parameterized queries.

📚 Learn more

🛠️ Development

# Clone repository
git clone https://github.com/KonstZiv/ai-code-reviewer.git
cd ai-code-reviewer

# Install dependencies with uv
uv sync --all-groups

# Run tests
uv run pytest

# Run linters
uv run ruff check .
uv run mypy src/

# Build documentation
uv run mkdocs serve

📦 Installation Options

Method Command Best For
GitHub Action uses: KonstZiv/ai-code-reviewer@v1 GitHub projects
Docker docker pull koszivdocker/ai-reviewbot GitLab CI
PyPI pip install ai-reviewbot Local testing

💰 Cost Estimate

Using Gemini 2.5 Flash:

  • Input: $0.075 / 1M tokens
  • Output: $0.30 / 1M tokens
  • Average review: ~$0.002 (1,500 tokens)

100 reviews/month ≈ $0.20

📄 License

Apache 2.0 — See LICENSE for details.

🤝 Contributing

Contributions are welcome! See Contributing Guide.

📬 Support


Made with ❤️ by Kostyantin Zivenko

Release files for ai-reviewbot 1.0.0b13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-reviewbot 1.0.0b13
File Size Uploaded
ai_reviewbot-1.0.0b13.tar.gz 583.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-reviewbot 1.0.0b13
File Interpreter ABI Platform
ai_reviewbot-1.0.0b13-py3-none-any.whl Python 3 none any Details

Total release size: 715.0 kB

Release files / ai_reviewbot-1.0.0b13.tar.gz

Download URL ai_reviewbot-1.0.0b13.tar.gz
Size 583.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c82f75e5eeb1feaa6eef2146471e56c6d2c03a6fcab0bcb128c71896732236de
BLAKE2b-256 checksum
How to use checksums
37cf999d5f75bdaaffa5d782aa34b5f9cd266b8ab237ee7fe996742d141da1ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.

Transparency log

Release files / ai_reviewbot-1.0.0b13-py3-none-any.whl

Download URL ai_reviewbot-1.0.0b13-py3-none-any.whl
Size 131.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04127b13ce8fa2a655f9ff33996bdcc86555e62157a037b9784094cf86e6a281
BLAKE2b-256 checksum
How to use checksums
36652e24370535a26528df181db15d5e5c5184653051fab910660d3dc8edd813
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 13, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page