Skip to main content

Crate tokenmiser_cache

Crate tokenmiser_cache 

Source
Expand description

Two-layer cache: L1Cache is an exact-match TTL LRU, L2Cache is a per-tenant semantic cache over bge-small embeddings.

Re-exports§

pub use key::exact_key;
pub use l2::L2Cache;
pub use l2::SemanticStats;

Modules§

key
L1 exact-match cache key derivation.
l2
L2 semantic cache: prompts embedded with bge-small-en-v1.5 and matched per-tenant by cosine similarity against a threshold.

Structs§

CacheStats
L1Cache
Exact-match cache: a capacity-bounded LRU with per-entry TTL. A single mutex suffices because the critical section is a hash lookup plus a clone.