modelcatalog

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

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

View Source
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.

func New

func New(value config.Config) (Catalog, error)

New validates the complete local registry and returns a network-free catalog. The current selection is included even when its metadata is absent.

type Endpoint

type Endpoint struct {
	BaseURL         string
	AllowHTTP       bool
	AllowPrivateIPs bool
	Origin          string
}

Endpoint is the resolved provider connection boundary.

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
	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) 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

func SelectionFromConfig(value config.Config) Selection

SelectionFromConfig returns the initial process-local selection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL