{"backend": "tokenizers", "bos_token": "<|begin_of_text|>", "clean_up_tokenization_spaces": true, "eos_token": "<|end_of_text|>", "is_local": false, "local_files_only": false, "model_input_names": ["input_ids", "attention_mask"], "model_max_length": 131072, "tokenizer_class": "PreTrainedTokenizerFast", "chat_template": "{{ bos_token }}\n{%- if enable_thinking is defined -%}\n {%- if enable_thinking is sameas true -%}\n {%- set _reasoning_mode = \"/think\" -%}\n {%- elif enable_thinking is sameas false -%}\n {%- set _reasoning_mode = \"/nothink\" -%}\n {%- else -%}\n {%- set _reasoning_mode = enable_thinking -%}\n {%- endif -%}\n{%- else -%}\n {%- set _reasoning_mode = none -%}\n{%- endif -%}\n{%- set _custom_instructions = custom_instructions | default(None, true) -%}\n{%- set _xml_tools_list = xml_tools | default([], true) -%}\n{%- if tools is defined and tools -%}\n {%- set _xml_tools_list = tools -%}\n{%- endif -%}\n{%- set _python_tools = python_tools | default([], true) -%}\n{%- set _has_aux_header = (_reasoning_mode is not none) or _custom_instructions or (_xml_tools_list) or (_python_tools) -%}\n{%- if _has_aux_header -%}\n<|start_header_id|>system<|end_header_id|>\n{%- if _reasoning_mode is not none -%}\nReasoning: {{ _reasoning_mode }}\n{%- endif %}\n{%- if _custom_instructions %}\n{{ _custom_instructions | trim }}\n{%- endif %}\n{% if _xml_tools_list or _python_tools %}\n{{ \"\n### Tools\n\" }}\nYou may call one or more functions to assist with the user query.\n{% if _xml_tools_list %}\nYou are provided with function signatures within tags:\n\n\n{% for tool in _xml_tools_list %}\n{{ tool | string }}{% if not loop.last %}\n{% endif %}\n{% endfor %}\n\n\nFor each function call, pass a json object with function name and arguments within tags:\n\n{\"name\": , \"arguments\": }\n\n\n{% endif %}\n{% if _python_tools %}\nWhen you send a message containing Python code between <|python_tag|> and <|eom_id|> tags, it will be executed in a stateful Jupyter notebook environment, and you will then be given the output.\n\nYou can use the following tools in your python code like regular functions:\n\n{% for tool in _python_tools %}\n{{ tool | string }}{% if not loop.last %}\n{% endif %}\n{% endfor %}\n\n{% endif %}\n{% endif %}\n<|eot_id|>\n{%- endif -%}\n{%- for message in messages -%}\n {%- set has_tool_calls = message.get('tool_calls') is not none and message.get('tool_calls') -%}\n {%- if not (message.get('role') in ['tool', 'ipython'] or has_tool_calls) -%}\n {%- if message.get('role') == 'assistant' -%}\n<|start_header_id|>assistant<|end_header_id|>\n{% set content = message.get('content') %}\n{% if content is string %}\n{% generation %}{{- content | trim }}<|eot_id|>{% endgeneration %}\n{% elif content is mapping %}\n{% generation %}{{- content.get('text', '') | trim }}<|eot_id|>{% endgeneration %}\n{% elif content is iterable %}\n{% generation %}\n{%- for chunk in content -%}\n {%- if chunk.get('type') == 'text' -%}\n {{ chunk.get('text', '') | trim }}\n {%- endif -%}\n{%- endfor -%}\n<|eot_id|>\n{% endgeneration %}\n{% else %}\n{% generation %}{% endgeneration %}<|eot_id|>\n{% endif %}\n {%- else -%}\n<|start_header_id|>{{ message['role'] }}<|end_header_id|>\n{% set content = message.get('content') %}\n{% if content is string %}\n{{ content | trim }}<|eot_id|>\n{% elif content is mapping %}\n{{ content.get('text', '') | trim }}<|eot_id|>\n{% elif content is iterable %}\n{%- for chunk in content -%}\n {%- if chunk.get('type') == 'text' -%}\n {{ chunk.get('text', '') | trim }}\n {%- endif -%}\n{%- endfor -%}<|eot_id|>\n{% else %}\n<|eot_id|>\n{% endif %}\n {%- endif -%}\n\n {%- elif message.get('role') == 'tool' -%}\n {%- set _tool_name = message.get('name') -%}\n {%- set _tool_id = message.get('tool_call_id') -%}\n {%- set _attr_name = ' name=\"' ~ _tool_name ~ '\"' if _tool_name else '' -%}\n {%- set _attr_id = ' id=\"' ~ _tool_id ~ '\"' if _tool_id else '' -%}\n<|start_header_id|>tool<|end_header_id|>\n\n{%- set tool_content = message.get('content') -%}\n{%- if tool_content is mapping or (tool_content is iterable and tool_content is not string) -%}\n{{- tool_content | tojson }}\n{%- else -%}\n{{- tool_content if tool_content is not none else '' }}\n{%- endif -%}\n<|eot_id|>\n{{- \"\n\" -}}\n {%- elif message.get('role') == 'ipython' -%}\n<|start_header_id|>ipython<|end_header_id|>\n{% set ipy_content = message.get('content') %}\n{% if ipy_content is string %}\n{{- { \"output\": ipy_content } | tojson -}}\n{% elif ipy_content is iterable %}\n{%- for chunk in ipy_content -%}\n {%- if chunk.get('type') == 'text' -%}\n {{- { \"output\": chunk.get('text', '') } | tojson -}}\n {%- endif -%}\n{%- endfor -%}\n{% else %}\n{{- { \"output\": ipy_content } | tojson -}}\n{% endif %}\n<|eot_id|>\n{% elif has_tool_calls -%}\n {%- if message.tool_calls|length != 1 -%}\n {{- raise_exception(\"This template expects exactly one tool call per assistant turn.\") -}}\n {%- endif -%}\n {%- set tool_call = message.tool_calls[0].function -%}\n<|start_header_id|>assistant<|end_header_id|>\n{% generation %}\n{{- '{\"name\": \"' + tool_call.name + '\", \"arguments\": ' -}}\n{{- tool_call.arguments | tojson -}}\n{{- \"}\" -}}<|eot_id|>\n{% endgeneration %}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n<|start_header_id|>assistant<|end_header_id|>\n{% endif -%}"}