From 780a6293dca895e7a381ef2253b3622502dc20df Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Thu, 18 Jul 2024 14:29:32 -0700 Subject: [PATCH] Alias /health/liveliness as /health/liveness The latter is the more common term in Kubernetes, so it's nice to support that. --- litellm/proxy/_types.py | 1 + litellm/proxy/health_endpoints/_health_endpoints.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py index 7464714dba..7acd38e8b3 100644 --- a/litellm/proxy/_types.py +++ b/litellm/proxy/_types.py @@ -304,6 +304,7 @@ class LiteLLMRoutes(enum.Enum): "/routes", "/", "/health/liveliness", + "/health/liveness", "/health/readiness", "/test", "/config/yaml", diff --git a/litellm/proxy/health_endpoints/_health_endpoints.py b/litellm/proxy/health_endpoints/_health_endpoints.py index 494d9aa099..fa9edcdc83 100644 --- a/litellm/proxy/health_endpoints/_health_endpoints.py +++ b/litellm/proxy/health_endpoints/_health_endpoints.py @@ -483,7 +483,12 @@ async def health_readiness(): @router.get( - "/health/liveliness", + "/health/liveliness", # Historical LiteLLM name; doesn't match k8s terminology but kept for backwards compatibility + tags=["health"], + dependencies=[Depends(user_api_key_auth)], +) +@router.get( + "/health/liveness", # Kubernetes has "liveness" probes (https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) tags=["health"], dependencies=[Depends(user_api_key_auth)], ) @@ -516,6 +521,11 @@ async def health_readiness_options(): tags=["health"], dependencies=[Depends(user_api_key_auth)], ) +@router.options( + "/health/liveness", # Kubernetes has "liveness" probes (https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-liveness-command) + tags=["health"], + dependencies=[Depends(user_api_key_auth)], +) async def health_liveliness_options(): """ Options endpoint for health/liveliness check.