Documentation
¶
Overview ¶
Package modelcatalog resolves immutable provider/model snapshots from the local coding configuration. It never performs discovery or network I/O.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalid = errors.New("coding model catalog: invalid configuration")
ErrInvalid means a registry entry or selection cannot be resolved safely.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog interface {
Resolve(Selection) (ResolvedModel, error)
List() []Entry
}
Catalog is the read-only model lookup boundary used by CLI/TUI/runtime. Future extensions can supply the same interface without changing callers.
type Entry ¶
type Entry struct {
Ref config.ModelRef
ContextWindow int
StreamContinuation bool
ReasoningLevels []config.ReasoningLevel
DefaultReasoning *config.ReasoningLevel
Variants []string
DefaultVariant string
}
Entry is one selectable model and its declared presets.
type Limits ¶
type Limits struct {
ContextWindow int
}
Limits are local context metadata and are never sent as request options.
type ResolvedModel ¶
type ResolvedModel struct {
Ref config.ModelRef
Protocol config.Protocol
Endpoint Endpoint
Limits Limits
StreamContinuation bool
// StreamIdleTimeout is the streaming idle bound the transport applies, after
// the model's value has overridden the provider's. Zero means neither
// declared one, so the adapter's own default stands; the retry window is
// derived from whichever bound ends up in effect.
StreamIdleTimeout time.Duration
Compatibility openai.Compatibility
Capabilities ai.CapabilityOverride
Options config.ModelOptions
Variant string
ReasoningLevels []config.ReasoningLevel
ReasoningLevel *config.ReasoningLevel
ReasoningBudgets map[config.ReasoningLevel]int
}
ResolvedModel is an immutable-by-convention runtime snapshot.
func (ResolvedModel) Clone ¶
func (m ResolvedModel) Clone() ResolvedModel
Clone returns a fully detached runtime snapshot.
func (ResolvedModel) EffectiveReasoningLevel ¶ added in v0.1.8
func (m ResolvedModel) EffectiveReasoningLevel() (config.ReasoningLevel, bool)
EffectiveReasoningLevel reports the reasoning level the request assembly sends for this model, and whether one is selected at all.
[registry.resolve] folds the explicit selection, the variant's level and the model's DefaultReasoningLevel into ReasoningLevel, and the generation layer sends exactly that value. A false result means pips sends no level and the provider's own default applies, which pips cannot know: it ships no model capability database. A caller must therefore show that case as "default" or omit it rather than inventing a level.
func (ResolvedModel) Equal ¶
func (m ResolvedModel) Equal(other ResolvedModel) bool
Equal reports value equality without relying on pointer or map identity.
type Selection ¶
type Selection struct {
Ref config.ModelRef
Variant string
ReasoningOverride *config.ReasoningLevel
}
Selection is one process-local model, variant, and reasoning choice.
func SelectionFromConfig ¶
SelectionFromConfig returns the initial process-local selection.