InMemoryEmbeddingCache
org.llm4s.llmconnect.caching.InMemoryEmbeddingCache
class InMemoryEmbeddingCache[Embedding](maxSize: Int, ttl: Option[FiniteDuration], clock: () => Long) extends EmbeddingCache[Embedding]
Thread-safe in-memory implementation of EmbeddingCache with LRU eviction.
Type parameters
- Embedding
-
The embedding type (usually Seq[Double]).
Value parameters
- maxSize
-
The maximum number of embeddings to store before evicting the oldest.
- ttl
-
Optional Time-To-Live for cache entries. Expired entries are lazily evicted on access.
Attributes
- Graph
-
- Supertypes
Members list
In this article