diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 56fc298ae..80bc2b1cb 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -673,6 +673,11 @@ class ProxyConfig: ) print() # noqa + # users can pass os.environ/ variables on the proxy - we should read them from the env + for key, value in cache_params.items(): + if value.startswith("os.environ/"): + cache_params[key] = litellm.get_secret(value) + ## to pass a complete url, or set ssl=True, etc. just set it as `os.environ[REDIS_URL] = `, _redis.py checks for REDIS specific environment variables litellm.cache = Cache(**cache_params) print( # noqa diff --git a/litellm/tests/test_configs/test_cloudflare_azure_with_cache_config.yaml b/litellm/tests/test_configs/test_cloudflare_azure_with_cache_config.yaml index 839891a1d..c19caaf48 100644 --- a/litellm/tests/test_configs/test_cloudflare_azure_with_cache_config.yaml +++ b/litellm/tests/test_configs/test_cloudflare_azure_with_cache_config.yaml @@ -12,4 +12,6 @@ litellm_settings: cache_params: # set cache params for s3 type: s3 s3_bucket_name: cache-bucket-litellm # AWS Bucket Name for S3 - s3_region_name: us-west-2 # AWS Region Name for S3 \ No newline at end of file + s3_region_name: us-west-2 # AWS Region Name for S3 + s3_aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID # AWS Access Key ID for S3 + s3_aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY # AWS Secret Access Key for S3 \ No newline at end of file