{"backend": "tokenizers", "bos_token": "<|begin_of_text|>", "clean_up_tokenization_spaces": true, "eos_token": "<|end_of_text|>", "is_local": true, "local_files_only": false, "model_input_names": ["input_ids", "attention_mask"], "model_max_length": 262144, "pad_token": "<|end_of_text|>", "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 = \"/think\" -%}\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 if tool is string else tool | tojson }}{{ \"\n\" }}\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 if tool is string else tool | tojson }}{{ \"\n\" }}\n{% endfor %}\n\n{% endif %}\n{% endif %}\n<|eot_id|>\n{%- endif -%}\n{%- macro text(content) -%}\n {%- if content is string -%}\n {{- content -}}\n {%- elif content is mapping -%}\n {{- content.get('text', '') -}}\n {%- elif content is iterable -%}\n {%- for chunk in content if chunk.get('type') == 'text' -%}\n {{- chunk.text -}}\n {%- endfor -%}\n {%- endif -%}\n{%- endmacro -%}\n\n{%- set tool_names = namespace(by_id={}) -%}\n{%- macro tool_calls(calls) -%}\n {%- for call in calls -%}\n {%- set function = call.function -%}\n {%- if call.get('id') -%}\n {%- set tool_names.by_id = dict(tool_names.by_id, **{call.id: function.name}) -%}\n {%- endif -%}\n {{- '\n{\"name\": ' -}}\n {{- function.name | tojson -}}\n {{- ', \"arguments\": ' -}}\n {{- function.arguments if function.arguments is string else function.arguments | tojson -}}\n {{- '}\n' -}}\n {%- endfor -%}\n{%- endmacro -%}\n\n{%- for message in messages -%}\n {%- set content = message.get('content') -%}\n {%- set text_content = content is string\n or (content is mapping and content.get('text') is string)\n or (content is sequence and content is not string and content is not mapping\n and content | selectattr('type', 'equalto', 'text') | list | length == content | length) -%}\n {{- '<|start_header_id|>' ~ message.role ~ '<|end_header_id|>\n' -}}\n {%- if message.role == 'assistant' -%}\n {% generation %}\n {%- if message.get('reasoning_content') -%}\n {{- '<|start_think|>' ~ message.reasoning_content ~ '<|end_think|>' -}}\n {%- endif -%}\n {{- text(content) | trim -}}\n {{- tool_calls(message.get('tool_calls') or []) -}}\n {{- '<|eot_id|>' -}}\n {% endgeneration %}\n {%- elif message.role == 'tool' -%}\n {{- '' -}}\n {{- text(content) if text_content else content | tojson if content is not none else '' -}}\n {{- '<|eot_id|>\n' -}}\n {%- elif message.role == 'ipython' -%}\n {{- {\"output\": text(content) if text_content else content} | tojson -}}\n {{- '<|eot_id|>\n' -}}\n {%- else -%}\n {{- (text(content) | trim) ~ '<|eot_id|>\n' -}}\n {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{- '<|start_header_id|>assistant<|end_header_id|>\n' -}}\n{%- endif -%}"}