go.bigb.es/claudio
Index
- type DB
- func Open() (*DB, error)
- func (*DB) AddUsedModel(id, name string) error
- func (*DB) AddUsedModelForProvider(provider, id, name string) error
- func (*DB) Close() error
- func (*DB) DropAllCaches() error
- func (*DB) DropProviderCache(provider string) error
- func (*DB) GetModels(provider string) ([]byte, bool)
- func (*DB) GetOllamaModelInfo(provider, model string) (modifiedAt string, contextLength int, capabilities string, ok bool)
- func (*DB) SetModels(provider string, data []byte) error
- func (*DB) SetOllamaModelInfo(provider, model, modifiedAt string, contextLength int, capabilities string) error
- func (*DB) UsedModels() ([]UsedModel, error)
- func (*DB) UsedModelsForProvider(provider string) ([]UsedModel, error)
- type UsedModel
Types
type DB struct { // contains filtered or unexported fields }
Open creates or opens the cache database in the XDG config directory.
func (d *DB) AddUsedModel(id, name string) error
AddUsedModel records a model as recently used (legacy, no provider).
func (d *DB) AddUsedModelForProvider(provider, id, name string) error
AddUsedModelForProvider records a model as recently used for a specific provider.
func (d *DB) DropAllCaches() error
DropAllCaches removes all cached model lists, recently used models, and ollama show caches.
func (d *DB) DropProviderCache(provider string) error
DropProviderCache removes the cached model list and recently used models for a specific provider.
func (d *DB) GetModels(provider string) ([]byte, bool)
GetModels returns a cached model list for the given provider. Returns nil, false if the cache is empty or expired.
func (d *DB) GetOllamaModelInfo(provider, model string) (modifiedAt string, contextLength int, capabilities string, ok bool)
GetOllamaModelInfo returns cached /api/show info for an Ollama model.
func (d *DB) SetModels(provider string, data []byte) error
SetModels stores a model list in the cache for the given provider.
func (d *DB) SetOllamaModelInfo(provider, model, modifiedAt string, contextLength int, capabilities string) error
SetOllamaModelInfo caches /api/show info for an Ollama model.
UsedModels returns all previously used models, most recent first (legacy, no provider).
DB wraps a SQLite database used for caching model lists and tracking used models.