Expand description
Content-addressed cache for parsed LLM responses and the requests that produced them.
Every successful one-shot LLM call writes the provider request JSON and
parsed payload here keyed on the canonical request material (operation,
model, prompts, schema, …). Subsequent calls with
byte-identical inputs short-circuit the network round-trip and replay the
parsed value, which is the cheapest
possible recovery when the caller (eg. lgit --compose) is rerun after a
transient failure or unrelated edit.
Backed by SQLite for atomic upserts and TTL-based eviction. The cache is
best-effort: any failure to read/write is logged and skipped — never fatal.
Structs§
- Cache
Material - Material that uniquely identifies a one-shot LLM call. Hashed into the cache key.
- Cached
LlmResponse - LlmCache
- SQLite-backed cache of LLM responses. Cheap to clone via
Arc.
Functions§
- compute_
key - Compute a content-addressed cache key over
material. Stable across runs for byte-identical inputs. - global
- Get the active cache handle, if any. Cheap clone of an
Arc. - init
- Initialize the global LLM response cache from
config. Idempotent: only the first call wins.