Documentation
¶
Overview ¶
Package llmcache is a content-addressed, on-disk cache for LLM review responses. Keys hash provider+model+prompt so a model or prompt change never produces a false hit; entries expire by TTL and the store is safe for concurrent writers (temp file + atomic rename). It depends only on the standard library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache stores LLM responses on disk under dir, expiring entries older than ttl.
func New ¶
New creates a Cache under os.UserCacheDir()/gitl/review. It returns an error when the user cache dir cannot be resolved; callers degrade to "no cache" rather than crashing.
func (*Cache) Get ¶
Get returns the cached response for key. It reports (zero, false, nil) on a miss (including an expired entry, which it best-effort deletes) and (zero, false, err) when an existing entry exists but cannot be read or parsed.