Deploy selfreview
Self-hosted AI code reviewer for GitHub PRs, using cheap open models
Just deployed
Just deployed
/var/lib/postgresql/data
worker
Just deployed
Just deployed
Deploy and Host Selfreview on Railway
Selfreview is a self-hosted AI code reviewer for GitHub. Open a pull request and it posts line-level comments on real bugs (security holes, broken logic, async mistakes, money math), each saying what breaks and how to fix it. By default it uses cheap open models through OpenRouter, so a review typically costs $0.002–0.007.
About Hosting Selfreview
This template deploys one Docker image as three services, plus Postgres:
- api receives GitHub webhooks and serves the setup page and the dashboard. It has a public domain and a healthcheck on
/health. - worker reviews pull requests. When it's redeployed, it gets 120 seconds to finish the review it's working on.
- cron runs every 10 minutes. It resends webhooks GitHub failed to deliver and tracks which comments were acted on.
- Postgres is both the job queue and the database. It stores metadata only, never code.
Each service takes its role from its service name. ADMIN_PASSWORD and ENCRYPTION_KEY are generated for you, and the only value you provide is an OpenRouter API key.
After deploying:
- Open the api service's URL and log in with
ADMIN_PASSWORDfrom the api's Variables tab. - Click Create GitHub App and choose your personal account or an organization. GitHub creates the app with every setting filled in.
- Install the app on the repositories you want reviewed, then open a pull request.
The project costs about $3 a month while idle.
Common Use Cases
- Review every pull request in a small team without paying per seat.
- Keep your code on your own infrastructure, sent only to the model provider you choose, or to your own vLLM or Ollama server.
- Cap AI review spending with a per-review limit and a monthly budget.
- Try different models on your own PRs: pick a model per repo in
.selfreview.yml, and see the cost and how often comments were acted on in the dashboard.
Dependencies for Selfreview Hosting
- An OpenRouter API key, or an Anthropic, OpenAI or OpenAI-compatible key set on the worker
- A GitHub account or organization to create the GitHub App on
Deployment Dependencies
- Source code: https://github.com/hackertron/selfreview
- Architecture: https://github.com/hackertron/selfreview/blob/main/docs/ARCHITECTURE.md
- OpenRouter API keys: https://openrouter.ai/keys
- Example review: https://github.com/selfreviewhq/demo/pull/2
Why Deploy Selfreview on Railway?
Selfreview needs a public webhook endpoint, a background worker that can finish long jobs during a redeploy, a scheduled job and a database. On Railway these are four services in one project, created from one template, with private networking between them and generated secrets. When your team grows, add worker replicas.
Template Content
worker
hackertron/selfreviewOPENROUTER_API_KEY
Your OpenRouter API key (openrouter.ai/keys). Reviews use cheap open models, about $0.002-0.007 each.
