5.2 KiB
5.2 KiB
Configuration Reference
All configuration is managed in tools/ai-review/config.yml.
Provider Settings
The provider and model can be configured via Gitea secrets, so you don't need to edit config.yml per deployment:
| Secret | Description | Example values |
|---|---|---|
AI_PROVIDER |
Which LLM provider to use | openai, openrouter, ollama, anthropic, azure, gemini |
AI_MODEL |
Model for the active provider | gpt-4.1-mini, claude-3-5-sonnet-20241022, google/gemini-2.0-flash |
These secrets override the values in config.yml, which serve as fallback defaults.
# LLM Provider: openai | openrouter | ollama | anthropic | azure | gemini
# Override with the AI_PROVIDER Gitea secret.
provider: openai
# Model per provider
# Override the active provider's model with the AI_MODEL Gitea secret.
model:
openai: gpt-4.1-mini
openrouter: anthropic/claude-3.5-sonnet
ollama: codellama:13b
anthropic: claude-3-5-sonnet-20241022
azure: gpt-4
gemini: gemini-1.5-pro
# Generation settings
temperature: 0 # 0 = deterministic
max_tokens: 4096 # Max response tokens
Review Settings
review:
fail_on_severity: HIGH # Fail CI on this severity
max_diff_lines: 800 # Truncate large diffs
inline_comments: true # Post inline PR comments
security_scan: true # Run security scanner
Agent Configuration
Issue Agent
agents:
issue:
enabled: true
auto_label: true # Apply labels automatically
auto_triage: true # Run triage on new issues
duplicate_threshold: 0.85 # Similarity threshold
events:
- opened
- labeled
PR Agent
agents:
pr:
enabled: true
inline_comments: true # Post inline comments
security_scan: true # Run security scanner
events:
- opened
- synchronize
Codebase Agent
agents:
codebase:
enabled: true
schedule: "0 0 * * 0" # Cron schedule (weekly)
Chat Agent (Interactive Chat Agent)
agents:
chat:
enabled: true
name: "CodeBot" # Display name for the bot
max_iterations: 5 # Max tool calls per chat
tools:
- search_codebase # Search repository files
- read_file # Read file contents
- search_web # Web search via SearXNG
searxng_url: "" # SearXNG instance URL (or use SEARXNG_URL env var)
Interaction Settings
Customizing the Bot Name
The mention_prefix controls what trigger the bot responds to. You can change it to any name you prefer:
interaction:
mention_prefix: "@bartender" # Users will type @bartender to invoke the bot
Important: When changing the bot name, you must also update the workflow files:
- Edit
.github/workflows/ai-comment-reply.ymlandai-chat.yml(for GitHub) - Edit
.gitea/workflows/ai-comment-reply.ymlandai-chat.yml(for Gitea) - Change the
if:condition to match your new prefix:if: contains(github.event.comment.body, '@bartender')
Example bot names:
@codebot- Default, generic@bartender- Friendly, conversational@uni- Short, quick to type@joey- Personal assistant@codebot- Technical focus
interaction:
respond_to_mentions: true
mention_prefix: "@codebot"
commands:
- explain # Explain code/issue
- suggest # Suggest solutions
- security # Run security check
- summarize # Summarize content
Label Mappings
labels:
priority:
high: "priority: high"
medium: "priority: medium"
low: "priority: low"
type:
bug: "type: bug"
feature: "type: feature"
question: "type: question"
docs: "type: documentation"
status:
ai_approved: "ai-approved"
ai_changes_required: "ai-changes-required"
ai_reviewed: "ai-reviewed"
Enterprise Settings
enterprise:
audit_log: true
audit_path: "/var/log/ai-review/"
metrics_enabled: true
rate_limit:
requests_per_minute: 30
max_concurrent: 4
Security Configuration
security:
enabled: true
fail_on_high: true
rules_file: "security/security_rules.yml" # Custom rules
Environment Variables
These override config file settings:
| Variable | Description |
|---|---|
AI_PROVIDER |
Override the active provider (e.g. openrouter, anthropic) |
AI_MODEL |
Override the model for the active provider |
AI_REVIEW_TOKEN |
Gitea/GitHub API token |
AI_REVIEW_API_URL |
API base URL (https://api.github.com or Gitea URL) |
AI_REVIEW_REPO |
Target repository (owner/repo) |
OPENAI_API_KEY |
OpenAI API key |
OPENROUTER_API_KEY |
OpenRouter API key |
OLLAMA_HOST |
Ollama server URL |
SEARXNG_URL |
SearXNG instance URL for web search |
AI_AUDIT_PATH |
Audit log directory |
Per-Repository Overrides
Create .ai-review.yml in repository root:
# Override global config for this repo
agents:
pr:
security_scan: false # Disable security scan
issue:
auto_label: false # Disable auto-labeling
# Custom labels
labels:
priority:
high: "P0"
medium: "P1"
low: "P2"