Package-level declarations
Types
Registers LiteLLM token consumption with LLMConsumptionRegistry via ServiceLoader.
Token-based consumption for the LiteLLM provider.
Token-based consumption unit (LiteLLM).
Base type for an amount of LLM consumption recorded during an optimization run.
Resolves consumption flavors discovered on the classpath via LLMConsumptionType services.
JSON serializer for any LLMConsumption flavor. The on-disk shape is a single object with a top-level "unit" field (the flavor's LLMConsumptionUnit.displayLabel) plus the flavor's own pretty fields. On read, the "unit" label is resolved through LLMConsumptionRegistry to the right decoder — so no provider-specific dispatch lives here.
SPI for contributing an LLMConsumption flavor to LLMConsumptionRegistry.
The unit a particular LLMConsumption flavor is measured in (e.g. tokens, credits).
Functions
Format an amount as "N,NNN.NN <shortLabel>" (e.g. "12,345.67 tokens"), or "n/a" for null.
Parse a formatted amount like "12,345.67 tokens" into its value and resolved unit. The unit suffix is resolved through LLMConsumptionRegistry, so any registered flavor parses.
Extension form of formatAmount.
Format a finite, non-null amount as "N,NNN.NN <unit>", or "n/a" for null, non-finite, or null-unit inputs. Null unit reads as "n/a" because there's no sensible label to attach.