From 6373ea090ef97c5d13f25a941f4b96aeb23317a8 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Tue, 25 Aug 2026 13:25:46 -0700 Subject: [PATCH] fix(scripts): drop supports_prompt_caching when cached pricing leaves the together_ai catalog --- scripts/sync_together_ai_models.py | 2 +- tests/test_litellm/test_sync_together_ai_models.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/sync_together_ai_models.py b/scripts/sync_together_ai_models.py index a7f3f36b555..97b308fb660 100644 --- a/scripts/sync_together_ai_models.py +++ b/scripts/sync_together_ai_models.py @@ -308,7 +308,7 @@ def _new_entry(model: CatalogModel, mode: str) -> RegistryEntry: def _updated_entry(entry: RegistryEntry, model: CatalogModel) -> tuple[RegistryEntry, tuple[str, ...]]: rule: Final = RULES_BY_ID.get(model.id) desired: Final = {**_api_fields(model), **(dict(rule.fields) if rule else {})} - dropped: Final = () if model.pricing.cached_input else ("cache_read_input_token_cost",) + dropped: Final = () if model.pricing.cached_input else ("cache_read_input_token_cost", "supports_prompt_caching") changes: Final = tuple( f"{name}: {entry.get(name)!r} -> {value!r}" for name, value in desired.items() if entry.get(name) != value ) + tuple( diff --git a/tests/test_litellm/test_sync_together_ai_models.py b/tests/test_litellm/test_sync_together_ai_models.py index 747cba87078..7c1287e94b8 100644 --- a/tests/test_litellm/test_sync_together_ai_models.py +++ b/tests/test_litellm/test_sync_together_ai_models.py @@ -193,6 +193,7 @@ def test_cached_input_appearing_and_disappearing() -> None: catalog = [_chat_model("acme/chat-1"), _chat_model("acme/chat-2", cached=0.25999999999999995)] outcome = sync.compute_sync(registry, catalog, _doc({"x": "2026-01-01"})) assert "cache_read_input_token_cost" not in outcome.cost_map["together_ai/acme/chat-1"] + assert "supports_prompt_caching" not in outcome.cost_map["together_ai/acme/chat-1"] assert outcome.cost_map["together_ai/acme/chat-2"]["cache_read_input_token_cost"] == 2.6e-07 assert outcome.cost_map["together_ai/acme/chat-2"]["supports_prompt_caching"] is True