Documentation
¶
Overview ¶
Package llms is the file-backed LLM model registry behind the ##llm command. Each known model is ONE YAML file at
<rysh-dir>/llms/<provider>/<model-name>
e.g. .rysh/llms/anthropic/fable5 or .rysh/llms/openai/gpt55. The ##llm command lists ONLY what these files declare, activates one as the session default, and persists new declarations (##llm model add openai/gpt55). A first use seeds the folder with a starter set for anthropic, openai, grok, and gemini.
Index ¶
- Constants
- func ParseRef(ref string) (providerName, modelName string, err error)
- type ModelSpec
- type Store
- func (s *Store) Add(spec ModelSpec) (string, error)
- func (s *Store) Dir() string
- func (s *Store) Get(providerName, modelName string) (*ModelSpec, error)
- func (s *Store) List() (providers []string, byProvider map[string][]ModelSpec, err error)
- func (s *Store) Path(providerName, modelName string) string
- func (s *Store) SeedIfEmpty() error
Constants ¶
const ExecutableProvider = "anthropic"
ExecutableProvider is the provider whose models rysh can actually run today (the agentic executor speaks the Anthropic Messages API).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ModelSpec ¶
type ModelSpec struct {
Provider string `yaml:"provider"`
Name string `yaml:"name"`
Model string `yaml:"model"` // provider API model id
Description string `yaml:"description,omitempty"`
MaxTokens int `yaml:"max_tokens,omitempty"`
// Effort is an optional default reasoning effort activated with the model
// (low|medium|high|xhigh|max — anthropic providers only).
Effort string `yaml:"effort,omitempty"`
Added string `yaml:"added,omitempty"` // YYYY-MM-DD, set on Add
}
ModelSpec is the YAML content of one model file. Name/Provider mirror the file's location (path is authoritative on read; the fields are filled in for callers).
func (ModelSpec) Executable ¶
Executable reports whether rysh's executor can run this model.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads and writes the registry under <rysh-dir>/llms.
func (*Store) Add ¶
Add persists a model file (creating the provider folder), returning its path. Overwrites an existing declaration for the same provider/name.
func (*Store) List ¶
List returns the registry content: provider names in sorted order and each provider's models sorted by name. Unparseable files are skipped (listed callers should not brick on one bad YAML file).
func (*Store) Path ¶
Path returns the on-disk location of one model file (whether or not it exists) — surfaced by `##llm info`.
func (*Store) SeedIfEmpty ¶
SeedIfEmpty populates the registry with the starter set when the llms folder does not exist yet (or holds no models). Existing content is never touched — the folder is the single source of truth once it has models.