Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Diff Review Service

Async HTTP service that reviews unified diffs and returns structured findings. Built with Python / FastAPI / asyncio. All state is in-memory.

Run locally

python -m venv .venv
.\.venv\Scripts\Activate.ps1      # Windows
pip install -r requirements.txt
$env:API_BEARER_TOKEN = "your-token"
$env:LLM_API_KEY = "your-gemini-key"     # optional; llm jobs fail gracefully without it
$env:LLM_MODEL = "gemini-3.5-flash-lite"
uvicorn app.main:app --port 8000

Tests: pytest -v (68 tests)

API

  • GET /health, GET /spec — public
  • POST /v1/reviews — submit a diff (bearer auth). Options: provider (mock|llm), maxFindings. Supports Idempotency-Key header.
  • GET /v1/reviews/{jobId} — poll status/findings
  • GET /v1/reviews/{jobId}/stream — SSE (status/finding/done), identical replay for finished jobs

Configuration (environment variables)

Var Purpose Default
API_BEARER_TOKEN auth token for /v1/* dev-token-change-me
LLM_API_KEY Google Gemini API key (unset → llm jobs fail gracefully)
LLM_MODEL Gemini model id gemini-3.5-flash-lite

Known limitations

  • In-memory storage: jobs, cache, idempotency records, and rate-limit state are lost on restart. Acceptable for the scoring window; production would use Redis/Postgres.
  • Single-process design: limits and caches are per-process.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages