AI Providers
The platform uses LLM providers across the AI audit, reporting insights, keyword expansion, and campaign narratives. Providers are configured in the admin panel, with environment variables as fallbacks.
Supported providers
Section titled “Supported providers”| Provider | provider_type |
Notes |
|---|---|---|
| OpenAI | openai |
Default |
| Anthropic | anthropic |
|
| Google Gemini | google |
|
| OpenAI-compatible | base_url |
Any AI_BASE_URL (e.g. vLLM, Ollama, local models) |
Where the config lives
Section titled “Where the config lives”The admin panel (/admin/settings) holds the source of truth in the ai_provider PlatformSetting:
| Field | Purpose |
|---|---|
enabled |
Master switch |
provider_type |
openai / anthropic / google / custom |
api_key |
Provider key |
base_url |
OpenAI-compatible endpoint |
default_model |
Model name |
max_tokens |
Output cap |
temperature |
Sampling temperature |
Environment fallbacks
Section titled “Environment fallbacks”Env vars are only consulted when the setting is unconfigured — they never auto-enable a provider when the setting is absent and the user hasn’t opted in. When unconfigured, GET /v1/settings/ai_provider returns enabled: null.
API key resolution order (_env_api_key):
AI_API_KEY(explicit override)- Provider-specific:
ANTHROPIC_API_KEYforanthropic,GEMINI_API_KEYforgoogle OPENAI_API_KEYotherwise
Behavior when unavailable
Section titled “Behavior when unavailable”AI is a best-effort enhancement, never a blocker:
- AI audit — skipped with a warning (
ai_audit_skipped_not_enabled) when AI is disabled. - Reports — fall back to deterministic, finding-specific AI sections and log
report_ai_deterministic_fallback(withscan_id). - Provider construction — logs
report_ai_provider_unavailablewithreason(ai_disabled/missing_api_key) andprovider_type. - Insights — skipped (
ai_insights_skipped_no_provider) when no provider is configured.