@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 25708d317a
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 23:45 UTC

[Bugfix] Mistral crashes on tool with no description (#21167)

Signed-off-by: HugoMichard <hugo@harfanglab.fr>

Michard Hugo committed Jul 28, 2025 at 17:03 UTC 25708d317aff64acb71904c855d3c617f2a0d438
1 file changed +4 -1
vllm/transformers_utils/tokenizers/mistral.py
+4 -1
@@ -183,7 +183,8 @@ def make_mistral_chat_completion_request(
183 message["content"] = content
184
185 # The Mistral client, in comparison to the OpenAI client, requires the
186 - # "parameters" dict to be present, even if it's empty.
186 + # "parameters" dict and the "description" string to be present
187 + # even if they are empty.
188 if tools:
189 for function in [
190 tool["function"] for tool in tools
@@ -191,6 +192,8 @@ def make_mistral_chat_completion_request(
192 ]:
193 if function.get("parameters") is None:
194 function["parameters"] = {}
195 + if function.get("description") is None:
196 + function["description"] = ""
197
198 from mistral_common.protocol.instruct.request import ChatCompletionRequest
199 return ChatCompletionRequest(messages=messages,