File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ class QueryParam:
320320 max_relation_tokens: int = int (os.getenv(" MAX_RELATION_TOKENS" , " 10000" ))
321321 """ Maximum number of tokens allocated for relationship context in unified token control system."""
322322
323- max_total_tokens: int = int (os.getenv(" MAX_TOTAL_TOKENS" , " 32000 " ))
323+ max_total_tokens: int = int (os.getenv(" MAX_TOTAL_TOKENS" , " 30000 " ))
324324 """ Maximum total tokens budget for the entire query context (entities + relations + chunks + system prompt)."""
325325
326326 hl_keywords: list[str ] = field(default_factory = list )
Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ class QueryParam:
327327 max_relation_tokens: int = int (os.getenv(" MAX_RELATION_TOKENS" , " 10000" ))
328328 """ Maximum number of tokens allocated for relationship context in unified token control system."""
329329
330- max_total_tokens: int = int (os.getenv(" MAX_TOTAL_TOKENS" , " 32000 " ))
330+ max_total_tokens: int = int (os.getenv(" MAX_TOTAL_TOKENS" , " 30000 " ))
331331 """ Maximum total tokens budget for the entire query context (entities + relations + chunks + system prompt)."""
332332
333333 conversation_history: list[dict[str , str ]] = field(default_factory = list )
Original file line number Diff line number Diff line change @@ -48,15 +48,19 @@ OLLAMA_EMULATING_MODEL_TAG=latest
4848# LIGHTRAG_API_KEY=your-secure-api-key-here
4949# WHITELIST_PATHS=/health,/api/*
5050
51- ########################
51+ ######################################################################################
5252### Query Configuration
53- ########################
53+ ###
54+ ### How to control the context lenght sent to LLM:
55+ ### MAX_ENTITY_TOKENS + MAX_RELATION_TOKENS < MAX_TOTAL_TOKENS
56+ ### Chunk_Tokens = MAX_TOTAL_TOKENS - Actual_Entity_Tokens - Actual_Reation_Tokens
57+ ######################################################################################
5458# LLM responde cache for query (Not valid for streaming response)
5559ENABLE_LLM_CACHE=true
5660# COSINE_THRESHOLD=0.2
5761### Number of entities or relations retrieved from KG
5862# TOP_K=40
59- ### Maxmium number or chunks plan to send to LLM
63+ ### Maxmium number or chunks for naive vactor search
6064# CHUNK_TOP_K=10
6165### control the actual enties send to LLM
6266# MAX_ENTITY_TOKENS=10000
You can’t perform that action at this time.
0 commit comments