Files
openrabbit/docs/configuration.md
Latte 7cc5d26948
All checks were successful
CI / ci (push) Successful in 9s
Deploy / deploy-local-runner (push) Has been skipped
Deploy / deploy-ssh (push) Successful in 7s
Docker / docker (push) Successful in 6s
Security / security (push) Successful in 7s
Add AI_PROVIDER and AI_MODEL support
2026-03-01 19:56:14 +01:00

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:

  1. Edit .github/workflows/ai-comment-reply.yml and ai-chat.yml (for GitHub)
  2. Edit .gitea/workflows/ai-comment-reply.yml and ai-chat.yml (for Gitea)
  3. 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"