This commit is contained in:
yucheng-berri 2026-09-12 13:15:39 +08:00 committed by GitHub
commit 3d135a8fe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -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()))

View file

@ -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"]) == (