go.bigb.es/claudio

v0.7.0
Doc Versions Source

Constants

const SeparatorCategory = "───"

SeparatorCategory is a special category name rendered as a divider line.

Functions

f func CategorizeByProvider

src
func CategorizeByProvider(models []OllamaModel, popularNames []string) ([]string, map[string][]OllamaModel)

CategorizeByProvider groups models by provider for cloud instances. Models are grouped by company name extracted from the model name prefix. popularNames (from FetchPopularNames) determines the "Popular" category; models whose base name (before ":") matches a popular name are included, preserving the popularity order. The returned order is: Popular, separator, then provider groups alphabetically. Within each company, models are sorted by modified_at (newest first).

f func CategorizeModels

src
func CategorizeModels(models []OllamaModel) ([]string, map[string][]OllamaModel)

CategorizeModels groups models by family and returns ordered family names plus the grouped map.

f func FetchModelDetails

src
func FetchModelDetails(models []OllamaModel, baseURL, apiKey, provKey string, sc ShowCache)

FetchModelDetails enriches models with context_length and capabilities from /api/show. It uses the cache to avoid re-fetching models whose ModifiedAt hasn't changed.

f func FetchPopularNames

src
func FetchPopularNames() ([]string, error)

FetchPopularNames scrapes ollama.com/search?c=cloud for popular model names. Returns base names (e.g. "qwen3.5", "glm-5") in popularity order.

Types

T type ModelShowInfo

src
type ModelShowInfo struct {
	ContextLength int
	Capabilities  []string
}

ModelShowInfo holds the fields extracted from /api/show.

f func ShowModel

src
func ShowModel(baseURL, apiKey, modelName string) (ModelShowInfo, error)

ShowModel calls /api/show to get detailed info for a single model.

T type OllamaDetails

src
type OllamaDetails struct {
	Family          string   `json:"family"`
	Families        []string `json:"families"`
	ParameterSize   string   `json:"parameter_size"`
	QuantizationLvl string   `json:"quantization_level"`
}

OllamaDetails contains model metadata.

T type OllamaModel

src
type OllamaModel struct {
	Name          string        `json:"name"`
	Model         string        `json:"model"`
	ModifiedAt    string        `json:"modified_at"`
	Size          int64         `json:"size"`
	Details       OllamaDetails `json:"details"`
	ContextLength int           `json:"context_length,omitempty"`
	Capabilities  []string      `json:"capabilities,omitempty"`
}

OllamaModel represents a model returned by the Ollama /api/tags endpoint.

f func ListModels

src
func ListModels(baseURL, apiKey string) ([]OllamaModel, error)

ListModels fetches available models from an Ollama instance. baseURL is e.g. "http://localhost:11434" or "https://ollama.com". apiKey may be empty for local instances.

m func (OllamaModel) DisplayName

src
func (m OllamaModel) DisplayName() string

DisplayName returns a human-friendly label for the model.

m func (OllamaModel) Family

src
func (m OllamaModel) Family() string

Family returns the model family for grouping.

m func (OllamaModel) Provider

src
func (m OllamaModel) Provider() string

Provider returns the provider/namespace for a model. For namespaced models ("namespace/model:tag") it returns the namespace; otherwise it falls back to the model family.

T type ShowCache

src
type ShowCache interface {
	GetOllamaModelInfo(provider, model string) (modifiedAt string, contextLength int, capabilities string, ok bool)
	SetOllamaModelInfo(provider, model, modifiedAt string, contextLength int, capabilities string) error
}

ShowCache provides get/set for per-model /api/show info.

Source Files