Skip to content

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]

fix(scripts): drop supports_prompt_caching when cached pricing leaves the together_ai catalog

mateo-berri6373ea090ef9
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