Expand description
LLM pricing and retry policy.
Contains the shared RetryPolicy struct used by all provider
implementations, the per-model ModelPricing struct, and lookup
helpers that consult the bundled providers.toml preset catalog.
Structs§
- Model
Pricing - Per-million-token pricing for one model. USD.
- Retry
Policy - Retry policy for transient LLM provider failures (network timeouts, 5xx).
Functions§
- context_
window_ tokens_ for_ model - Returns the context window size in tokens for the given model.
- context_
window_ tokens_ for_ model_ effective - Like
context_window_tokens_for_modelbut consults the effective catalog (remote cache + bundled +providers.d/) rather than the compile-timeproviders.tomlalone. Mirrors [find_model_pricing_effective]: the TUI’s/modelpicker lists models with their effectivecontext_window, so the input-box context gauge must read the same source — otherwise it shows a stale bundled value for a model the user has overridden to a different window inproviders.d/. - default_
compact_ threshold_ chars - Compute the default compaction character-count threshold for a model.
- default_
compact_ threshold_ tokens - Compute the default compaction token threshold for a model.
- pricing_
for - Returns pricing for a model by looking it up in the effective preset
catalog (remote cache + bundled +
providers.d/), so per-token cost reflects upstream catalog refreshes rather than just the compile-timeproviders.toml. ReturnsNoneif the model is not listed or has no pricing field.