Documentation
¶
Overview ¶
Package model provides built-in LLM metadata and dual-model routing.
The catalog map holds known model limits (context length, max output, features). Chat agent and context management resolve token budgets from this catalog.
Index ¶
- Constants
- func ApplyDefaultRouter(cfg msg.Config) msg.Config
- func ContextWindowFor(modelName string) int
- func HasFeature(modelName string, feature Feature) bool
- func MaxContextWindow(modelNames ...string) int
- func RegisterTestMetadata(t *testing.T, meta Metadata)
- type Feature
- type Metadata
- type Router
Constants ¶
const DefaultContextWindow = 128000
DefaultContextWindow is the fallback input token budget for unknown models.
Variables ¶
This section is empty.
Functions ¶
func ApplyDefaultRouter ¶
ApplyDefaultRouter injects dual-model PrepareNextTurn when chat and tool models are set.
func ContextWindowFor ¶
ContextWindowFor returns the input token budget for a model name.
func HasFeature ¶
HasFeature reports whether a known model supports the given feature.
func MaxContextWindow ¶
MaxContextWindow returns the largest input token budget among the given model names.
func RegisterTestMetadata ¶
RegisterTestMetadata adds or overrides a catalog entry for the duration of a test.
Types ¶
type Feature ¶
type Feature string
Feature names a capability or modality supported by a model.
const ( // CapChat marks conversational chat support. CapChat Feature = "CapChat" // CapFunctionCall marks native tool / function calling support. CapFunctionCall Feature = "CapFunctionCall" // CapJsonMode marks structured JSON output mode support. CapJsonMode Feature = "CapJsonMode" // ModalityTextIn marks text input modality support. ModalityTextIn Feature = "ModalityTextIn" // ModalityTextOut marks text output modality support. ModalityTextOut Feature = "ModalityTextOut" // ModalityImageIn marks image input modality support. ModalityImageIn Feature = "ModalityImageIn" // ModalityFileIn marks file input modality support. ModalityFileIn Feature = "ModalityFileIn" )
type Metadata ¶
type Metadata struct {
// ID is the provider-facing model identifier.
ID string
// Name is a human-readable display name.
Name string
// Description summarizes model capabilities for UI and docs.
Description string
// ContextLength is the maximum input token budget.
ContextLength int
// MaxOutput is the maximum completion token budget.
MaxOutput int
// Features lists supported capabilities and modalities.
Features []Feature
}
Metadata describes a known LLM and its operational limits.
type Router ¶
Router selects between chat and tool models for dual-model strategies.
func (*Router) ApplyToContext ¶
ApplyToContext updates the agent context model field using router defaults.
func (*Router) PrepareNextTurnHook ¶
func (r *Router) PrepareNextTurnHook() msg.PrepareNextTurnFn
PrepareNextTurnHook returns a turn-boundary hook that routes to chat or tool models.