Async HTTP service that reviews unified diffs and returns structured findings. Built with Python / FastAPI / asyncio. All state is in-memory.
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)
GET /health,GET /spec— publicPOST /v1/reviews— submit a diff (bearer auth). Options:provider(mock|llm),maxFindings. SupportsIdempotency-Keyheader.GET /v1/reviews/{jobId}— poll status/findingsGET /v1/reviews/{jobId}/stream— SSE (status/finding/done), identical replay for finished jobs
| 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 |
- 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.