{ "add_prefix_space": false, "added_tokens_decoder": { "248044": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248045": { "content": "<|im_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248046": { "content": "<|im_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248047": { "content": "<|object_ref_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248048": { "content": "<|object_ref_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248049": { "content": "<|box_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248050": { "content": "<|box_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248051": { "content": "<|quad_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248052": { "content": "<|quad_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248053": { "content": "<|vision_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248054": { "content": "<|vision_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248055": { "content": "<|vision_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248056": { "content": "<|image_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248057": { "content": "<|video_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248058": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248059": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248060": { "content": "<|fim_prefix|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248061": { "content": "<|fim_middle|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248062": { "content": "<|fim_suffix|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248063": { "content": "<|fim_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248064": { "content": "<|repo_name|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248065": { "content": "<|file_sep|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248066": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248067": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248068": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248069": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": false }, "248070": { "content": "<|audio_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248071": { "content": "<|audio_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248072": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248073": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248074": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248075": { "content": "", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "248076": { "content": "<|audio_pad|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ "<|im_start|>", "<|im_end|>", "<|object_ref_start|>", "<|object_ref_end|>", "<|box_start|>", "<|box_end|>", "<|quad_start|>", "<|quad_end|>", "<|vision_start|>", "<|vision_end|>", "<|vision_pad|>", "<|image_pad|>", "<|video_pad|>" ], "bos_token": null, "chat_template": "{%- set template_version = \"qwen3.6-froggeric-v21.3\" %}\n{%- set _tool_format = tool_call_format if tool_call_format is defined else 'xml' %}\n{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- set add_vision_id = add_vision_id if add_vision_id is defined else false %}\n{%- set enable_thinking = enable_thinking if enable_thinking is defined else true %}\n{%- set auto_disable_thinking_with_tools = auto_disable_thinking_with_tools if auto_disable_thinking_with_tools is defined else false %}\n{%- set _preserve_thinking = preserve_thinking if preserve_thinking is defined else true %}\n{%- set max_tool_arg_chars = max_tool_arg_chars if max_tool_arg_chars is defined else 0 %}\n{%- set max_tool_response_chars = max_tool_response_chars if max_tool_response_chars is defined else 0 %}\n{%- set _has_tools = (tools is defined and tools and tools is iterable and tools is not mapping) %}\n{%- set ns_state = namespace(thinking=enable_thinking) %}\n{%- if auto_disable_thinking_with_tools and _has_tools %}\n {%- set ns_state.thinking = false %}\n{%- endif %}\n{%- macro render_content(content, do_vision_count, is_system_content=false) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is iterable and content is not mapping %}\n {%- for item in content %}\n {%- if item is mapping %}\n {%- if item.type == 'image' or 'image' in item or 'image_url' in item %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain images.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Picture ' ~ image_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' }}\n {%- elif item.type == 'video' or 'video' in item %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain videos.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Video ' ~ video_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' }}\n {%- elif 'text' in item %}\n {{- item.text }}\n {%- else %}\n {{- raise_exception('Unexpected item type in content.') }}\n {%- endif %}\n {%- else %}\n {{- item | string }}\n {%- endif %}\n {%- endfor %}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- else %}\n {{- raise_exception('Unexpected content type.') }}\n {%- endif %}\n{%- endmacro %}\n{%- if not messages %}\n {{- raise_exception('No messages provided.') }}\n{%- endif %}\n{%- set _first_role = messages[0].role %}\n{%- if _first_role == 'system' or _first_role == 'developer' %}\n {%- set _sys_msg = messages[0] %}\n {%- set _msgs = messages[1:] %}\n{%- else %}\n {%- set _sys_msg = none %}\n {%- set _msgs = messages %}\n{%- endif %}\n{%- set _sc = '' %}\n{%- if _sys_msg is not none %}\n {%- set _sc = render_content(_sys_msg.content, false, true) | trim %}\n {%- if '<|think_off|>' in _sc %}\n {%- set ns_state.thinking = false %}\n {%- set _sc = _sc.split('<|think_off|>') | join('') | trim %}\n {%- elif '<|think_on|>' in _sc %}\n {%- set ns_state.thinking = true %}\n {%- set _sc = _sc.split('<|think_on|>') | join('') | trim %}\n {%- endif %}\n{%- endif %}\n{%- if _has_tools %}\n {{- '<|im_start|>system\\n' }}\n {{- '# Tools\\n\\nYou have access to the following functions:\\n\\n' }}\n {%- for tool in tools %}\n {{- '\\n' }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- '\\n' }}\n {%- set tool_instructions %}\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n{%- if _tool_format == 'json' %}\n\nBrief explanation of tool call\n\n\n{\"name\": \"example_function_name\", \"arguments\": {\"example_parameter_1\": \"value_1\", \"example_parameter_2\": \"This is the value for the second parameter\"}}\n\n{%- else %}\n\nBrief explanation of tool call\n\n\n\n\nvalue_1\n\n\nThis is the value for the second parameter\nthat can span\nmultiple lines\n\n\n\n{%- endif %}\n\n\nReminder:\n- You can use the block to plan your next tool call OR to synthesize data and formulate your final response to the user.\n- ALL explanation and reasoning MUST be placed strictly inside the block.\n{%- if _tool_format == 'json' %}\n- Function calls MUST follow the specified format: a single JSON object with \"name\" and \"arguments\" keys inside XML tags.\n{%- else %}\n- Function calls MUST follow the specified format: an inner block must be nested within XML tags.\n{%- endif %}\n- If you choose to call a tool, you MUST output the block IMMEDIATELY after thinking, with NO conversational text before it.\n{%- if _tool_format == 'json' %}\n- The tag MUST be at the very beginning of a new line, with NO spaces or indentation before it.\n{%- else %}\n- The and tags MUST be at the very beginning of a new line, with NO spaces or indentation before them.\n{%- endif %}\n- To call multiple functions, output a separate, completely closed block for EACH function. Do NOT nest blocks.\n- If you have all necessary data, provide your final answer directly to the user without any tool call.\n\n {%- endset %}\n {{- '\\n\\n' ~ tool_instructions | trim }}\n {%- if _sc %}\n {{- '\\n\\n' + _sc }}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if _sc %}\n {{- '<|im_start|>system\\n' + _sc + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set _last_idx = _msgs | length - 1 %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=_last_idx) %}\n{%- for message in _msgs[::-1] %}\n {%- set index = (_msgs | length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == 'user' %}\n {%- set _rc = render_content(message.content, false) | trim %}\n {%- if not (_rc.startswith('') and _rc.endswith('')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if ns.multi_step_tool %}\n {%- if _last_idx > 50 %}\n {%- set ns.last_query_index = _last_idx %}\n {%- else %}\n {%- set ns.last_query_index = 0 %}\n {%- endif %}\n{%- endif %}\n{%- set ns2 = namespace(prev_role='', consecutive_failures=0) %}\n{%- for message in _msgs %}\n {%- set is_system = (message.role == \"system\" or message.role == \"developer\") %}\n {%- set content = render_content(message.content, true, is_system) | trim %}\n {%- if is_system or message.role == 'user' %}\n {%- if '<|think_off|>' in content %}\n {%- set ns_state.thinking = false %}\n {%- set content = content.split('<|think_off|>') | join('') | trim %}\n {%- elif '<|think_on|>' in content %}\n {%- set ns_state.thinking = true %}\n {%- set content = content.split('<|think_on|>') | join('') | trim %}\n {%- endif %}\n {%- endif %}\n {%- if is_system %}\n {{- '<|im_start|>system\\n' + content + '<|im_end|>\\n' }}\n {%- elif message.role == 'user' %}\n {%- set ns2.consecutive_failures = 0 %}\n {{- '<|im_start|>user\\n' + content + '<|im_end|>\\n' }}\n {%- elif message.role == 'assistant' %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is defined and message.reasoning_content is not none %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- set reasoning_content = message.reasoning_content | string %}\n {%- endif %}\n {%- elif message.thinking is defined and message.thinking is not none %}\n {%- if message.thinking is string %}\n {%- set reasoning_content = message.thinking %}\n {%- else %}\n {%- set reasoning_content = message.thinking | string %}\n {%- endif %}\n {%- else %}\n {%- set _think_end = '' %}\n {%- if content.startswith('') %}\n {%- set _think_end = '' %}\n {%- elif content.startswith('') %}\n {%- set _think_end = '' %}\n {%- elif '\\n' in content %}\n {%- set _think_end = '\\n' %}\n {%- elif '\\n' in content %}\n {%- set _think_end = '\\n' %}\n {%- elif '\\n' in content %}\n {%- set _think_end = '\\n' %}\n {%- elif '\\n' in content %}\n {%- set _think_end = '\\n' %}\n {%- endif %}\n {%- if _think_end %}\n {%- if 'thinking' in _think_end %}\n {%- set _think_start = '' %}\n {%- else %}\n {%- set _think_start = '' %}\n {%- endif %}\n {%- set reasoning_content = content.split(_think_end)[0].rstrip('\\n') %}\n {%- if _think_start in reasoning_content %}\n {%- set reasoning_content = reasoning_content.split(_think_start)[-1].lstrip('\\n') %}\n {%- endif %}\n {%- set content = content.split(_think_end)[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- set reasoning_content = reasoning_content | trim %}\n {%- if (_preserve_thinking or loop.index0 > ns.last_query_index) and reasoning_content %}\n {{- '<|im_start|>assistant\\n\\n' + reasoning_content + '\\n\\n\\n' + content }}\n {%- else %}\n {{- '<|im_start|>assistant\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls is defined and message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined and tool_call.function is not none %}\n {%- set tc = tool_call.function %}\n {%- else %}\n {%- set tc = tool_call %}\n {%- endif %}\n {%- if _tool_format == 'json' %}\n {%- if not loop.first or content | trim %}\n {{- '\\n\\n' }}\n {%- endif %}\n {%- set _args = '{}' %}\n {%- if tc.arguments is defined and tc.arguments is not none %}\n {%- if tc.arguments is mapping %}\n {%- set _args = tc.arguments | tojson %}\n {%- elif tc.arguments is string and tc.arguments %}\n {%- set _args = tc.arguments %}\n {%- endif %}\n {%- endif %}\n {{- '\\n{\"name\": ' }}{{- tc.name | tojson }}{{- ', \"arguments\": ' }}{{- _args }}{{- '}\\n' }}\n {%- else %}\n {%- if loop.first %}\n {%- if content | trim %}\n {{- '\\n\\n\\n\\n' }}\n {%- else %}\n {{- '\\n\\n' }}\n {%- endif %}\n {%- else %}\n {{- '\\n\\n\\n\\n' }}\n {%- endif %}\n {%- if tc.arguments is defined and tc.arguments is not none %}\n {%- if tc.arguments is mapping %}\n {%- for args_name, args_value in tc.arguments.items() %}\n {{- '\\n' }}\n {%- if args_value is mapping or (args_value is sequence and args_value is not string) %}\n {%- set _av = args_value | tojson %}\n {%- else %}\n {%- set _av = args_value | string %}\n {%- endif %}\n {%- if max_tool_arg_chars > 0 and _av | length > max_tool_arg_chars %}\n {{- _av[:max_tool_arg_chars] + '\\n[TRUNCATED — original length ' ~ (_av | length | string) ~ ' chars]' }}\n {%- else %}\n {{- _av }}\n {%- endif %}\n {{- '\\n\\n' }}\n {%- endfor %}\n {%- elif tc.arguments is string and tc.arguments %}\n {{- tc.arguments }}\n {%- endif %}\n {%- endif %}\n {{- '\\n' }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == 'tool' %}\n {%- set _content_lower = content | lower %}\n {%- set _content_head = _content_lower[:80] %}\n {%- if content | length < 500 and '$ ' not in content and 'took ' not in _content_lower and ('\"error\":' in _content_head or 'error:' in _content_head or 'err!' in _content_head or 'fatal:' in _content_head or 'exception:' in _content_head or 'traceback' in _content_head or 'command not found' in _content_head or 'invalid syntax' in _content_head or 'failed to' in _content_head) %}\n {%- set ns2.consecutive_failures = ns2.consecutive_failures + 1 %}\n {%- else %}\n {%- set ns2.consecutive_failures = 0 %}\n {%- endif %}\n {%- if ns2.prev_role != 'tool' %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {%- if max_tool_response_chars > 0 and content | length > max_tool_response_chars %}\n {%- set content = content[:max_tool_response_chars] + '\\n[TRUNCATED — original length ' ~ (content | length | string) ~ ' chars]' %}\n {%- endif %}\n {{- '\\n\\n' + content }}\n {%- if ns2.consecutive_failures >= 2 %}\n {{- '\\n\\n⚠️ SYSTEM WARNING: ' ~ ns2.consecutive_failures ~ ' consecutive tool errors detected. Your previous approach is incorrect. You MUST use a fundamentally different approach or corrected arguments.' }}\n {%- elif ns2.consecutive_failures == 1 %}\n {{- '\\n\\n⚠️ SYSTEM WARNING: The previous tool call returned an error. Diagnose the failure and retry with completely corrected arguments.' }}\n {%- endif %}\n {{- '\\n' }}\n {%- if loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- else %}\n {%- set _next_role = _msgs[loop.index0 + 1].role %}\n {%- if _next_role != 'tool' %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>user\\n[' + message.role + ']: ' + content + '<|im_end|>\\n' }}\n {%- endif %}\n {%- set ns2.prev_role = message.role %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if not ns_state.thinking %}\n {{- '\\n\\n\\n\\n' }}\n {%- elif ns2.consecutive_failures >= 2 %}\n {{- '\\n\\n\\n\\n' }}\n {%- else %}\n {{- '\\n' }}\n {%- endif %}\n{%- endif %}", "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "errors": "replace", "model_max_length": 262144, "pad_token": "<|endoftext|>", "split_special_tokens": false, "tokenizer_class": "Qwen2Tokenizer", "unk_token": null, "add_bos_token": false, "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+", "extra_special_tokens": { "audio_bos_token": "<|audio_start|>", "audio_eos_token": "<|audio_end|>", "audio_token": "<|audio_pad|>", "image_token": "<|image_pad|>", "video_token": "<|video_pad|>", "vision_bos_token": "<|vision_start|>", "vision_eos_token": "<|vision_end|>" } }