AI
Chat in StatsRaven and the names it gives log patterns come from an AI model you choose. You can also use no AI in StatsRaven at all and ask through Claude over MCP.
Choose a provider
In Settings, AI, pick one:
- Anthropic, with an API key. The default chat model is Claude Opus 5.5 and the pattern naming model is Claude Haiku 5.5. A gateway address can be set too.
- OpenAI-compatible: OpenAI, Google Gemini, Mistral, OpenRouter, a local Ollama or vLLM, or any other address that speaks the OpenAI chat API. The key is optional for local servers.
- None: Claude over MCP only.
Test connection checks the key and model, and Load models lists what the provider offers. Settings apply without a restart. The key stays on your server; requests go from there straight to the provider.
The same can come from the environment, for example in /etc/statsraven/statsraven.env. A value saved in Settings wins.
| Variable | What it sets |
|---|---|
ANTHROPIC_API_KEY | The Anthropic key |
ANTHROPIC_BASE_URL | A gateway in front of Anthropic |
STATSRAVEN_CHAT_MODEL | The chat model |
STATSRAVEN_LLM_MODEL | The pattern naming model |
STATSRAVEN_CHAT_DAILY_TOKENS | Daily token limit for chat, 1,000,000 unless set |
STATSRAVEN_LLM_DAILY_TOKENS | Daily token limit for pattern naming, 200,000 unless set |
When a limit is reached, that feature waits until midnight UTC.
Pattern naming
StatsRaven groups log lines into patterns. Every few minutes it asks the naming model to name patterns seen at least three times, so you can ask about "failed checkouts" instead of a raw line. Turn it off in Settings, AI; you can still name patterns yourself or let Claude do it over MCP.
What the provider sees
- For pattern naming: only pattern templates, with numbers, addresses and IDs already replaced by placeholders. Never events or raw lines.
- For chat: the list of your projects and fields, named patterns, what you taught StatsRaven, your questions, and the results of the queries the chat runs, which can include paths, referrers, browser families and event fields. Log search results have IP addresses and emails masked. For editors and viewers, fields you marked sensitive are replaced by codes before anything leaves.