👻 The Séance Engine: Finding the Ghost in the Data with TabPFN & Gemma
Description and use
A Python automation script reads a day of system logs, uses TabPFN to flag the most anomalous entry, and prompts local Gemma to generate a ghostly narrative, all running locally.
Problem
Detect anomalous system log entries on a personal machine without sending data externally.
Outcome
The pipeline identifies a 3 AM log entry with 98% CPU as anomalous and produces a whimsical narrative about a ghostly process, all running locally in ~1 min.
Workflow
- Load CSV of 24 hourly log rows
- For each row, perform leave‑one‑out evaluation with TabPFN: train on 23 real rows + noise, predict p_real for held‑out row
- Identify row with lowest p_real as anomaly
- Prompt local Gemma model via Ollama to generate a ghostly story incorporating the anomaly details
- Output story to terminal and record trace in Sentry
- Optional: run with SENTRY_DSN to capture metrics
Evidence
Everything runs on my laptop: one Python file, about 100 lines.
The anomalous row, including its p_real score, goes into a prompt that asks Gemma to speak as a gossipy, theatrical ghost…
The trace showed me something I didn’t expect: the leave-one-out TabPFN scan (24 small fits on CPU) took 38 seconds, and Gemma took about a minute.
- Record date: 2026-11-01T12:29:13.826Z