Skip to main content

Module tokens

Module tokens 

Source
Expand description

§Token telemetry

Everything related to LLM token accounting.

FileResponsibility
totalsTokenTotals — simple input/output pair
countsTokenCounts — wire-format input/output pair
snapshotTokenUsageSnapshot + GlobalTokenSnapshot
counterAtomicTokenCounter — the lock-light global counter

Re-exports§

pub use counter::AtomicTokenCounter;
pub use counts::TokenCounts;
pub use snapshot::GlobalTokenSnapshot;
pub use snapshot::TokenUsageSnapshot;
pub use totals::TokenTotals;

Modules§

counter
Lock-light atomic counter for LLM token usage.
counts
Input/output token counts with field names that match most provider APIs.
snapshot
Read-only snapshots of token usage.
totals
A tiny (input, output) token pair with a convenience total() method.