From 2d7350412440f07535768bc6b7bc522bf55bc678 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 30 Apr 2026 17:51:54 +0000 Subject: [PATCH] fix(model_deprecation): drop env-var overrides to satisfy docs validation The proxy documentation lives in BerriAI/litellm-docs and any new env key flagged by os.getenv() must be added there before the test_env_keys.py CI check passes. Rather than fork the docs repo for two niche tunables, hard-code the defaults: - DEFAULT_DEPRECATION_WARN_DAYS = 30 (already overridable per-request via ?warn_within_days=N on /model/deprecations). - DEFAULT_DEPRECATION_CHECK_INTERVAL_SECONDS = 24h. Both can still be raised as env-var follow-ups together with their docs update if operators ask for it. Co-authored-by: Mateo Wang --- litellm/types/proxy/model_deprecation.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/litellm/types/proxy/model_deprecation.py b/litellm/types/proxy/model_deprecation.py index 72ccb48fbfc..8cf98f7a1d5 100644 --- a/litellm/types/proxy/model_deprecation.py +++ b/litellm/types/proxy/model_deprecation.py @@ -8,27 +8,23 @@ alerting. These types describe the response payload and the alert payload. from __future__ import annotations -import os from datetime import date, datetime from typing import List, Optional from pydantic import BaseModel, Field -DEFAULT_DEPRECATION_WARN_DAYS = int( - os.getenv("LITELLM_MODEL_DEPRECATION_WARN_DAYS", "30") -) -"""Number of days before the deprecation date to start raising warnings. +DEFAULT_DEPRECATION_WARN_DAYS = 30 +"""Default warning window (in days) for the ``imminent`` bucket. -Configurable via the ``LITELLM_MODEL_DEPRECATION_WARN_DAYS`` environment -variable. Defaults to 30 days, matching the typical migration window most -LLM providers offer between announcement and removal. +Matches the typical migration window most LLM providers offer between +deprecation announcement and removal. Callers of ``/model/deprecations`` +can override this per-request via the ``?warn_within_days=N`` query +parameter without restarting the proxy. """ -DEFAULT_DEPRECATION_CHECK_INTERVAL_SECONDS = int( - os.getenv("LITELLM_MODEL_DEPRECATION_CHECK_INTERVAL", str(24 * 60 * 60)) -) -"""How often the periodic background check runs. Defaults to once per day.""" +DEFAULT_DEPRECATION_CHECK_INTERVAL_SECONDS = 24 * 60 * 60 +"""How often the periodic background check runs. Once per day.""" DeprecationStatusLiteral = str