My product Open source
DevFlow-AI
AI code review, auto-fix & CI/CD — on your own servers
DevFlow-AI is a self-hosted platform that reviews pull requests with AI, proposes and applies fixes, and runs CI/CD for GitHub and GitLab — while guaranteeing the AI never changes a repository without permission.
Built for: Engineering teams on GitHub or GitLab who want AI help in code review but must keep code private and changes controlled.
↓ Scroll to explore the problem, architecture and stack
The problem
Code review is slow and inconsistent, and most AI review tools either send your code to a third-party cloud or are allowed to push changes by themselves. Teams that care about privacy and control end up choosing between speed and safety.
Why it matters
DevFlow-AI runs on your own infrastructure, works with free models (with a fully local fallback), and puts every write behind an approval rules engine. Teams get fast, consistent reviews without giving up control of their code — or their budget.
What you can do with it
How it’s built
A simplified view of the architecture — follow the dots as a request moves down the layers.
A request, step by step
- A pull request opens and GitHub / GitLab calls the webhook.
- FastAPI records the event and queues a review job on Celery.
- The agent loop runs the reviewer roles; the LLM router picks a free model and cools down any that hit rate limits.
- Code is analysed inside a no-network, read-only Docker sandbox.
- Every write (comment, fix, pipeline) goes through the MCP gateway and the go / ask / stop rules — risky actions wait for a human.
- Results post back to the PR; traces and AI usage land in Grafana.
Tech stack
What I built
- 132 API endpoints, 31 database tables, 30 Celery background tasks and 17 Docker services.
- A framework-free tool-calling agent loop for 9 roles (analyst, fixer, code reviewer, security reviewer…) with JSON-schema-validated output, token budgets and AST checks that suggested code still fits its callers.
- An LLM router across 90 free models from 10 providers, with automatic cool-downs on rate limits and a local Ollama fallback.
- An MCP gateway that sends every GitHub / GitLab write through 57 allow-listed tools, one-time keys and a deny-by-default go / ask / stop rules engine.
- No-network, read-only Docker sandboxes for every review run.
- A Next.js 16 / React 19 / Tailwind console with live pipeline graphs, approvals and AI usage.
- OpenTelemetry tracing for FastAPI, Celery, SQLAlchemy and httpx into Grafana — 2 dashboards and 8 alert rules as code.
- 392 unit tests, 67 API end-to-end tests and 43 Playwright tests running in GitHub Actions and GitLab CI.
Hard problems & how I solved them
✅ Every write is a tool call through one MCP gateway — 57 allow-listed tools, one-time keys and a deny-by-default go / ask / stop rules engine.
✅ The router spreads work across 90 models from 10 providers, cools down any that return rate-limit errors, and falls back to local Ollama.
✅ Output is validated against JSON schemas, kept inside token budgets, and checked with AST analysis so a change still fits its callers.