Documentation
¶
Index ¶
- type Finder
- func (d *Finder) AddConfig(name string, cfg *provider.Config)
- func (d *Finder) Best(p *llm.ModelPreferences) string
- func (d *Finder) Candidates() []matcher.Candidate
- func (d *Finder) DropModel(name string)
- func (d *Finder) Find(ctx context.Context, id string) (llm.Model, error)
- func (d *Finder) Matcher() *matcher.Matcher
- func (d *Finder) Remove(name string)
- func (d *Finder) TokenPrices(id string) (in float64, out float64, cached float64, ok bool)
- func (d *Finder) Version() int64
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
func (*Finder) Candidates ¶
Candidates returns lightweight view used by matcher.
func (*Finder) DropModel ¶
DropModel removes an already instantiated llm.Model instance but keeps its configuration. Next Find() will create a fresh model using the existing config. Useful after model implementation reload without deleting YAML.
func (*Finder) Remove ¶
Remove deletes a model configuration and any instantiated model from the finder caches. It bumps the internal version so hot-swap watchers can detect the change.
func (*Finder) TokenPrices ¶ added in v0.2.9
TokenPrices returns per-1k token prices for the specified model ID when available in the model configuration. Returns ok=false when no config exists or prices are not set.
type Option ¶
type Option func(dao *Finder)
Option defines a functional option for Finder
func WithConfigLoader ¶
func WithConfigLoader(loader modelprovider.ConfigLoader) Option
WithConfigLoader sets a custom configuration loader for the Finder instance.
func WithInitial ¶
func WithInitial(configs ...*modelprovider.Config) Option
WithInitial adds model configurations to the Finder instance.