catalog

package
v0.8.3 Latest Latest
Warning

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

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

Documentation

Overview

Package catalog loads and queries model metadata. It has no provider behavior or global registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuiltinModels

func BuiltinModels(provider string) []models.ModelSpec

BuiltinModels returns an independent copy of a provider's generated catalog. Provider definitions never own or embed a second model list.

func EntryType

func EntryType(t types.ModelType) types.ModelType

EntryType folds a model type onto the catalog entries that describe it: chat entries leave Type empty, and VLM rows use them too.

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog is an immutable model index for one provider. Queries return owned copies.

func New

func New(entries []models.ModelSpec) *Catalog

New builds an immutable index from an owned copy of the supplied entries.

func (*Catalog) FindModel

func (c *Catalog) FindModel(name string, modelType types.ModelType) (models.ModelSpec, bool)

FindModel looks a model name up among the vendor's entries of one model type: exact id, then aliases, then glob patterns (longest literal prefix wins). Matching is case-insensitive.

The type is part of the key because families share prefixes across types. Aliyun's qwen3* chat glob also matches qwen3.8-text-embedding, and gpt-5* matches gpt-5-embed; an untyped lookup would hand an embedding row the chat family's compat, which the embedding overlay rejects, and the row could not be built at all. A VLM row is a chat model that accepts images, so it looks among the chat entries.

func (*Catalog) Models

func (c *Catalog) Models() []models.ModelSpec

Models returns independent copies of all entries, including hidden rules.

func (*Catalog) ModelsByType

func (c *Catalog) ModelsByType(modelType types.ModelType) []models.ModelSpec

ModelsByType returns the vendor's catalog entries for a model type, hiding deprecated and pattern-only entries.

Jump to

Keyboard shortcuts

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