Skip to main content

Module summary

Module summary 

Source
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§

ProviderStats
Per-provider totals for usage. days_count records how many distinct days contributed to these totals so the display layer can show readers the spread without computing a rate.
UsageRow
Data structure for a usage row.
UsageSummary
Fully priced usage view shared by every output mode.
UsageTotals
Column-wise totals across every UsageRow in 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§

UsageProviderTotals
Type alias for usage totals grouped by provider.