mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
fix(scripts): drop supports_prompt_caching when cached pricing leaves the together_ai catalog
This commit is contained in:
parent
90bc8acd86
commit
6373ea090e
2 changed files with 2 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue