diff --git a/docs/my-website/docs/completion/usage.md b/docs/my-website/docs/completion/usage.md index d65fc1e655f..ea41c166bb3 100644 --- a/docs/my-website/docs/completion/usage.md +++ b/docs/my-website/docs/completion/usage.md @@ -70,6 +70,8 @@ Or set the environment variable (no config file change needed): LITELLM_ENFORCE_STREAMED_USAGE=true ``` +> **Note:** This value is read once at server startup. Changing it at runtime has no effect — a server restart is required. + Alternatively, configure it through the UI: 1. Navigate to the LiteLLM Proxy UI diff --git a/litellm/proxy/common_request_processing.py b/litellm/proxy/common_request_processing.py index 55182cafe61..6331db18f5c 100644 --- a/litellm/proxy/common_request_processing.py +++ b/litellm/proxy/common_request_processing.py @@ -53,7 +53,8 @@ StreamChunkSerializer = Callable[[Any], str] # Type alias for streaming error serializer (ProxyException -> wire format) StreamErrorSerializer = Callable[[ProxyException], str] -# Cached at module load time to avoid repeated env var lookups on every request +# Cached at module load time to avoid repeated env var lookups on every request. +# NOTE: changing this env var at runtime has no effect; a server restart is required. _ENFORCE_STREAMED_USAGE = ( os.environ.get("LITELLM_ENFORCE_STREAMED_USAGE", "false").lower() == "true" )