Running 22 LLM agents 24/7 without going broke: habit-first, salience gates, shared cached prefix

Jealous-Asparagus518 · reddit · 2026-09-12

A developer running a persistent island of 22 AI citizens (1 sim minute = 1 real minute, potentially 31,680 calls/day) published their actual cost-saving architecture: habit-first execution in code for routine minutes, a salience gate that only triggers model calls on notable perceptions, a model ladder (Haiku 4.5 for routine thoughts, bigger models for high-stakes decisions and nightly reflection) with a daily ceiling, shared cached prefixes padded past Haiku's 4,096-token minimum plus persona blocks, and strict JSON schemas (strip nulls for openai/ models on OpenRouter or they 400). Hard-won lesson: every non-Anthropic model stalled the island at 06:00 due to missing request timeouts—add AbortSignal first. Everything is Apache-2.0 open source with a keyless mock brain.

Original post →

More from coding & agent

coding & agent channel →