Fix strict level setting for Kimi K2 tool calls when not explicitly set (#13077)

Signed-off-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
This commit is contained in:
Xinyuan Tong
2025-11-12 00:01:42 -08:00
committed by GitHub
parent f825137f8a
commit 4983b7e7aa

View File

@@ -1728,7 +1728,10 @@ class ServerArgs:
"1" if self.enable_deterministic_inference else "0"
)
# Set the highest strict level for Kimi K2 tool calls
if self.tool_call_parser == "kimi_k2":
if (
self.tool_call_parser == "kimi_k2"
and not envs.SGLANG_TOOL_STRICT_LEVEL.is_set()
):
envs.SGLANG_TOOL_STRICT_LEVEL.set(ToolStrictLevel.PARAMETER)
def _handle_cache_compatibility(self):