From 055629d30d78fad7db9183127b68059b6328af73 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sun, 27 Jul 2025 10:33:06 +0800 Subject: [PATCH] Reduce default max total tokens to 30k --- env.example | 4 ++-- lightrag/constants.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/env.example b/env.example index 6eb32538..f0b13bb6 100644 --- a/env.example +++ b/env.example @@ -61,7 +61,7 @@ ENABLE_LLM_CACHE=true ### control the actual relations send to LLM # MAX_RELATION_TOKENS=10000 ### control the maximum tokens send to LLM (include entities, raltions and chunks) -# MAX_TOTAL_TOKENS=32000 +# MAX_TOTAL_TOKENS=30000 ### maximum number of related chunks per source entity or relation (higher values increase re-ranking time) # RELATED_CHUNK_NUMBER=5 @@ -92,7 +92,7 @@ ENABLE_LLM_CACHE_FOR_EXTRACT=true ############################### ### Max concurrency requests of LLM (for both query and document processing) MAX_ASYNC=4 -### Number of parallel processing documents(between 2~10, MAX_ASYNC/4 is recommended) +### Number of parallel processing documents(between 2~10, MAX_ASYNC/3 is recommended) MAX_PARALLEL_INSERT=2 ### Max concurrency requests for Embedding # EMBEDDING_FUNC_MAX_ASYNC=8 diff --git a/lightrag/constants.py b/lightrag/constants.py index a3773f63..35d10825 100644 --- a/lightrag/constants.py +++ b/lightrag/constants.py @@ -17,7 +17,7 @@ DEFAULT_TOP_K = 40 DEFAULT_CHUNK_TOP_K = 10 DEFAULT_MAX_ENTITY_TOKENS = 10000 DEFAULT_MAX_RELATION_TOKENS = 10000 -DEFAULT_MAX_TOTAL_TOKENS = 32000 +DEFAULT_MAX_TOTAL_TOKENS = 30000 DEFAULT_HISTORY_TURNS = 0 DEFAULT_ENABLE_RERANK = True DEFAULT_COSINE_THRESHOLD = 0.2