Status: π§ Early Development - Not yet runnable
A multi-agent code review system that simulates real-world peer review discussions using heterogeneous LLM models, with support for both cloud-based and on-device (MacBook) inference.
CodeReviewer introduces a novel approach to automated code review by orchestrating multiple LLM agents in different reviewer roles (Senior Developer, Junior Developer) that engage in multi-round discussionsβjust like human reviewers would. This collaborative approach aims to produce more nuanced, thorough, and reliable code reviews than single-agent systems.
Traditional automated code review tools use a single model to analyze code. CodeReviewer takes a different approach:
- Role-Based Agents: Each LLM assumes a specific role (Senior/Junior) with distinct perspectives and system prompts
- Multi-Round Discussions: Agents review each other's feedback, building consensus through iterative dialogue
- Heterogeneous Models: Different agents can use different models (cloud or local) optimized for their role
- Consensus Detection: The system identifies when agents reach agreement, mimicking real code review workflows
- β Multi-Agent Pipeline: Configurable conversation flow between Senior and Junior developer agents
- β Hybrid Inference: Seamlessly switch between cloud APIs (OpenAI, Anthropic) and on-device models
- β On-Device First: Optimized for Apple Silicon with quantized models (GGUF) and GPU acceleration
- β Multiple Input Sources: Support for Git diffs, local files, and GitHub Pull Requests
- β Conversation Memory: Intelligent context management for long discussions
- β Consensus Detection: Automatic detection of agreement between agents
- β Streaming Output: Real-time feedback as agents discuss code
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UI Layer (Future: Tauri 2.0) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Multi-Agent Pipeline Coordinator β
β ββββββββββββββββββββββββββββββββββββββββββββ β
β β Senior Agent ββ Junior Agent β β
β β β’ Conversation State Machine β β
β β β’ Round Management (up to N rounds) β β
β β β’ Consensus Detection β β
β ββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LLM Backend Abstraction Layer β
β ββββββββββββββββ¬ββββββββββββββββββββββββββββ β
β β Cloud APIs β On-Device Inference β β
β β - OpenAI β - Candle (GGUF) β β
β β - Anthropic β - Metal Acceleration β β
β β β - CoreML (future) β β
β ββββββββββββββββ΄ββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Code Input Layer β
β β’ Git Diffs (git2) β’ Files β’ GitHub PRs β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
code-reviewer/
βββ Cargo.toml
βββ src/
β βββ main.rs
β βββ lib.rs
β β
β βββ agents/
β β βββ mod.rs
β β βββ agent.rs // Agent trait & implementation
β β βββ roles.rs // Senior/Junior role definitions
β β βββ pipeline.rs // Multi-round discussion coordinator
β β βββ consensus.rs // Agreement detection logic
β β
β βββ llm/
β β βββ mod.rs
β β βββ provider.rs // LLMProvider trait
β β βββ cloud.rs // Cloud backend (llm-connector)
β β βββ candle_backend.rs // Candle on-device
β β βββ coreml_backend.rs // CoreML (future)
β β βββ config.rs // Backend configuration
β β
β βββ code_input/
β β βββ mod.rs
β β βββ source.rs // CodeSource trait
β β βββ git.rs // Git diff handling (git2)
β β βββ files.rs // File reader
β β βββ github.rs // GitHub PR fetcher (octocrab)
β β
β βββ conversation/
β β βββ mod.rs
β β βββ memory.rs // Conversation state management
β β βββ message.rs // Message types
β β βββ state_machine.rs // Discussion state transitions
β β
β βββ prompts/
β β βββ mod.rs
β β βββ senior_prompts.rs // Senior developer system prompts
β β βββ junior_prompts.rs // Junior developer system prompts
β β
β βββ cli/
β β βββ mod.rs
β β βββ commands.rs // CLI interface
β β
β β
β βββ config/
β β βββ mod.rs // Contains Rust code to load, parse, and manage config
β
βββ models/ // TBD: Quantized models directory (gitignored)
βββ config/
β βββ config.toml // Application configuration
βββ tests/
βββ integration/
βββ unit/
| Component | Technology | Rationale |
|---|---|---|
| Language | Rust 2021 | Memory safety, performance, async support |
| Cloud APIs | llm-connector | Unified interface for OpenAI/Anthropic |
| On-Device | Candle + Candle-Transformers | Pure Rust, GGUF support, Metal acceleration |
| Git Integration | git2 | Mature libgit2 bindings |
| GitHub API | octocrab | Async PR/issue management |
| Async Runtime | tokio | Industry standard |
| Future UI | Tauri 2.0 | Lightweight, native macOS integration |
- StarCoder2-7B (Q5_K_M): Specialized for code understanding
- CodeLlama-7B-Instruct (Q5_K_M): Good instruction following
- Qwen2.5-Coder-7B (Q5_K_M): Latest, excellent code comprehension
- DeepSeek-Coder-6.7B (Q5_K_M): Strong coding capabilities
All models will use Q5_K_M quantization for optimal size/quality balance (~1.6GB per model)
- Architecture design
- Core abstractions (LLMProvider, Agent, CodeSource traits)
- Cloud API integration
- Git diff parsing
- Basic 2-agent conversation (1 round)
- CLI interface
- Conversation state machine
- Memory management (sliding window)
- Multi-round discussion logic (up to 5 rounds)
- Consensus detection algorithm
- GitHub PR input support
- Candle integration for GGUF models
- Model download/caching system
- Metal GPU acceleration
- Performance benchmarking
- Apple Neural Engine support
- Model conversion pipeline
- Performance tuning
- Tauri 2.0 desktop application
- Real-time streaming output
- Review history & export (Markdown/PDF)
- Settings UI
- Product Manager agent (3rd role)
- Fine-tuned models on code review datasets
- GitHub App for automatic PR reviews
- Vector database integration for codebase context
- Web interface
| Metric | Cloud | Local (Q5_K_M) |
|---|---|---|
| First Token | 200-500ms | 1-3s |
| Throughput | 50-100 tok/s | 20-40 tok/s |
| Memory | <500MB | 2-3GB |
| Full Review (500 LOC) | 30-60s | 2-4min |
This project is in early development. Contributions, ideas, and feedback are welcome once the foundation is stable.
This project is licensed under a Custom Non-Commercial License (MIT-NC Variant) β see the LICENSE file for details.
Author: ikhyunAn
Last Updated: October 2025