All posts

The Token Economy: What Running a Three-Tier AI Power Grid Actually Costs

Updated November 26, 2026

The Token Economy: What Running a Three-Tier AI Power Grid Actually Costs

A single MCP tool call was eating 10,700 tokens. Every time MemBrane captured a fact or loaded context into a Claude session, it consumed roughly 5% of the available context window. Not because the operation was complex. Because 768-dimensional embedding arrays were being serialized into every response, and nobody had told the serializer to stop.

The fix took an afternoon. Exclude embedding fields from MCP response serialization, restructure the response format, return only what the caller needs. The result: 1,545 tokens per call. An 86% reduction. Session capacity improved 7x overnight.

That single optimization taught me more about AI economics than any pricing page ever will. The expensive part of running personal AI infrastructure isn't the model you choose. It's the invisible waste baked into every interaction between your tools. And once you start measuring, the waste is everywhere.

Three energy sources feeding a central dispatch hub through colored conduits

Three Models, One Budget

I run three Claude models in production. Opus 4.6 at $5/$25 per million tokens (input/output). Sonnet 4.6 at $3/$15. Haiku 4.5 at $1/$5. The pricing alone tells you something: Opus output costs five times what Haiku output costs. Using Opus to read a file and summarize its contents is like dispatching a nuclear engineer to flip a light switch.

The power grid analogy isn't decorative here. It's structurally precise. A grid operator doesn't try to generate less electricity. They try to ensure every watt gets consumed by the right load at the right cost. Nuclear provides baseload. Solar and wind fill variable demand. Peaker plants fire only when everything else is maxed out. Economic dispatch algorithms route power where it's needed, at the lowest marginal cost that meets the quality requirement.

My model delegation strategy works the same way:

Haiku 4.5 handles 70-80% of all work. File operations, bash commands, MCP tool calls, data processing, step-by-step execution workflows. Haiku is the baseload generator. It runs constantly, handles predictable loads, and costs almost nothing per unit of output. Every MCP tool call, every file read, every grep and glob operation -- all of this is Haiku territory. The moment you let Opus or Sonnet execute a routine file operation, you've dispatched a peaker plant to serve baseload demand.

Sonnet 4.6 handles 15-25%. Multi-step reasoning, semantic analysis, code generation requiring nuanced judgment. Sonnet is the mid-merit generator. More expensive than baseload, but necessary when the task exceeds Haiku's analytical capability. Content generation is the canonical example: you need genuine analytical depth to produce writing that isn't hollow, but you don't need Opus-level reasoning to do it.

Opus 4.6 handles 5-10%. Strategic orchestration, architectural decisions, novel problem-solving, deep cross-domain synthesis. Opus is the peaker plant. You never want it running idle. When it fires, it should be doing work that nothing cheaper can handle. Planning, quality evaluation, and decisions where getting it wrong has compounding consequences.

This isn't theoretical. It's enforced in my daily workflow. Before performing any task, the operating principle is: "Should Haiku do this?" If the answer is yes (and it usually is), the work gets delegated downward. The decision matrix is simple: if the task is execution (reading, writing, running commands, calling tools), it goes to Haiku. If it requires analytical judgment, Sonnet. If it requires strategic reasoning or novel synthesis, Opus.

The Subagent Pattern

The delegation mechanism is concrete. When Opus is running as the session model and encounters a utility task, it spawns a Haiku subagent via the CLI:

claude -p --model haiku "Read the file at /path/to/config.json and extract the port number"

For longer, multi-line prompts:

claude -p --model haiku "$(cat <<'EOF'
Your multi-line prompt here.
Include all context needed since each call is stateless.
EOF
)"

The subagent executes, returns its result, and terminates. Opus never touched the file. Its context window never loaded the file contents. The token cost of the operation dropped from whatever Opus would have charged to process and respond, down to Haiku's rate for a simple extraction.

There's an important nuance here: the CLI wrapper is stateless. Each invocation is a fresh context with no memory of previous calls. This means you need to provide complete, self-contained prompts. You can't say "now do the same thing for the other file." You have to spell out exactly what you want, every time. The tradeoff is worth it. Statelessness means no context window accumulation, no token debt from prior interactions bleeding into the current one.

A large outer ring delegating small beams to nested inner rings

This pattern compounds. Consider a blog post creation workflow. Opus orchestrates the overall process: deciding the structure, evaluating quality, making editorial judgments. Sonnet handles the content generation phase, where you need genuine analytical capability to produce writing that isn't hollow. Haiku handles everything else: reading source files, writing to disk, running git commands, making API calls, executing deployment scripts, verifying the result with Playwright screenshots.

In a seven-phase blog post skill, Opus touches phases zero and four (planning and quality review). Sonnet runs phase one (content generation). Haiku runs phases two, three, five, six, and seven. The most expensive model does the least total work by volume, and the cheapest model does the most. This is economic dispatch applied to language models.

The economics are stark. If that seven-phase workflow runs entirely on Opus, every token of file content, every git status output, every deployment log flows through the $25/MTok output pipe. With delegation, five of those seven phases run at $5/MTok. The orchestrator's context window stays lean, focused on the decisions that actually require its capability.

Context Windows Are Not Free Storage

The second optimization lever, after model selection, is context management. Claude's context window is 200K tokens (a million in beta). That sounds generous until you realize every byte loaded into context costs money twice: once to input it, and again in the attention computation that processes it.

My infrastructure uses the Universal File-based Context system, which is essentially demand-driven context loading. Instead of stuffing every possible piece of information into every session, UFC loads only what's relevant to the current task. SSH configuration context loads when the conversation mentions SSH. Security protocols load when credentials come up. Project-specific context loads when you're working on that project.

The alternative is the "everything bagel" approach: load all context into every session and let the model sort it out. This is the equivalent of keeping every appliance in your house running 24/7 because you might use any of them at any time. It works, technically. It's also enormously wasteful.

UFC treats context like grid capacity. You forecast demand based on the task at hand, provision only what's needed, and keep the rest offline. A session focused on Docker troubleshooting doesn't need the financial tracking context. A session writing blog posts doesn't need the firewall management protocols. Loading them anyway burns input tokens on information the model will process but never use.

The implementation is a hook-based system that intercepts user prompts and dynamically loads context files based on keyword triggers. When a prompt mentions "SSH," the hook loads the SSH aliases context. When it mentions a specific project, the project context loads. Everything else stays on disk. The mechanism is simple, but the savings are structural: every session starts lean, and context scales with actual demand rather than hypothetical need.

The MCP Token Tax

The MCP optimization I mentioned at the top deserves a deeper look, because it illustrates a category of waste that's easy to miss and expensive to ignore.

MemBrane is my six-layer memory system. It runs as an MCP server, which means Claude can call it directly during a session: capture a fact, load context, search for relevant memories. Each of those calls has a token cost. The call itself, the response payload, and the context window space both consume.

Two pipes in cross-section, one clogged with particles and one streamlined

At 10,700 tokens per call, a session that made ten MCP calls to MemBrane would burn 107,000 tokens just on memory operations. That's over half of a 200K context window consumed by plumbing, leaving less than half for the actual work. And ten calls is conservative. A productive session with autonomous knowledge capture can easily make twenty or thirty MCP calls. At the original token cost, thirty calls would have consumed more than the entire 200K context window on memory plumbing alone.

The root cause was schema-level laziness. The graph layer stores vector embeddings alongside entity data (768-dimensional arrays used for semantic search). When the MCP server serialized a response, it included those embeddings because the serializer returned the full object. Nobody was reading those arrays. They existed in the response purely because nobody had explicitly excluded them.

The fix was three changes: exclude embedding fields from MCP response serialization, optimize the context loading query to return only caller-relevant fields, and restructure the response format to eliminate redundant nesting. Total development time: a few hours. Impact: 86% token reduction per call. The ten-call session that used to burn 107K tokens now burns 15,450. The thirty-call session that would have blown out the context window now fits comfortably within budget.

This is the kind of optimization that doesn't show up in architecture diagrams or feature announcements. It's pure plumbing. And it delivered more practical value than any feature I shipped that month. The lesson generalizes: any time an AI tool returns data to a language model, the response should contain exactly what the model needs and nothing more. Serializers that return full objects, APIs that include metadata "just in case," verbose error messages with stack traces -- all of it is token tax. And unlike real taxes, you get zero benefit from paying it.

GPU Scheduling: The Physical Layer

Token costs are the API-level economics. Below that sits the physical layer: actual GPUs drawing actual watts.

My inference server runs four Tesla M40 24GB cards. They handle local model inference (embeddings, small language models for autonomous agents) and various GPU workloads like music generation and ML experiments. A job queue manager sits in front of them, distributing inference requests across available GPUs.

The scheduling problem here mirrors the token problem at a different layer. A GPU that's idle wastes electricity. A GPU that's overloaded creates queuing delays that cascade upstream. When cron-triggered inference jobs pile up faster than the GPUs can process them, phantom jobs accumulate in the queue -- requests that timed out on the caller side but remain marked as "running" in the job manager's state. Left unchecked, these ghosts consume queue capacity and inflate wait times for legitimate requests. The fix is automated monitoring: a health-check script that detects the mismatch between the queue's view of active jobs and the GPU's actual workload, then flushes the stale entries automatically.

A row of compute slabs with heat glow shifting from teal to violet and job paths between them

The thermal dimension adds a constraint you don't get with API models. Four M40 cards running simultaneously generate over 1,000 watts of heat. These are passive-cooled cards designed for data center airflow, not desktop chassis. In adjacent PCIe slots, they create a thermal feedback loop where each card's exhaust becomes the next card's intake air. Under sustained load, thermal throttling causes 2-3x step time degradation. An external fan helps. But the real solution is the same one grid operators use: load shaping. Spreading workloads across time instead of running all four cards at full tilt simultaneously. Schedule ML training experiments when inference demand is low. Run batch embedding jobs overnight. Treat thermal headroom as a finite resource, just like token budgets and VRAM.

Model memory management matters here too. If you leave a loaded model sitting in GPU memory after inference completes, it blocks that VRAM from being used by other workloads. Setting aggressive unload timers -- releasing VRAM shortly after inference finishes -- is the GPU equivalent of spinning down a generator when demand drops. The tradeoff is cold-start latency on the next request, but for workloads with bursty demand patterns, the VRAM freed for other tasks more than compensates.

Voice as an Input Optimization

There's one more cost lever that doesn't get enough attention: input method.

I use SuperWhisper for voice transcription in my daily workflow. The economics are straightforward. Typing a detailed prompt takes time, and time is the scarcest resource in the system. Voice input lets me describe what I want conversationally, in the time it takes to say it, rather than the time it takes to type it precisely.

But there's a subtler benefit. Voice prompts tend to be more natural and less over-specified than typed prompts. When I type, I optimize for precision, which often means longer prompts with more tokens. When I speak, I describe the intent and let the model figure out the implementation. The prompts are often shorter. Not always better, but cheaper in raw token terms for exploratory work where precision isn't critical yet.

There's also a cognitive cost that token accounting doesn't capture. Typing precise technical prompts is mentally taxing in a way that speaking isn't. Voice input lets you stay in a flow state, thinking about the problem rather than the syntax of the request. Over a full day of AI-assisted development, the reduced cognitive overhead compounds just like the token savings do.

The Compound Effect

None of these optimizations is dramatic in isolation. Model delegation saves a few dollars per session. Context management saves a few thousand tokens per interaction. MCP optimization saves 9,000 tokens per tool call. GPU scheduling prevents cascading delays. Voice input saves minutes per interaction.

Together, they're the difference between an AI infrastructure that costs more than it produces and one that compounds in value over time.

A single rising ribbon of light with glowing dots marking optimization milestones

The real insight isn't about any single technique. It's that personal AI infrastructure has reached the point where it behaves like actual infrastructure. It has supply-side economics (model pricing tiers, GPU costs, electricity). It has demand-side management (context loading, task prioritization, session scheduling). It has capacity planning (token budgets, VRAM allocation, thermal limits). And it has the same fundamental optimization problem that every infrastructure operator faces: maximize useful output per unit of input, across multiple resource types, with hard constraints.

I spent the first few months of running this system thinking about AI in terms of capabilities. What can the models do? How smart are they? What's the context window limit? Those questions matter, but they're the wrong place to optimize. The models are already good enough for most tasks. The limiting factor isn't intelligence. It's economics.

The developers who will get the most out of AI infrastructure aren't the ones with access to the most powerful models. They're the ones who learn to think about tokens the way grid operators think about megawatts: as a resource with a cost curve, a demand profile, and a dispatch strategy. Not something to minimize. Something to allocate.

About the author

Carlos Mendez

Carlos Mendez

IT support and systems, Maui, Hawaii

I come from IT support and systems work. I build and run my own infrastructure and the production websites for West Maui Tech, my business, and I build AI tooling on top of that stack. I write here about what I run, what broke, and how I fixed it.

Enjoyed this article?

Subscribe to get notified about new posts on software engineering, AI development, and infrastructure.

No spam, unsubscribe anytime.