The problem
Usage anomaly jobs scan millions of billing events and occasionally call a model to classify weird patterns. The job itself consumes tokens. FinOps teams discover, too late, that the detector cost more than the anomalies it found.
Why Ecko
- Built-in metering
cost()andtokens()after eachaicall let the detector accumulate its own inference spend alongside the customer usage it is inspecting.- Hard budgets
ECKO_AI_MAX_CALLSstops a runaway loop before it becomes a runaway invoice. Combine withpmapconcurrency limits for queue workers.- JSONL audit
- Every classification appends to a trace file for post-mortems: which account looked weird, which model agreed, what it cost.
In practice
fn classify(row: str) -> str {
let label = ai "Anomaly class" from row
log.info("row classified", cost=cost(), tokens=tokens())
label
}
Try it on your workload.