Skip to main content

Overview

RAPTOR uses LiteLLM to provide unified access to multiple LLM providers. Configuration supports automatic model selection, fallback chains, and custom model routing for different task types.

Multi-Provider Support

Anthropic, OpenAI, Google Gemini, Mistral, and Ollama (local)

Automatic Model Selection

Best thinking model auto-selected from LiteLLM config

Fallback Chains

Automatic fallback to alternative models on failure

Task-Specific Routing

Route exploit generation to Opus, classification to Gemini

Quick Start

1. Install LiteLLM

2. Set API Keys

3. Run RAPTOR

That’s it! RAPTOR automatically:
  • Detects available API keys
  • Selects the best thinking model
  • Configures fallback chains
  • Tracks costs

Provider Configuration

Anthropic Claude

Models:
  • claude-opus-4.5 - Most capable, best for exploit generation ($15/M tokens)
  • claude-sonnet-4.5 - Balanced performance ($3/M tokens)
Setup:
Manual configuration:
Use Opus for deep security analysis and exploit generation. Use Sonnet for faster analysis at lower cost.

OpenAI GPT

Models:
  • gpt-5.2 - Latest GPT, strong reasoning ($5/M tokens)
  • gpt-5.2-thinking - Extended thinking mode ($6/M tokens)
Setup:
Manual configuration:

Google Gemini

Models:
  • gemini-3-pro - High capability ($0.10/M tokens)
  • gemini-3-deep-think - Reasoning mode ($0.20/M tokens)
Setup:
Manual configuration:
Important: Use LiteLLM aliases like gemini-3-pro, NOT underlying model IDs like gemini-3.0-pro-latest. LiteLLM handles version mapping.

Mistral

Models:
  • mistral-large-latest - Largest model ($2/M tokens)
Setup:
Manual configuration:

Ollama (Local Models)

Models: Any model you’ve pulled locally
  • llama3:70b - Meta’s Llama 3
  • mistral:latest - Mistral 7B
  • qwen2.5:72b - Alibaba’s Qwen
  • deepseek-coder:33b - DeepSeek Coder
Setup:
Manual configuration:
Local models are less reliable for exploit generation. RAPTOR warns:

LiteLLM Configuration File

Config File Location

RAPTOR searches for LiteLLM config in order:
  1. $LITELLM_CONFIG_PATH environment variable
  2. ~/.config/litellm/config.yaml (XDG standard)
  3. ~/Documents/ClaudeCode/litellm/config.yaml (dev default)
  4. /etc/litellm/config.yaml (system-wide, Linux/macOS only)

Config File Format

~/.config/litellm/config.yaml:

Automatic Model Selection

RAPTOR reads your LiteLLM config and auto-selects the best thinking model: Selection priority:
  1. Models with supports_reasoning: true get +10 score boost
  2. Opus models preferred over others
  3. Latest versions preferred
  4. Exact model matches preferred over aliases
Scoring system:
Example:
If you have multiple API keys configured, RAPTOR will automatically select the most capable model you have access to.

Fallback Configuration

Automatic Fallback Chains

RAPTOR builds fallback chains automatically based on available API keys:

Same-Tier Fallback Rule

Fallback stays within same tier:
  • Cloud → Cloud: Anthropic fails → try OpenAI → try Gemini
  • Local → Local: llama3:70b fails → try mistral:latest → try qwen2.5:72b
NEVER cross tiers:
  • Cloud ❌ Local: Claude fails → does NOT fall back to Ollama
  • Local ❌ Cloud: Ollama fails → does NOT fall back to Claude
Reasoning: If cloud provider is down, fix infrastructure or wait. Don’t silently switch to lower-quality local model.

Custom Fallback Chain

Disable Fallback

Task-Specific Model Routing

Specialized Models

Route different tasks to different models based on capability and cost:

Task Type Reference

Cost optimization strategy:
  • Use Opus for <20% of requests (critical reasoning)
  • Use Sonnet for ~60% of requests (balanced analysis)
  • Use Gemini for ~20% of requests (simple classification)
Typical scan cost breakdown: ~70% cheaper than Opus-only!

Retry and Rate Limiting

Retry Configuration

Exponential backoff:
Retry delays:

Quota Detection

Automatic detection of quota/rate limit errors:
Behavior on quota error:

Advanced Configuration

Temperature and Sampling

Max Tokens

Model limits:

Timeout

Long-running requests (exploit generation, deep analysis) may need higher timeout (300-600s).

Custom API Base

Example Configurations

High-Capability, High-Cost

Use case: High-value targets, production exploits needed
Use case: Most security research, good quality at reasonable cost

Low-Cost

Use case: Exploratory scans, learning, testing

Zero-Cost (Local)

Use case: Offline use, privacy-sensitive, unlimited requests

Troubleshooting

error
Error:
Fix: Set at least one API key:
error
Error:
Fix:
warning
Symptom: Auto-selection falls back to manual API key detectionCause: LiteLLM config file not found or emptyFix: Create ~/.config/litellm/config.yaml (see Config File Format above)
error
Error:
Fix:
error
Symptom: LiteLLM error about unknown modelCause: Using underlying model ID instead of LiteLLM aliasWrong:
Correct:

Further Reading

LiteLLM Documentation

Official LiteLLM documentation and model support

Provider Setup Guides

Detailed setup for each LLM provider

Cost Tracking

Budget enforcement and cost optimization strategies

Configuration Reference

Complete configuration options reference