← Back to all projects
🤖

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.

132 API endpoints9 agent roles90 free models502 tests

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

01Get an automatic AI review on every pull / merge request — summary, risks and line-level comments.
02Ask specialised reviewers (code quality, security, analyst) for focused feedback.
03Let the fixer agent propose a patch, then approve, reject or ask for changes before anything is written.
04Run CI/CD pipelines and watch them live on a pipeline graph.
05Control cost and privacy: route across 90 free models from 10 providers, or stay fully local with Ollama.
06See AI usage, approvals and traces in a web console and Grafana dashboards with alerts.

How it’s built

A simplified view of the architecture — follow the dots as a request moves down the layers.

Sources
GitHubwebhooks
GitLabwebhooks
Web consoleNext.js 16
API
FastAPI132 endpoints
Rules enginego / ask / stop
Workers
Celery30 tasks
Agent loop9 roles
LLM router90 models · Ollama
Safety
MCP gateway57 allow-listed tools
Docker sandboxno network · read-only
Data & ops
PostgreSQL31 tables
Redis
OpenTelemetry → Grafana

A request, step by step

  1. A pull request opens and GitHub / GitLab calls the webhook.
  2. FastAPI records the event and queues a review job on Celery.
  3. The agent loop runs the reviewer roles; the LLM router picks a free model and cools down any that hit rate limits.
  4. Code is analysed inside a no-network, read-only Docker sandbox.
  5. Every write (comment, fix, pipeline) goes through the MCP gateway and the go / ask / stop rules — risky actions wait for a human.
  6. Results post back to the PR; traces and AI usage land in Grafana.

Tech stack

Backend
PythonFastAPISQLAlchemy 2Celery
Data
PostgreSQLRedis
AI
MCPOllamaLLM router (10 providers)🤖AI agents
Frontend
Next.jsReactTailwind CSS
Platform
DockerGitHub ActionsGitLab CI
Observability
OpenTelemetryGrafana
Testing
pytestPlaywright

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

❓ How do you stop an AI from changing code on its own?

✅ 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.

❓ Free models hit rate limits constantly.

✅ The router spreads work across 90 models from 10 providers, cools down any that return rate-limit errors, and falls back to local Ollama.

❓ How do you trust AI-written code?

✅ Output is validated against JSON schemas, kept inside token budgets, and checked with AST analysis so a change still fits its callers.