Documentation
¶
Index ¶
Constants ¶
View Source
const ( ModelsDevAPIURL = "https://models.dev/api.json" CacheFileName = "models_dev.json" )
Variables ¶
View Source
var ModelAliases = map[string]string{
"anthropic/claude-sonnet-4-0": "anthropic/claude-sonnet-4-20250514",
}
ModelAliases maps alias model IDs to their actual model IDs
Functions ¶
This section is empty.
Types ¶
type CachedData ¶
type CachedData struct {
Database Database `json:"database"`
CachedAt time.Time `json:"cached_at"`
LastRefresh time.Time `json:"last_refresh"`
}
CachedData represents the cached models.dev data with metadata
type Cost ¶
type Cost struct {
Input float64 `json:"input,omitempty"`
Output float64 `json:"output,omitempty"`
CacheRead float64 `json:"cache_read,omitempty"`
CacheWrite float64 `json:"cache_write,omitempty"`
}
Cost represents the pricing information for a model
type Database ¶
type Database struct {
Providers map[string]Provider `json:"providers"`
UpdatedAt time.Time `json:"updated_at"`
}
Database represents the complete models.dev database
type Modalities ¶
Modalities represents the supported input and output types
type Model ¶
type Model struct {
ID string `json:"id"`
Name string `json:"name"`
Attachment bool `json:"attachment"`
Reasoning bool `json:"reasoning"`
Temperature bool `json:"temperature"`
ToolCall bool `json:"tool_call"`
Knowledge string `json:"knowledge,omitempty"`
ReleaseDate string `json:"release_date"`
LastUpdated string `json:"last_updated"`
OpenWeights bool `json:"open_weights"`
Cost *Cost `json:"cost,omitempty"`
Limit Limit `json:"limit"`
Modalities Modalities `json:"modalities"`
}
Model represents an AI model with its specifications and capabilities
type Provider ¶
type Provider struct {
ID string `json:"id"`
Name string `json:"name"`
Doc string `json:"doc,omitempty"`
API string `json:"api,omitempty"`
NPM string `json:"npm,omitempty"`
Env []string `json:"env,omitempty"`
Models map[string]Model `json:"models"`
}
Provider represents an AI model provider
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages the models.dev data with local caching
func (*Store) GetDatabase ¶
GetDatabase returns the models.dev database, fetching from cache or API as needed
Click to show internal directories.
Click to hide internal directories.