Documentation
¶
Overview ¶
Package modelprofiles provides per-model capability metadata, mirroring langchain's ModelProfile / ModelProfileRegistry (langchain_model_profiles).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRegistry = NewRegistry()
DefaultRegistry is shared across the package.
Functions ¶
Types ¶
type Modality ¶
type Modality string
Modality describes the input/output modalities a model supports.
const ( // ModalityText is plain text input/output. ModalityText Modality = "text" // ModalityImage is image input (multimodal). ModalityImage Modality = "image" // ModalityVideo is video input (multimodal). ModalityVideo Modality = "video" // ModalityAudio is audio input/output (multimodal). ModalityAudio Modality = "audio" // ModalityFile is file attachments. ModalityFile Modality = "file" )
type ModelProfile ¶
type ModelProfile struct {
// Name is the canonical model name, e.g. "gpt-5".
Name string
// Provider is the provider id, e.g. "openai", "anthropic".
Provider string
// ContextWindow is the maximum input context length in tokens (0 if unknown).
ContextWindow int
// MaxOutputTokens is the maximum output token budget (0 if unknown).
MaxOutputTokens int
// Modalities lists the input/output modalities the model supports.
Modalities []Modality
// ToolCalling reports whether the model supports tool/function calling.
ToolCalling bool
// StructuredOutput reports whether the model supports schema-constrained
// output (structured output).
StructuredOutput bool
// Reasoning reports whether the model supports reasoning/thinking.
Reasoning bool
// Streaming reports whether the model supports streaming.
Streaming bool
}
ModelProfile describes the capabilities of a single model.
func Lookup ¶
func Lookup(model string) *ModelProfile
Lookup returns a profile from the default registry, or nil if unknown.
func (ModelProfile) Supports ¶
func (p ModelProfile) Supports(modalities ...Modality) bool
Supports reports whether the model profile advertises all the given modalities.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is a thread-safe store of model profiles, keyed by provider then name.
func (*Registry) All ¶
func (r *Registry) All() []ModelProfile
All returns a copy of all registered profiles.
func (*Registry) Get ¶
func (r *Registry) Get(name string) (ModelProfile, bool)
Get returns the profile for a model name, resolving aliases first.
func (*Registry) Lookup ¶
func (r *Registry) Lookup(name string) *ModelProfile
Lookup returns the profile for a model, or nil if unknown.
func (*Registry) Register ¶
func (r *Registry) Register(p ModelProfile)
Register adds a profile to the registry. Registering a profile with the same name as an existing one replaces it.
func (*Registry) RegisterAlias ¶
RegisterAlias maps an alias (e.g. a provider-specific name) to a canonical model name already registered.