AI Log Summaries
PocketMC parses multi-megabyte server log files and generates concise diagnostic incident reports using local Ollama models or external cloud providers. All logs pass through an offline privacy sanitizer before analysis.
Local Ollama Model Manager
For offline log analysis without sending server telemetry across the internet, PocketMC interfaces with a local or remote Ollama instance:
- Daemon Detection: Connects to
http://localhost:11434by default, verified via the OllamaGET /api/versionendpoint. You can also point PocketMC to a custom remote Ollama URL or an Ollama Cloud endpoint with an API key. - Model Catalog: Queries installed models and sizes on disk using
GET /api/tags. - Streaming Downloads: Pulls new models using
POST /api/pull, decoding streaming NDJSON chunks to display real-time download and layer extraction progress. - Recommended Models: Defaults to
qwen3:8bfor balanced reasoning and crash analysis, with support forllama3.2,qwen2.5-coder, or any custom tag installed on your host. - Zero Cloud Costs: Model inference executes entirely on your local GPU or CPU.
Cloud Provider Integrations
If you prefer cloud models with larger context windows for parsing massive modpack stack traces, PocketMC integrates with five external providers:
| Provider | Default Model | Typical Use Case |
|---|---|---|
| Google Gemini | gemini-3.8-flash | Large context windows capable of ingesting entire historical session logs in a single prompt. |
| OpenAI | gpt-4o-mini | Quick post-mortems and structured JSON extraction of crash causes. |
| Anthropic Claude | claude-3-5-haiku-latest | Detailed root-cause analysis of complex Java exceptions and conflicting mod bytecode. |
| Mistral | mistral-large-latest | High-accuracy reasoning and multi-language error message diagnosis. |
| Groq | llama-3.3-70b-versatile | Ultra-low latency inference returning summaries within seconds of a server crash. |
Cloud provider API keys are encrypted with Windows DPAPI v2 and stored securely in settings.json.
Automated Offline Log Sanitization
Raw server logs frequently record sensitive operational data, including public player IP addresses, webhook credentials, and local Windows usernames. Before any log excerpt is submitted to a local or cloud LLM, PocketMC's internal LogSanitizer service filters the text in memory:
- ANSI Code Stripping: Removes terminal formatting and escape sequences (
\x1B\[[0-9;]*[a-zA-Z]) to clean up raw console output. - IP Redaction: Matches IPv4 patterns (
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b) and replaces them with[IP_REDACTED]while preserving Minecraft server timestamp formatting. Matches IPv6 addresses and replaces them with[IPV6_REDACTED]. - Credential Redaction: Redacts email addresses (
[EMAIL_REDACTED]), Discord webhook URLs, secret bearer tokens, and Playit claim URLs (https://playit.gg/claim/[REDACTED]). - Filesystem Normalization: Replaces Windows user profile folder paths (for example,
C:\Users\username\AppData) with generalized placeholders (C:\Users\USER\AppData) to prevent exposing your Windows user account name.
Incident Reporting Workflow
When an unexpected server crash occurs:
- PocketMC captures the trailing console output lines and the most recent crash report from the server's
crash-reports/directory. - The content is sanitized in memory by
LogSanitizer. - A prompt containing the sanitized stack trace is dispatched to your configured AI model.
- The resulting diagnosis outlines the crashing mod or plugin, the exact Java exception, and actionable steps to resolve the issue. If Discord webhook notifications are configured, the summary is posted directly to your staff channel.