Documentation
¶
Overview ¶
Package cache owns the user-level, content-addressed embedding cache.
Index ¶
- Constants
- func ResolvePath() (string, error)
- type Cache
- func (c *Cache) Close() error
- func (c *Cache) Load(ctx context.Context, keys []semantic.CacheKey) (map[semantic.CacheKey][]float32, error)
- func (c *Cache) Path() string
- func (c *Cache) Prune(ctx context.Context, options PruneOptions) (PruneReport, error)
- func (c *Cache) Status(ctx context.Context) (Status, error)
- func (c *Cache) Store(ctx context.Context, entries []semantic.CacheEntry) error
- type ModelStatus
- type Options
- type PruneOptions
- type PruneReport
- type Status
Constants ¶
View Source
const ( EnvPath = "GRAFO_EMBED_CACHE" SchemaVersion = 1 )
Variables ¶
This section is empty.
Functions ¶
func ResolvePath ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func OpenReadOnly ¶
OpenReadOnly opens an existing compatible cache without creating files, changing permissions, checkpointing, or updating access timestamps.
func OpenWithOptions ¶
func (*Cache) Prune ¶
func (c *Cache) Prune(ctx context.Context, options PruneOptions) (PruneReport, error)
type ModelStatus ¶
type PruneOptions ¶
type PruneReport ¶
type PruneReport struct {
DryRun bool `json:"dry_run"`
DeletedRows int64 `json:"deleted_rows"`
FreedBlobBytes int64 `json:"freed_blob_bytes"`
RemainingRows int64 `json:"remaining_rows"`
RemainingBlobBytes int64 `json:"remaining_blob_bytes"`
DatabaseBytes int64 `json:"database_bytes"`
WALBytes int64 `json:"wal_bytes"`
SHMBytes int64 `json:"shm_bytes"`
ReclaimableBytes int64 `json:"reclaimable_bytes"`
}
type Status ¶
type Status struct {
Path string `json:"path"`
SchemaVersion int `json:"schema_version"`
Models []ModelStatus `json:"models"`
Rows int64 `json:"rows"`
BlobBytes int64 `json:"blob_bytes"`
DatabaseBytes int64 `json:"database_bytes"`
WALBytes int64 `json:"wal_bytes"`
SHMBytes int64 `json:"shm_bytes"`
ReclaimableBytes int64 `json:"reclaimable_bytes"`
OldestUsedAt string `json:"oldest_used_at,omitempty"`
NewestUsedAt string `json:"newest_used_at,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.