Interview prep
SmellOperations

No Cost Budget

Custo Sem Teto

No Cost Budget is an AI code smell, a sign of trouble in LLM systems, in the Operations group. There is no spending limit per user, per task, or per day.

Element
32/37
Level
Beginner
Read
4 min
Updated
On this page 7
  1. 01Signs and symptoms
  2. 02Reasons
  3. 03Cost of ignoring
  4. 04Treatment
  5. 05Payoff
  6. 06When to ignore
  7. 07Is it this smell?
  8. ··Quick answers

Signs and symptoms

A deep research product has a free plan and a paid plan. The monthly cost report (anonymized):

cost per user, free plan, September
p50       US$ 0.40
p95       US$ 3.10
max       US$ 80.15   (user 77812, 1 study, 3h12min, 4,900 calls)

A free-plan user asked a very broad question. The agent researched for three hours. Nothing stopped it: there was no limit per study, per user, or per day. That one study cost more than a year of a paid subscription.

The same pattern shows up in bank WhatsApp bots. Picture an assistant that explains Pix (Brazil’s instant payments), boletos, and statements. On an internal “unlimited” plan, a overnight script fires a thousand research questions. Each one looks cheap. The total lands in finance the following month.

Signs of No Cost Budget:

  • There is no spending limit per task, per user, or per period.
  • Cost is only known from the provider’s invoice, after the fact.
  • The per-task maximum is tens or hundreds of times the median.
  • Free users can spend as much as paying ones.
  • There is no alert when the day’s spending is out of the ordinary.
  • The cap, if it exists, covers only model tokens and ignores search, browser, and other paid APIs.
flowchart LR
  U(["1. User, any plan"]):::io --> A(["2. Agent with no budget"]):::llm
  A --> T["3. As many calls as it wants"]:::tool
  T --> A
  A --> F[("4. Monthly invoice")]:::store
  1. Any user triggers tasks.
  2. The agent does not know how much it may spend.
  3. It uses as many calls as it sees fit.
  4. Cost shows up only at the end of the month.
Check +20 XP on first tryThe monthly report shows a p50 of US$ 0.40 and a maximum of US$ 80 on the same research task. Which diagnosis do you test first?

Reasons

  • Cost per call is small. Cents look irrelevant until they multiply.
  • Budget is “finance’s problem”. The technical team does not connect architecture to cost.
  • No per-user measurement. Cost exists only as a total, not per task.
  • Plans with no technical translation. The free plan’s limits exist in marketing, not in code.
  • A cap only on the loop. A max_turns stops one long run and still lets the same user fire three hundred short ones.

Common trap: treating the invoice as the budget

You open the provider dashboard, see the month’s spend, and conclude it is “under control”. That number does not say which task, which user, which plan. When the maximum explodes, you have no way to refuse the next call. You can only regret the one that already ran.

Cost of ignoring

  • Negative margin. Heavy or abusive users consume more than they pay.
  • Invoice surprises. A single case can skew the month.
  • Abuse. Free accounts become a cheap way to use the model.
  • Abrupt cuts. When the problem surfaces, the usual reaction is turning the feature off for everyone.

A back-of-the-envelope scale check

The numbers below are illustrative. Suppose 2,000 input tokens and 400 output tokens per call, at US$ 3 per million input tokens and US$ 15 per million output. Each call comes to about US$ 0.012.

Who Calls in the month Illustrative cost
Median user 40 about US$ 0.50
Script on the free plan 4,900 in one study about US$ 59, plus the growing history
The same script, 200 users 980,000 tens of thousands of dollars

The middle row already beats many annual subscriptions. With no per-user cap, the bottom row is a weekend.

Anthropic’s “Building effective agents” (Dec. 2024) treats an iteration limit as a stop condition. That cuts one task. It does not cut the product: you still need caps per user, per day, and per plan.

Treatment

Refactoring Choose it when
Add Loop Budget The spending comes from agents or long pipelines. Each task gets a step and cost cap, with a defined wrap-up. Target: Stop Conditions.
Introduce Model Cascade The spending comes from high volume with the most expensive model on everything. Start with the cheap one and move up only when needed. Target: Model Cascade.

A product budget has three levels, and skipping one leaves a hole:

  1. Per task. Steps, time, and money. When it blows, the task returns what it already did and records the case.
  2. Per user and per day. The sum the plan allows. Free cuts early; paid gets measured headroom.
  3. Per account period. A global cap stops a thousand users at their limit from still breaking the month.

Define what the code does at the limit: reject, queue, or fall back to a smaller model. An alert with no cutoff only announces the damage. Count web search, browser, and other APIs in the same balance. See also Unbounded Loop: a stuck loop is the fastest way to blow a task with no cap.

Check +20 XP on first tryYou set a 30-step cap per study. A free-plan user fires 400 studies a day through a script. Which limit is missing next?

Payoff

  • A maximum cost per task, per user, and per day, known in advance.
  • Plans with real technical limits.
  • Alerts before the invoice, and a cutoff that does not depend on someone reading Slack at 3 a.m.
  • Predictable margins, even when someone pastes a script onto the free plan.

When to ignore

  • A low-use internal tool. If the monthly total is irrelevant, a simple daily spending alert may be enough.
  • A controlled discovery phase. A closed pilot with a few known users. Even then, set a per-task cap.

No product with an open free plan, or a public API, should run without a per-user balance.

Is it this smell?

Check +20 XP on first tryEach task has a 30-step cap, but there is no per-user limit. One user triggers 500 tasks a day through the API. Is this No Cost Budget?

Check +20 XP on first tryThe team has an alert when daily spending passes twice the average, but no limit that stops runs. What is missing?

Check +20 XP on first tryAn agent runs in an infinite loop because of a stuck tool. The task's cost explodes. Which smell is more specific?

Check +20 XP on first tryThe team caps only model tokens. Each study also calls a web search API billed per query, with no cap. Is this No Cost Budget?

Quick answers

What is No Cost Budget?

No Cost Budget is an AI code smell, a sign of trouble in LLM systems, in the Operations group. There is no spending limit per user, per task, or per day.

How do you fix No Cost Budget?

With Add Loop Budget and Introduce Model Cascade. Each refactoring has safe step-by-step mechanics with an eval before and after.

Where does No Cost Budget show up in practice?

In the real-world scenarios Automatic ticket triage, Legacy code migration, Deep research with citations, and Content moderation.

Go further

Relations

Refactorings that treat it 2
Search