mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
test(aiand): derive retired models from the rows instead of pinning dates
The wildcard test now reads each row's deprecation_date, so it holds whichever dates ai& sets, and the test that only restated the JSON dates is gone
This commit is contained in:
parent
629d819d23
commit
1a6ce18e57
1 changed files with 6 additions and 19 deletions
|
|
@ -90,32 +90,19 @@ def _aiand_catalog() -> frozenset[str]:
|
|||
return frozenset(name for name, info in litellm.model_cost.items() if info.get("litellm_provider") == "aiand")
|
||||
|
||||
|
||||
AIAND_RETIREMENT_DATES: Final = {
|
||||
"aiand/deepseek-ai/deepseek-v4-flash": "2026-10-27",
|
||||
"aiand/zai-org/glm-5.2": "2026-10-27",
|
||||
"aiand/moonshotai/kimi-k2.7-code": "2026-10-27",
|
||||
"aiand/deepseek-ai/deepseek-v4.1-flash": "2026-11-06",
|
||||
}
|
||||
|
||||
|
||||
def test_aiand_wildcard_lists_only_its_live_models():
|
||||
def test_aiand_wildcard_lists_only_models_not_yet_retired():
|
||||
catalog: Final = _aiand_catalog()
|
||||
|
||||
retired: Final = frozenset(
|
||||
model
|
||||
for model, retired_on in AIAND_RETIREMENT_DATES.items()
|
||||
if datetime.date.fromisoformat(retired_on) <= datetime.date.today()
|
||||
name
|
||||
for name in catalog
|
||||
if (retired_on := litellm.model_cost[name].get("deprecation_date")) is not None
|
||||
and datetime.date.fromisoformat(retired_on) <= datetime.date.today()
|
||||
)
|
||||
|
||||
assert frozenset(AIAND_RETIREMENT_DATES) < catalog
|
||||
assert catalog - retired
|
||||
assert frozenset(get_known_models_from_wildcard("aiand/*")) == catalog - retired
|
||||
|
||||
|
||||
def test_aiand_retired_models_carry_their_retirement_date():
|
||||
for model, retired_on in AIAND_RETIREMENT_DATES.items():
|
||||
assert litellm.model_cost[model]["deprecation_date"] == retired_on
|
||||
|
||||
|
||||
def test_aiand_calls_are_billed_from_their_cost_rows():
|
||||
catalog: Final = _aiand_catalog()
|
||||
assert catalog
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue