👻 The Séance Engine: Finding the Ghost in the Data with TabPFN & Gemma
说明与用途
一个 Python 自动化脚本读取一天的系统日志,使用 TabPFN 标记最异常的条目,并调用本地 Gemma 生成幽灵故事,全部在本地运行。
问题
Detect anomalous system log entries on a personal machine without sending data externally.
结果
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.
工作流
- 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
证据
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.
- 记录日期: 2026-11-01T12:29:13.826Z