From 585899f1cc7def04792f6291916f706bf81db74f Mon Sep 17 00:00:00 2001 From: Yucheng He Date: Sat, 5 Sep 2026 14:21:45 -0700 Subject: [PATCH] feat: default capabilities for new chat catalog entries --- scripts/sync_together_ai_models.py | 11 +++++++++++ tests/test_litellm/test_sync_together_ai_models.py | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/scripts/sync_together_ai_models.py b/scripts/sync_together_ai_models.py index 12b128890f1..e77cb475cd5 100644 --- a/scripts/sync_together_ai_models.py +++ b/scripts/sync_together_ai_models.py @@ -85,6 +85,16 @@ _TOOLS: Final = MappingProxyType( } ) +_CHAT_DEFAULTS: Final = MappingProxyType( + { + "max_output_tokens": 120000, + "supports_function_calling": True, + "supports_parallel_function_calling": True, + "supports_reasoning": True, + "supports_tool_choice": True, + } +) + CAPABILITY_RULES: Final = ( _rule( "MiniMaxAI/MiniMax-M3", @@ -308,6 +318,7 @@ def _new_entry(model: CatalogModel, mode: str) -> RegistryEntry: "litellm_provider": PROVIDER, "mode": mode, "source": SOURCE_URL, + **(_CHAT_DEFAULTS if model.type == "chat" else {}), **(dict(rule.fields) if rule else {}), } return dict(sorted(merged.items())) diff --git a/tests/test_litellm/test_sync_together_ai_models.py b/tests/test_litellm/test_sync_together_ai_models.py index b8a85bcfbdc..f8ee2471da4 100644 --- a/tests/test_litellm/test_sync_together_ai_models.py +++ b/tests/test_litellm/test_sync_together_ai_models.py @@ -105,6 +105,7 @@ def test_added_chat_model_matches_reviewed_registry_shape() -> None: "input_cost_per_token": 3e-06, "litellm_provider": "together_ai", "max_input_tokens": 1048576, + "max_output_tokens": 120000, "max_tokens": 1048576, "mode": "chat", "output_cost_per_token": 1.5e-05, @@ -119,6 +120,12 @@ def test_added_chat_model_matches_reviewed_registry_shape() -> None: } +def test_unreviewed_chat_model_gets_catalog_defaults() -> None: + outcome = sync.compute_sync({}, [_chat_model("acme/unreviewed")], _doc({"x": "2026-01-01"})) + entry = outcome.cost_map["together_ai/acme/unreviewed"] + assert {key: entry[key] for key in sync._CHAT_DEFAULTS} == dict(sync._CHAT_DEFAULTS) + + def test_added_embedding_model_has_no_output_token_cap() -> None: outcome = sync.compute_sync({}, RECORDED_CATALOG, RECORDED_DOC) assert outcome.cost_map["together_ai/intfloat/multilingual-e5-large-instruct"] == { @@ -144,7 +151,7 @@ def test_output_ceiling_comes_from_the_rule_never_from_context_length() -> None: glm = next(model for model in RECORDED_CATALOG if model.id == "zai-org/GLM-5.2") fresh = sync.compute_sync({}, [_chat_model("acme/unreviewed", ctx=1048576), glm], _doc({"x": "2026-01-01"})) unreviewed = fresh.cost_map["together_ai/acme/unreviewed"] - assert "max_output_tokens" not in unreviewed + assert unreviewed["max_output_tokens"] == 120000 assert (unreviewed["max_input_tokens"], unreviewed["max_tokens"]) == (1048576, 1048576) reviewed = fresh.cost_map["together_ai/zai-org/GLM-5.2"] assert (reviewed["max_input_tokens"], reviewed["max_output_tokens"], reviewed["max_tokens"]) == (