org.llm4s.llmconnect.caching.InMemoryEmbeddingCache
See theInMemoryEmbeddingCache companion object
@Stable
final class InMemoryEmbeddingCache extends EmbeddingCache
Thread-safe in-memory EmbeddingCache with LRU eviction and an optional TTL. Its operations never fail.
Build one with InMemoryEmbeddingCache.create, which checks its arguments.
Value parameters
- clock
-
the clock the TTL is measured with
- maxSize
-
the maximum number of embeddings to store before evicting the least recently used
- ttl
-
how long an entry stays valid; an expired entry is evicted when it is next looked up. An entry exactly
ttlold is still valid.
Attributes
- Companion
- object
- Source
- InMemoryEmbeddingCache.scala
- Graph
-
- Supertypes
Members list
In this article
