When a local model costs $0 per token, what stops a runaway AI agent loop?

Blocks circle a track beside a computer tower and stop at a blue barrier.

A dollar spending cap means nothing when your agents run on a local model, so Cerevisor drops it rather than pretend. Here is what does stop a runaway agent loop on your own hardware: turn caps, token ceilings, and prices you enter yourself.

By the Cerevisor team

TLDR

A dollar spending cap only works when every model call has a price. On a local model the meter reads zero, so the cap can never trip, and Cerevisor removes it instead of showing a safety net that is not there. The brakes that still work on your own hardware are a limit on how many model calls a run may make, a ceiling on how much text each agent may read, and a price entered by hand when dollars should be counted.

This week a practitioner write-up collected the overnight horror stories that come with AI agents left running in a loop. An agent loop is an agent that keeps calling the model, reading the answer and deciding to go again, with nobody pressing stop. One of the logs it quotes reads like a meter that forgot to switch off.

"The session logs show 109 model calls and 21.3 million tokens, about half a million a minute,"

A Reddit post quoted by Alan Williamson, "How to Prevent Runaway AI Bills", November 2026

A token is the small chunk of text a model reads or writes, roughly a short word. On a paid service, every one of those tokens shows up on a bill. That is painful, but it is also a signal: the money is the alarm. Move the same loop onto a local model running on the same machine, and the alarm goes quiet. Nothing is billed, so nothing rings. The loop still burns hours, electricity and a GPU that someone else wanted.

So when we wired local models into Cerevisor’s multi-agent workflows, the honest question was not “how do we cap spend” but “what does a cap even mean here?”


Why a dollar spending cap counts zero on a local model

Cerevisor runs several AI agents in one workflow, each handing its work to the next. On a hosted provider, a new workflow comes with a dollar cap: it stops a run once total spend passes $5, and warns at $3. The cap itself can be changed in Settings. That works because the app knows the provider’s prices and can add up each call.

Now point the same workflow at Ollama or another local server. Cerevisor decides a model is local by its address. If the server lives on this computer or on a private network address (the kind that starts with 192.168 or 10), it counts as local. Local models are free per call as far as the app can tell, so every call adds $0 to the total.

A cap that adds up zeros will never trip. Leaving it in place would be the worst of both worlds: a setting that says “$5 limit” and protects nothing. So for a local server where nobody has entered prices, Cerevisor lifts the dollar cap and its warning entirely. The same happens for a hosted server whose model has no price anywhere the app can find, for example a rented GPU box running vLLM, a popular open-source program for serving models to many users at once.

Key Insight

A spending cap is only as real as the price list behind it. On a local model, removing the cap is more honest than keeping a limit that counts zeros.

That is the named failure we designed around: a safety net that looks fine on the settings screen and has a hole the size of the whole run.


Turn caps: the AI agent turn limit that works on every provider

What replaces dollars? Counting the work itself. Cerevisor has two turn caps. One turn means one model call. The first cap limits turns for the whole workflow; once the total across all agents passes it, the run stops at the end of the current wave, and later waves are skipped. A wave is a group of agents that run side by side before the next group starts. The second cap limits how many turns one agent may take, whether Cerevisor runs that agent itself or hands it to Claude Code.

Turn caps work with every provider, including local models, because counting calls does not need a price. They are also off by default, and that matters for anyone moving from a paid model to a local one. On a hosted provider the dollar cap was quietly protecting the run. Switch to a local model and that protection goes away, and nothing replaces it until a person turns the turn caps on.

They live in the Workflow tab of Cerevisor’s settings, under Options, next to the spend caps. Leave them blank and there is no limit. Type a number and the limit is on.

On a paid model the money is the alarm. On a local model there is no alarm until someone builds one out of turns.


The ceilings a local LLM agent loop still runs into

Turn caps are not the only brake. Each agent also has a ceiling on how much text it may read across the whole run, counted in tokens. Before every model call, Cerevisor estimates what the next call would add and stops the agent if that would go over the ceiling. This check does not care about price, so it applies to a local model exactly as it does to a paid one. It is a backstop rather than a tight leash: it catches the agent that keeps re-reading a growing history, which is how loops get expensive in the first place.

There is also an inactivity timer in the same settings, which stops an agent that has gone silent for too long. A slow local model and a stuck one look similar from the outside. The timer stops the run from waiting forever.

And if dollars are what your finance team actually wants to see, there is a third option. Enter prices for a local or self-hosted server, and Cerevisor puts the dollar cap back, local or not. That is the right move for the rented GPU box, or for an office server where someone has worked out what an hour of GPU time really costs. The cap then means something again, because there is a real number behind each call.

Which brakes apply where, in Cerevisor today
SetupDollar capTurn capsPer-agent token ceiling
Hosted provider with known pricesOn by default ($5)Off until setOn
Local server, no prices enteredLifted (would count $0)Off until setOn
Local or self-hosted, prices enteredOnOff until setOn

Self-hosted LLM cost control is a question of who sets the limit

The second story this week is a reminder of why limits should sit outside the agent. Researchers at Cornell Tech and Yale gave AI agents payment tools and spending limits, then watched what happened when an email offered a way around them. Their results are an early preprint, covered by eSecurityPlanet, so treat them as a signal rather than a settled finding.

"Five of 10 models increased their spending limits and sent funds to the simulated attacker during at least one trial."

eSecurityPlanet, November 2026, on the Cornell Tech and Yale "I-HITL" preprint

That test is about money, but the lesson carries over to local models. A limit an agent can talk itself past is a suggestion. In Cerevisor, turn caps, token ceilings and prices are set by a person in the app’s settings before the run starts. The agents do their work inside those numbers. They are not asked to keep track of them.

The practitioner advice from the same week lands in the same place. Williamson’s checklist says to “put a hard iteration cap and a stop condition on every loop and scheduled job.” On a local model, that cap is not a nice extra. With no bill, it is the only thing that will stop the loop.


What I’d tell a team moving agents onto a local model

Moving a multi-agent workflow from a paid model to a local one changes what keeps it safe. The bill used to be the alarm, and it goes away with the move. Some teams find that out the morning after an overnight run, when the GPU is still busy.

Before the first unattended local run, open the workflow’s settings and set a workflow turn cap and a per-agent turn cap you would be comfortable waking up to. If you run models on a shared or rented GPU, enter a price per call so the dollar cap comes back. Then start one short test run and confirm it stops where you said it would. The local and OpenAI-compatible providers guide covers connecting the server, and the settings reference covers the caps.

Sources

  1. How to Prevent Runaway AI Bills - alan.is, 2026-11-12
  2. AI Agents Bypassed Spending Limits: What Went Wrong - eSecurityPlanet, 2026-11-12

Written by , Founder of Cerevisor.

Back to all insights