Currently Shipping AI into a real-estate acquisitions workflow Location San Mateo, CA Updated 2026-10-08
N° 029 / Writing / AI / Sep 15, 2026 / 2 min read

Tracking model cost and failures across my systems

Consistent call records make usage comparable; different failures need different responses.

Model calls happen in several parts of my underwriting and data workflows. A total bill tells me that money was spent. It does not tell me which feature spent it, which calls failed or whether a change made one step slower.

I use a shared call wrapper to record system and feature labels alongside usage, latency and errors. A wrapper is a common entry point around the model request. It gives calls from different tools the same reporting shape without requiring every tool to invent its own logging format.

The important operating decision is what happens when that reporting breaks. If primary telemetry storage fails, the storage router tries a local SQLite database. If both destinations fail, it emits a warning and drops the record. A failure to store a metric should not, by itself, discard a useful model response or interrupt the main workflow.

Separate failures with different consequences
FailureResponse
Primary metrics write failsTry the local fallback database.
Both metric stores failWarn and lose the record; preserve the call's result.
A budget breach is recognizedStop the request before making the model call.

The budget check is separate because its purpose is to prevent spending. A recognized budget breach intentionally raises an error that stops the call. But an unexpected failure while checking the budget can fail open, allowing the request to proceed. That distinction matters: this is not a guarantee that every spending limit survives every infrastructure failure.

Ten local storage tests passed using fake primary writers and temporary SQLite files. They covered primary success, local fallback and the case where both writes fail. These checks exercise storage behavior without contacting the model provider or the production database. A separate stubbed call check covers the recognized-budget-stop path.

Keeping work running through a telemetry outage leaves gaps in the very dashboard I use to understand it. Local fallback helps, but I still need to notice missing records and inspect warnings. I can choose to tolerate a lost metric more readily than an unnecessary failed underwriting run; I should not then mistake the remaining cost chart for a complete accounting of every call.

End · ~356 words ⁂ Filed September 15, 2026
§ Continue reading All posts →
  1. 032 A missing total is not a zero Sep 26, 2026 · AI
  2. 033 A skipped test counted as a pass Sep 26, 2026 · AI
  3. 034 My tests passed. The next tool still read the wrong number. Sep 26, 2026 · AI