Does SmolVLM2-2.2B-Instruct Support Function Calling?

#26
by dgallitelli - opened

Hello! I am exploring the use of HuggingFaceTB/SmolVLM2-2.2B-Instruct for advanced LLM applications on Amazon SageMaker, specifically with both the DJL LMI container (using vLLM as backend) and the TGI container image. My goal is to leverage structured function calling capabilities—similar to those supported by other models like SmolLM2-1.7B-Instruct. However, I have not found explicit documentation or examples confirming that SmolVLM2-2.2B-Instruct has been fine-tuned or supports function calling out of the box. Could the maintainers or the community clarify if this model supports function calling, and if so, provide guidance on prompt formatting and integration with these SageMaker deployment options? Any tips or sample code for enabling structured tool use would be greatly appreciated!

I checked the current chat_template.json and the model card on this repo.

No, SmolVLM2-2.2B-Instruct does not officially support function calling. The chat template only formats roles plus text/image parts. If you pass tools= to apply_chat_template, or include an assistant message with tool_calls, those fields are ignored and never show up in the prompt. The README also has no tool-calling section or example.

That is different from SmolLM2-1.7B-Instruct, which is documented for function calling. Even there, tools are not a native tools= template feature — you put a <tools> block in the system prompt and parse <tool_call>...</tool_call> from the completion, as in the SmolLM2 card.

For SageMaker with vLLM or TGI, I would not expect a native tool_calls array from this checkpoint. If you need structured tool use, SmolLM2-1.7B-Instruct (text-only) is the one in this family that is actually set up for it. You could try the same system-prompt recipe here, but it is undocumented and this VLM was not advertised as being trained for that format.

Sign up or log in to comment