From a85ebf50b8d7b19f4cc435eac6a084f1f2c13eaa Mon Sep 17 00:00:00 2001 From: hzh0425 Date: Wed, 30 Jul 2025 12:18:46 +0800 Subject: [PATCH] feat(hicache): support file backend reading directory config form env. (#8498) --- python/sglang/srt/mem_cache/hicache_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/mem_cache/hicache_storage.py b/python/sglang/srt/mem_cache/hicache_storage.py index 45b26d100..0e4a7184c 100644 --- a/python/sglang/srt/mem_cache/hicache_storage.py +++ b/python/sglang/srt/mem_cache/hicache_storage.py @@ -85,7 +85,7 @@ class HiCacheStorage(ABC): class HiCacheFile(HiCacheStorage): def __init__(self, file_path: str = "/tmp/hicache"): - self.file_path = file_path + self.file_path = os.getenv("SGLANG_HICACHE_FILE_BACKEND_STORAGE_DIR", file_path) tp_rank = get_tensor_model_parallel_rank() tp_size = get_tensor_model_parallel_world_size() self.tp_suffix = f"_{tp_rank}_{tp_size}" if tp_size > 1 else ""