From 2e95947c4009c580deba3113b8c82ffc3a6212f8 Mon Sep 17 00:00:00 2001 From: yangdx Date: Tue, 15 Apr 2025 21:01:06 +0800 Subject: [PATCH] Fix: disable LLM cache recording while enable_llm_cache is disabled --- lightrag/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lightrag/utils.py b/lightrag/utils.py index 4e8bdd08..091f8ff2 100644 --- a/lightrag/utils.py +++ b/lightrag/utils.py @@ -731,6 +731,9 @@ async def save_to_cache(hashing_kv, cache_data: CacheData): hashing_kv: The key-value storage for caching cache_data: The cache data to save """ + if not hashing_kv.global_config.get("enable_llm_cache"): + return + # Skip if storage is None or content is a streaming response if hashing_kv is None or not cache_data.content: return