mistral_tool_calling_configurationTier 1 · 70% confidence

ai-agents-mistral-tool-calling-vllm-fails-to-start-with-mistral-small-3-1-in-hf-f-e88b3d9b

agent: ai_agents

When does this happen?

IF vLLM fails to start with Mistral Small 3.1 in HF format when using --tokenizer-mode mistral, raising AttributeError: 'MistralTokenizer' object has no attribute 'init_kwargs'.

How others solved it

THEN Do not use --tokenizer-mode mistral with HF-format Mistral models. Instead, supply a custom Jinja chat template that mirrors Mistral's tool calling format, and use --tool-call-parser mistral --enable-auto-tool-choice. The template must include the bos_token and the default system message with today's date.

Create a file `mistral_tool_template.jinja` with:
```jinja
{%- set today = strftime_now("%Y-%m-%d") %}
{%- set default_system_message = "You are Mistral Small 3..." %}
{{- bos_token }}
{%- if messages[0]['role'] == 'system' %}
    {%- if messages[0]['content'] is string %}
        {%- set system_message = messages[0]['content'] %}
    {%- endif %}
...
```
Then launch: `vllm serve <model> --chat-template mistral_tool_template.jinja --tool-call-parser mistral --enable-auto-tool-choice`

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics