Documentation
¶
Overview ¶
Package models lists available Grok CLI models from on-disk files only (~/.grok/config.toml and models_cache.json). It does not spawn `grok models`.
Index ¶
Constants ¶
View Source
const ( // DefaultConfigFile is the Grok home config name. DefaultConfigFile = "config.toml" // ModelsCacheFile is the Grok home models cache name. ModelsCacheFile = "models_cache.json" )
Variables ¶
This section is empty.
Functions ¶
func DefaultHome ¶
func DefaultHome() string
DefaultHome returns $GROK_HOME when set, otherwise $HOME/.grok. Empty HOME falls back to a temp-dir based path (same idea as agenttty.GrokHome).
Types ¶
type Catalog ¶
type Catalog struct {
// Home is the resolved Grok data directory used for the listing.
Home string `json:"home"`
// Default is [models].default from config.toml (empty when unset/missing).
Default string `json:"default,omitempty"`
// Models is the sorted unique union of config.toml [model."…"] keys and
// models_cache.json model ids. Empty when neither source yields ids.
Models []string `json:"models"`
// FromConfig is true when config.toml was read successfully.
FromConfig bool `json:"from_config"`
// FromCache is true when models_cache.json was read successfully.
FromCache bool `json:"from_cache"`
}
Catalog is the merged file-backed model list for a Grok home.
Click to show internal directories.
Click to hide internal directories.