Skip to main content

Module cost_tracker

Module cost_tracker 

Source
Expand description

Cost tracking and savings computation.

Tracks per-model token usage and estimated spend, computes what the all-cloud baseline cost would have been, and reports savings.

Thread-safe: all counters use atomic operations for lock-free reads and writes under concurrent pipeline access.

Also provides SessionBudgetTracker for per-session spending limits.

Structsยง

CostSnapshot
Point-in-time snapshot of cost tracking metrics.
CostTracker
Per-model cost tracking and savings computation.
SessionBudgetTracker
Per-session spending limits and accumulated spend.