Operations & Safety

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:11434 by default, verified via the Ollama GET /api/version endpoint. 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:8b for balanced reasoning and crash analysis, with support for llama3.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:

ProviderDefault ModelTypical Use Case
Google Geminigemini-3.8-flashLarge context windows capable of ingesting entire historical session logs in a single prompt.
OpenAIgpt-4o-miniQuick post-mortems and structured JSON extraction of crash causes.
Anthropic Claudeclaude-3-5-haiku-latestDetailed root-cause analysis of complex Java exceptions and conflicting mod bytecode.
Mistralmistral-large-latestHigh-accuracy reasoning and multi-language error message diagnosis.
Groqllama-3.3-70b-versatileUltra-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:

  1. PocketMC captures the trailing console output lines and the most recent crash report from the server's crash-reports/ directory.
  2. The content is sanitized in memory by LogSanitizer.
  3. A prompt containing the sanitized stack trace is dispatched to your configured AI model.
  4. 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.