You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LLM_PROVIDER=ollama
LLM_MODEL=mistral:latest
# No API key needed
Other OpenAI-Compatible APIs
LLM_PROVIDER=together # or groq, custom
LLM_API_KEY=your-key
LLM_BASE_URL=https://api.together.xyz/v1
LLM_MODEL=meta-llama/Llama-3-70b-chat-hf
Per-Agent Model Overrides
Optimize cost by using cheaper models for specific agents:
# Global (used by Architect)
LLM_MODEL=anthropic/claude-sonnet-4
# DS Team specialists use a cheaper model for script generation
DATA_SCIENTIST_MODEL=gpt-4o-mini
DATA_SCIENTIST_TEMPERATURE=0.3
Resolution order: UI model selection > per-agent .env setting > global default.
LLM Failover
Configure a fallback provider for resilience:
# Primary provider
LLM_PROVIDER=openrouter
LLM_API_KEY=sk-or-v1-your-key
LLM_MODEL=anthropic/claude-sonnet-4
# Fallback provider (used when primary fails after retries)
LLM_FALLBACK_PROVIDER=openai
LLM_FALLBACK_MODEL=gpt-4o
The circuit breaker opens after 5 consecutive failures and retries after a 60-second cooldown.
LLM Usage Tracking
Every LLM call is automatically tracked with token counts and estimated costs.
Dashboard
Navigate to LLM Usage in the sidebar to see:
Summary cards: total calls, tokens, estimated cost, models used
Daily trends: chart of token usage and cost over time
Per-model breakdown: usage and cost per model
Conversation costs: cost breakdown per conversation
API Endpoints
Method
Endpoint
Description
GET
/api/v1/usage/summary?days=30
Usage summary with cost
GET
/api/v1/usage/daily
Daily usage breakdown
GET
/api/v1/usage/models
Per-model usage
GET
/api/v1/usage/conversation/{id}
Conversation cost
Custom Pricing
Pricing data covers OpenAI, Anthropic, Google, Meta, DeepSeek, and Mistral models. The pricing table is in src/llm/usage.py (previously src/llm_pricing.py).
Environment Variables
Complete reference of all environment variables from src/settings.py: