Documentation
¶
Index ¶
Constants ¶
const FallbackVersion = "2026-04-13"
FallbackVersion must be bumped whenever FallbackPricing rates change so the startup seeder knows to re-upsert.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelPricing ¶
type ModelPricing struct {
ModelPattern string
InputPerMTok float64
OutputPerMTok float64
CacheCreationPerMTok float64
CacheReadPerMTok float64
}
ModelPricing holds per-model token pricing in cost per million tokens. Separate from db.ModelPricing — the CLI command converts between the two.
func FallbackPricing ¶
func FallbackPricing() []ModelPricing
FallbackPricing returns hardcoded pricing for key Claude models. Used when the LiteLLM fetch fails. Prices in USD per million tokens, current as of 2026-04.
func FetchLiteLLMPricing ¶
func FetchLiteLLMPricing() ([]ModelPricing, error)
FetchLiteLLMPricing downloads the LiteLLM pricing JSON and parses it into ModelPricing entries.
func ParseLiteLLMPricing ¶
func ParseLiteLLMPricing( data []byte, ) ([]ModelPricing, error)
ParseLiteLLMPricing parses the LiteLLM JSON map into ModelPricing entries. Per-token costs are converted to per-million-token costs. Entries missing both input and output cost are skipped.