From 1dcab433b40f3ea46fc893f0c04750070d6444c9 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 23 Nov 2023 10:52:50 -0800 Subject: [PATCH] (feat) proxy: caching - show redis settings when initializing --- litellm/proxy/proxy_server.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index fcf5a2057..ab2973261 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -267,12 +267,23 @@ def load_router_config(router: Optional[litellm.Router], config_file_path: str): if litellm_settings: for key, value in litellm_settings.items(): if key == "cache": - print("\nSetting Cache on Config\n") + # ANSI escape code for blue text + blue_color_code = "\033[94m" + reset_color_code = "\033[0m" + print(f"{blue_color_code}\nSetting Cache on Proxy") from litellm.caching import Cache cache_type = value["type"] cache_host = os.environ.get("REDIS_HOST") cache_port = os.environ.get("REDIS_PORT") cache_password = os.environ.get("REDIS_PASSWORD") + + # Assuming cache_type, cache_host, cache_port, and cache_password are strings + print(f"{blue_color_code}Cache Type:{reset_color_code} {cache_type}") + print(f"{blue_color_code}Cache Host:{reset_color_code} {cache_host}") + print(f"{blue_color_code}Cache Port:{reset_color_code} {cache_port}") + print(f"{blue_color_code}Cache Password:{reset_color_code} {cache_password}") + print() + litellm.cache = Cache( type=cache_type, host=cache_host,