mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-11-26 10:06:31 +00:00
fix(cache): skip embeddings in the response cache
Embeddings responses are large and rarely repeat. Each one was stored for the cache TTL in the shared Redis. A burst of them raised memory on the shared Dragonfly to its limit. The cache now skips /v1/embeddings unless cache.cacheEmbeddings is true. The default is false. Chat caching does not change.
This commit is contained in:
@@ -473,6 +473,10 @@ type CacheConfig struct {
|
||||
// budgets also bind repeated identical prompts. Defaults to false: a
|
||||
// hit then adds only to the request counters.
|
||||
AccountHits bool `json:"accountHits,omitempty"`
|
||||
// CacheEmbeddings opts /v1/embeddings responses into the cache. Off by
|
||||
// default: a vector body is large and rarely repeats, so it fills the
|
||||
// shared Redis for little benefit.
|
||||
CacheEmbeddings bool `json:"cacheEmbeddings,omitempty"`
|
||||
}
|
||||
|
||||
// BreakerConfig configures the per-provider discovery circuit breaker
|
||||
|
||||
Reference in New Issue
Block a user