# Genesis LiteLLM Configuration
# AI Gateway for OpenClaw + Genesis Infrastructure

model_list:
  # ============================================
  # TIER 1: ARCHITECT (Strategic Decisions)
  # Use sparingly - highest capability + cost
  # ============================================
  - model_name: opus
    litellm_params:
      model: anthropic/claude-sonnet-4-20250514
      api_key: os.environ/ANTHROPIC_API_KEY
    model_info:
      description: "Opus 4.5 - Architect tier for strategic decisions"
      tier: architect

  # ============================================
  # TIER 2: WORKER (Standard Tasks)
  # Primary workhorse models
  # ============================================
  - model_name: sonnet
    litellm_params:
      model: anthropic/claude-sonnet-4-20250514
      api_key: os.environ/ANTHROPIC_API_KEY
    model_info:
      description: "Claude Sonnet - Standard worker"
      tier: worker

  - model_name: gemini-flash
    litellm_params:
      model: gemini/gemini-2.0-flash
      api_key: os.environ/GEMINI_API_KEY
    model_info:
      description: "Gemini Flash 2.0 - Fast cheap worker"
      tier: worker

  # ============================================
  # TIER 3: SWARM (Parallel Execution via OpenRouter)
  # For massive parallel tasks
  # ============================================
  - model_name: kimi
    litellm_params:
      model: openrouter/moonshotai/kimi-k2.5
      api_key: os.environ/OPENROUTER_API_KEY
      extra_headers:
        HTTP-Referer: "https://genesis-system.ai"
        X-Title: "Genesis OpenClaw"
    model_info:
      description: "Kimi 2.5 - 100 agent swarm capability"
      tier: swarm

  - model_name: haiku
    litellm_params:
      model: anthropic/claude-3-5-haiku-20241022
      api_key: os.environ/ANTHROPIC_API_KEY
    model_info:
      description: "Claude Haiku - Fast validation"
      tier: swarm

  # ============================================
  # ALIASES (For OpenClaw compatibility)
  # ============================================
  - model_name: gpt-4
    litellm_params:
      model: anthropic/claude-sonnet-4-20250514
      api_key: os.environ/ANTHROPIC_API_KEY
    model_info:
      description: "GPT-4 alias → routes to Sonnet"

  - model_name: gpt-4o
    litellm_params:
      model: anthropic/claude-sonnet-4-20250514
      api_key: os.environ/ANTHROPIC_API_KEY
    model_info:
      description: "GPT-4o alias → routes to Sonnet"

  - model_name: claude-3-opus
    litellm_params:
      model: anthropic/claude-sonnet-4-20250514
      api_key: os.environ/ANTHROPIC_API_KEY
    model_info:
      description: "Opus alias → routes to Opus 4.5"

# ============================================
# ROUTER SETTINGS
# ============================================
router_settings:
  routing_strategy: "simple-shuffle"  # or "least-busy", "latency-based-routing"
  num_retries: 3
  retry_after: 5
  timeout: 120
  allowed_fails: 2

# ============================================
# GENERAL SETTINGS
# ============================================
general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
  database_url: os.environ/DATABASE_URL

  # Enable caching via Redis
  cache: true
  cache_params:
    type: redis
    host: os.environ/REDIS_HOST
    port: os.environ/REDIS_PORT
    password: os.environ/REDIS_PASSWORD

  # Logging
  success_callback: ["langfuse"]  # Optional: for observability
  failure_callback: ["langfuse"]

# ============================================
# GUARDRAILS (Basic - Presidio handles PII)
# ============================================
guardrails:
  - prompt_injection  # Basic injection detection
