Documentation
¶
Overview ¶
Package modelsdev provides access to merged model metadata from models.dev combined with a static overlay of custom fields (reasoning levels, default reasoning level, custom tool support) that models.dev does not supply.
Both the base models.dev API snapshot (models-dev-api.json) and the overlay (model-overlay.json) are embedded at compile time. The overlay is applied once on first use; callers see a single, already-merged view.
Typical usage:
if md := modelsdev.Lookup("openai", "gpt-5.2"); md != nil {
fmt.Println(md.ReasoningLevels) // ["low","medium","high","xhigh"]
fmt.Println(md.DefaultReasonLevel) // "medium"
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelCapabilities ¶
type ModelCapabilities struct {
ReasoningSummary *bool // nil = enabled by default for reasoning models
}
ModelCapabilities holds typed, model-specific feature flags for optional request fields whose support varies across models.
type ModelInfo ¶
type ModelInfo struct {
ID string
Name string
Family string
Reasoning bool
ReasoningLevels []string // valid reasoning level values for this model
DefaultReasonLevel string // default reasoning level (empty = provider decides)
ContextWindow int
MaxOutputTokens int
InputModalities []string
OutputModalities []string
ToolCall bool // whether this model supports tool/function calling
CustomTools bool // whether this model supports provider-specific custom grammar tools
Capabilities ModelCapabilities
Cost ModelCost
}
ModelInfo contains the merged metadata for a single model.
func AllForProvider ¶
AllForProvider returns merged metadata for every model under the given provider ID. Returns nil if the provider is not found.
func Lookup ¶
Lookup returns the merged model metadata for a specific provider and model ID. Returns nil if the provider or model is not found.
func (*ModelInfo) SupportsInputModality ¶
SupportsInputModality reports whether the model accepts the specified input modality (for example "image" or "pdf").
func (*ModelInfo) SupportsReasoningSummary ¶
SupportsReasoningSummary reports whether the model accepts the optional reasoning.summary request field.
type ProviderInfo ¶
type ProviderInfo struct {
ID string
Name string
API string // default base URL
NPM string // npm package used by models.dev (e.g. "@ai-sdk/openai-compatible")
EnvVars []string // required env var names (e.g. ["ANTHROPIC_API_KEY"])
Doc string // documentation URL or description
}
ProviderInfo holds provider-level metadata from models.dev.
func AllProviders ¶
func AllProviders() []ProviderInfo
AllProviders returns metadata for every provider in models.dev.
func LookupProvider ¶
func LookupProvider(providerID string) *ProviderInfo
LookupProvider returns provider-level metadata for the given provider ID. Returns nil if the provider is not found.
func ProvidersByNPM ¶
func ProvidersByNPM(npmPackage string) []ProviderInfo
ProvidersByNPM returns all providers whose npm field matches the given package name. Used to bulk-register providers that share a common API implementation.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
anthropic-overlay-sync
command
|
|
|
codex-overlay-sync
command
|
|
|
openai-overlay-sync
command
|