Expand description
LiteLLM-sourced per-model pricing: the parser plus the proxy-aware fetch that populates the runtime cache.
Pricing is sourced at runtime from LiteLLM’s raw file and cached in
redb (forge_workspace::store::pricing); there is no bundled copy.
Re-exports§
use std::collections::HashMap;🔒use std::time::Duration;🔒use forge_primitives::token_usage::ModelPricing;🔒
Structs§
- Pricing
Table - Per-model USD pricing keyed by the exact
message.modelid.
Constants§
- FETCH_
TIMEOUT 🔒 - Bound on the pricing fetch; the file is ~1.6 MB.
- LITELLM_
URL 🔒 - LiteLLM’s community-maintained price table (prices Claude and the OpenAI/Codex ids in one file).
Functions§
- attempt_
fetch 🔒 - fetch_
litellm - Fetch the raw LiteLLM pricing file. Honours an ambient
HTTPS_PROXYfirst, then retries once directly so a dead proxy doesn’t block the fetch.Noneon any network failure (the caller keeps the last-good cache).