modelcatalog

package
v1.0.0-beta.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

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

func Lookup(provider, model string) (catwalk.Model, bool)

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

func NormalizeModelID(id string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL