feat(hicache): support file backend reading directory config form env. (#8498)

This commit is contained in:
hzh0425
2025-07-30 12:18:46 +08:00
committed by GitHub
parent 9effeb5bdd
commit a85ebf50b8

View File

@@ -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 ""