How to Hard-block LLM Calls Without Knowing Output Tokens

vildanbina · reddit · 2026-07-08

An indie developer shares a method to enforce a hard spending limit on LLM calls before they start (when output token counts are unknown). It uses model estimation plus a configurable per-call limit, checked against a running budget, and reconciled post-call with actual token usage. If the backend is slow or down, it opts to fail-open to avoid breaking the user's app just to save a few cents. This has been open-sourced as Bursora (Apache 2.0, self-hostable), and the developer is asking the community whether they enforce limits at the app layer, proxy layer, or just absorb the risk.

Related event: Open-Sourced Hard Budget Limit for AI Agents(2 posts)→

Original post →

More from coding & agent

coding & agent channel →