The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Fix greptile reviews
Sameer Kankuteb08e05845158
diff --git a/litellm/constants.py b/litellm/constants.pyindex a10a288d16c..a35bad7b98c 100644--- a/litellm/constants.py+++ b/litellm/constants.py@@ -1310,11 +1310,19 @@ HEALTH_CHECK_TIMEOUT_SECONDS = int(_background_health_check_max_tokens_env = os.getenv("BACKGROUND_HEALTH_CHECK_MAX_TOKENS")-BACKGROUND_HEALTH_CHECK_MAX_TOKENS: Optional[int] = (- int(_background_health_check_max_tokens_env)- if _background_health_check_max_tokens_env- else None-)+try:+ _raw_background_health_check_max_tokens = (+ _background_health_check_max_tokens_env.strip()+ if _background_health_check_max_tokens_env is not None+ else ""+ )+ BACKGROUND_HEALTH_CHECK_MAX_TOKENS: Optional[int] = (+ int(_raw_background_health_check_max_tokens)+ if _raw_background_health_check_max_tokens+ else None+ )+except (ValueError, TypeError):+ BACKGROUND_HEALTH_CHECK_MAX_TOKENS = NoneLITTELM_INTERNAL_HEALTH_SERVICE_ACCOUNT_NAME = "litellm-internal-health-check"LITTELM_CLI_SERVICE_ACCOUNT_NAME = "litellm-cli"LITELLM_INTERNAL_JOBS_SERVICE_ACCOUNT_NAME = "litellm_internal_jobs"