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 <mateo-berri@users.noreply.github.com>
This commit is contained in:
Cursor Agent 2026-04-30 17:51:54 +00:00 committed by Devin AI
parent f249356e16
commit 2d73504124

View file

@ -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