The 6 a.m. log digest: an old laptop and a small model finally read your container logs





The 6 a.m. log digest: an old laptop and a small model finally read your container logs

Your monitoring stack tells you whether things are alive. Your logs tell you why they’re quietly rotting — and nobody reads them. A homelab running thirty-odd containers produces more log noise per day than any human will voluntarily grep through, so in practice the logs go unread until something breaks badly enough to page. The interesting experiment that inspired this piece does something about that: a nine-year-old laptop, a 3 GB local model, and a cron job that reads the last 24 hours of container logs every morning at six and posts an eight-bullet digest. No GPU, no cloud, no subscription.

The hardware matters less than you think

The host is a 2016 Dell Latitude — an i5-6300U, 12 GB of RAM after an upgrade, no discrete GPU — running the same lab whose logs it reads. The model is a small ~3B-class instruction model in Q4_K_M on llama.cpp, which occupies around 3 GB of memory while loaded. Since that’s a third of the machine’s RAM, the setup doesn’t keep it resident: a container starts, loads the model, produces the report, and gets torn down. Total run time: under two minutes a day, at roughly 10 tokens per second of generation on that old CPU.

The lesson generalises. The barrier to useful local LLM work in a homelab was never the model’s intelligence — it’s that people try to keep a model loaded like a database instead of running it like a cron job. Batch, run, exit. A decade-old laptop is genuinely enough.

The pipeline is the clever part, not the model

Thirty containers can’t be fed raw into a small model, and don’t need to be. The filtering does the heavy lifting before the model ever sees a line:

  • Only the last 24 hours of logs, only lines matching error keywords — error, fail, denied, timeout.
  • An ignore list for containers you’re deliberately experimenting on.
  • Duplicate lines counted, ranked, and collapsed — one noisy restart becomes “this line, 400 times.”
  • Numbers masked, so errors differing only by port or request ID collapse into one.
  • The whole payload capped (around 12,000 characters) before it reaches the model.

The skeleton of it is one honest pipeline command:

docker logs --since 24h "$c" 2>&1 \
  | grep -Ei 'error|fail|denied|timeout' \
  | sed -E 's/[0-9]+/N/g' \
  | sort | uniq -c | sort -rn | head -n 30

Concatenate that across containers, cap it, hand it to the model with a prompt like “summarise as at most eight bullets, ranked by likely impact,” and push the result to ntfy. One glance with your morning coffee and you know whether anything actually happened overnight.

One practical gotcha from the original build: invoking the model through llama-cli dropped it into an interactive prompt that silently ate the token budget and produced nonsense. Switching to llama-server with a plain HTTP call fixed it. Non-interactive means non-interactive — verify it, don’t assume it.

Where it goes wrong — and the fix is state, not scale

The digests were genuinely useful: they correctly flagged an unhealthy DNS container, a stale docker network left over from a wiki experiment, and recurring errors the author would otherwise never have seen. But the failure modes are instructive:

  • No memory of yesterday. The model sees each morning fresh, so a harmless recurring error reappears in every digest as if new. Fix: persist yesterday’s digest and diff — “only report what’s new or changed.”
  • Confident overgeneralisation. Eighteen TLS handshake errors and two failed upstream queries became, in one report, all “errors when querying external DNS servers.” A 3B model summarising will flatten detail. Fix: ask for line counts per pattern verbatim, not just prose.
  • Masking has a cost. Number-masking collapsed distinct errors together — Quad9 became “QuadN” — and long lines were truncated. Fix: keep one unmasked exemplar line per pattern for the report’s appendix.

Notice that none of these fixes involve a bigger model. They involve giving a small model better state and better instructions. That’s the repeatable insight: prompt engineering and pipeline engineering are the same discipline here.

Why this beats another dashboard

Uptime Kuma and friends answer “is it up?” This answers “is it degrading?” — certificates quietly failing to renew, OOM kills at 3 a.m., backup jobs that error without failing, upstream DNS flakiness that never quite crosses a threshold. None of those page you. All of them show up in logs you weren’t reading.

And because the model runs on your own hardware over your own logs, nothing leaves the LAN. For a small business homelab with anything sensitive in those containers, that’s not a nice-to-have; it’s the reason this design is even on the table.

Build yours this weekend

  • Any old laptop or NUC with 8 GB+ RAM, llama.cpp, and a small Q4 GGUF model.
  • Cron at 6 a.m.: filter, dedupe, cap, summarise, push to ntfy (or Telegram, or email).
  • Container run-then-remove so the model costs nothing at idle.
  • Store yesterday’s digest and diff against it before summarising.
  • After a week, prune the ignore list — your future self will thank you for every entry.

The point isn’t that an LLM replaced you. It’s that your logs finally have a first reader, so you can stay the second one — reading eight curated bullets instead of pretending you’ll grep thirty containers some day.


Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Appliance - Powered by TurnKey Linux