Get PR-Agent running with local Ollama in 2 minutes.
- Docker or Podman
- Ollama instance with a model (e.g.,
codestral:22b) - Git provider access token (Gitea, GitHub, or GitLab)
docker pull ghcr.io/tobend/pr-agent:latestReplace the placeholder values:
docker run --rm \
-e CONFIG.GIT_PROVIDER=gitea \
-e GITEA.URL=https://your-gitea.com \
-e GITEA.PERSONAL_ACCESS_TOKEN=your-token \
-e OPENAI.API_BASE=https://your-ollama.com/v1 \
-e OPENAI.KEY=dummy \
-e CONFIG.MODEL=openai/codestral:22b \
ghcr.io/tobend/pr-agent:latest \
--pr_url="https://your-gitea.com/owner/repo/pulls/1" review| Command | Description |
|---|---|
review |
Full code review with issues and score |
describe |
Generate PR description |
improve |
Suggest code improvements |
Gitea:
-e CONFIG.GIT_PROVIDER=gitea
-e GITEA.URL=https://...
-e GITEA.PERSONAL_ACCESS_TOKEN=...
GitHub:
-e CONFIG.GIT_PROVIDER=github
-e GITHUB.USER_TOKEN=...
GitLab:
-e CONFIG.GIT_PROVIDER=gitlab
-e GITLAB.URL=https://...
-e GITLAB.PERSONAL_ACCESS_TOKEN=...
codestral:22b- Best for code reviewqwen2.5-coder:14b- Good alternativemistral:latest- Lightweight
"Failed to parse review data"
- Ensure Ollama is v0.5+ (supports json_schema)
- Check model is loaded:
curl your-ollama:11434/api/tags
Connection refused
- Verify Ollama is accessible from Docker
- Check firewall/network settings
See README.md for full documentation.