CacheConfig

org.llm4s.llmconnect.caching.CacheConfig
See theCacheConfig companion object
sealed abstract case class CacheConfig

Configuration for the CachingLLMClient semantic cache.

Uses the sealed-abstract-case-class pattern to prevent direct construction and disable the generated copy method; always construct via CacheConfig.create, which validates all fields and returns a typed error on invalid input.

Value parameters

maxSize

Maximum number of entries in the in-memory cache. When the limit is reached the least-recently-used entry is evicted automatically.

similarityThreshold

Minimum cosine similarity [0.0, 1.0] for a cache hit. A value of 1.0 requires near-identical queries; lower values allow semantically similar but textually different queries to share a cached response.

ttl

Maximum age of a CacheEntry before it is considered expired and the cache is bypassed. Must be positive.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product