Support both kimi (thinking) and nemotron (enable_thinking) in chat_template_kwargs

This commit is contained in:
Alishahryar1
2026-03-26 12:34:12 -07:00
parent f9e7f65f4c
commit 2fad4dd4c9
3 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -63,7 +63,9 @@ def build_request_body(request_data: Any, nim: NimSettings) -> dict:
if request_extra:
extra_body.update(request_extra)
extra_body.setdefault("chat_template_kwargs", {"enable_thinking": True})
extra_body.setdefault(
"chat_template_kwargs", {"thinking": True, "enable_thinking": True}
)
_set_extra(extra_body, "reasoning_budget", max_tokens)
req_top_k = getattr(request_data, "top_k", None)
+1
View File
@@ -100,6 +100,7 @@ async def test_build_request_body(nim_provider):
assert "extra_body" in body
ctk = body["extra_body"]["chat_template_kwargs"]
assert ctk["thinking"] is True
assert ctk["enable_thinking"] is True
assert body["extra_body"]["reasoning_budget"] == body["max_tokens"]
+4 -1
View File
@@ -101,7 +101,10 @@ class TestBuildRequestBody:
nim = NimSettings()
body = build_request_body(req, nim)
extra = body["extra_body"]
assert extra["chat_template_kwargs"] == {"enable_thinking": True}
assert extra["chat_template_kwargs"] == {
"thinking": True,
"enable_thinking": True,
}
assert extra["reasoning_budget"] == body["max_tokens"]
def test_no_reasoning_params_in_extra_body(self):