Expand description
Priced, aggregated usage summary shared by every frontend.
Turns the roll-up’s per-model and per-provider usage maps into the priced
UsageSummary (sorted per-model rows, column totals, per-provider
totals). This is ratatui-free business logic, so a non-CLI backend (e.g. a
future GUI) builds the same summary without depending on display; the
display layer only renders the result.
Structs§
- Provider
Stats - Per-provider totals for usage.
days_countrecords how many distinct days contributed to these totals so the display layer can show readers the spread without computing a rate. - Usage
Row - Data structure for a usage row.
- Usage
Summary - Fully priced usage view shared by every output mode.
- Usage
Totals - Column-wise totals across every
UsageRowin a summary.
Functions§
- build_
usage_ summary - Build a summary from raw usage data.
- calculate_
provider_ totals_ from_ per_ provider - Calculate per-provider totals using source-directory attribution.
- merge_
rows_ by_ base_ model - Collapses rows by [
base_model_key], summing every token bucket and the already-resolved cost, and shows every row under its bare base name.
Type Aliases§
- Usage
Provider Totals - Type alias for usage totals grouped by provider.