The per-day cost cap: what the model calls cost today, priced by
req_llm from each reply's usage (notional on a Claude or ChatGPT
subscription), against the host's Rho.Settings.daily_cap/1.
The ledger is spend.json in the data dir, {"YYYY-MM-DD" => dollars}
by the device's local date, the last 31 days kept. The loop checks
check/1 before every model call and record/2s every reply, across
all sessions. A reply that runs past the cap still finishes (its cost
is only known at the end); the next call is refused.
Summary
Functions
:ok, or {:over, spent_today, cap} once today's spend reached the cap.
Adds cost dollars to the day's spend (non-positive costs are ignored).
Today's spend in dollars.
The phone's local date.
Functions
:ok, or {:over, spent_today, cap} once today's spend reached the cap.
Adds cost dollars to the day's spend (non-positive costs are ignored).
Today's spend in dollars.
@spec today() :: Date.t()
The phone's local date.