Documentation
¶
Overview ¶
Package modelcatalog is the single source of truth for LLM model metadata (context window, default output-token budget, and pricing), backed by the embedded catwalk catalog. Both the engine (core) and the CLI consult it, so there is exactly one catalog rather than divergent per-side sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cost ¶
func Cost(provider, model string, inputTokens, outputTokens, cacheReadTokens, cacheWriteTokens int64) float64
Cost returns the dollar cost of the given token usage for a model, priced from the catalog. Input, output, cache-read and cache-write tokens are assumed disjoint and billed at their respective rates. An uncatalogued model (or unknown provider) costs 0.
func Lookup ¶
Lookup returns catwalk's metadata for a provider's model, if known. The provider is a Dagger provider name (e.g. "anthropic", "openai", "google"); unrecognised providers (local, other, ...) always miss.
func NormalizeModelID ¶
NormalizeModelID reduces a model name to a catalog key so user-supplied variants ("claude-sonnet-4-5-20250929", "claude-sonnet-4-5", "anthropic/claude-sonnet-4-5", "claude-fable-5[1m]") all resolve to the same entry.
Types ¶
This section is empty.