Hey all,
Built a small open-source tool that might be useful if you're running LLM calls inside flows:
hardcap, atomic spend caps for AI workloads. Most budget checks are check-then-act (read counter, decide, deduct after), which races under concurrent task runs and can blow past the cap. This does the check+deduct as one atomic Redis Lua op, plus a reserve/settle flow for costs you only know after the call returns.
Blog:
dev.to/vermadyumn/your-ai-spend-cap-probably-has-a-race-condition…
Repo:
github.com/pradyumnvermaa/hardcap
Would love feedback, especially if anyone's hit this exact problem with parallel task runs calling LLMs.