Documentation
¶
Overview ¶
Package modelsdev loads the models.dev provider/model catalog used to price and describe models. The catalog is runtime data: this package does not carry a baked model or pricing table.
Index ¶
Constants ¶
const (
DefaultSource = "https://models.dev"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
New constructs a catalog client. Empty options select models.dev and the user cache directory.
func NewFromEnv ¶
NewFromEnv reads the catalog settings from the environment. Only "true" and "1" (case-insensitive) enable SENIOR_DEV_DISABLE_MODELS_FETCH.
func (*Client) Get ¶
Get is memoized for the process lifetime. Population is disk -> (no bundled snapshot) -> disabled-fetch empty catalog -> network.
type Cost ¶
type Cost struct {
Input float64 `json:"input"`
Output float64 `json:"output"`
CacheRead *float64 `json:"cache_read,omitempty"`
CacheWrite *float64 `json:"cache_write,omitempty"`
ContextOver200K *Cost `json:"context_over_200k,omitempty"`
}
Cost is the models.dev cost block. Pointer fields preserve the distinction between an omitted optional rate and an explicit zero.
type Modalities ¶
type Model ¶
type Model struct {
ID string `json:"id"`
Name string `json:"name"`
Attachment *bool `json:"attachment,omitempty"`
Reasoning *bool `json:"reasoning,omitempty"`
Temperature *bool `json:"temperature,omitempty"`
ToolCall *bool `json:"tool_call,omitempty"`
Modalities *Modalities `json:"modalities,omitempty"`
Cost *Cost `json:"cost,omitempty"`
Limit Limit `json:"limit"`
}