{#- Phi-4-mini chat template — OLLAMA-MATCHING variant. Why this exists: the official HF tokenizer template emits <|end|> after the SYSTEM turn; Ollama's phi4 template does NOT (its system-block <|end|> is only in the tools branch). That single boundary token regressed brokkr's R15 P02 admission eval on vLLM vs the Ollama-measured canonical (type macro-F1 -33pp) while valid_format held at 1.0. Operator chose (2026-06-04) to make vLLM match Ollama's leaner scaffold globally so baseline == production. Renders (system + user, add_generation_prompt): <|system|>{sys}<|user|>{usr}<|end|><|assistant|> i.e. NO <|end|> after the system turn (the only delta from official). -#} {%- for message in messages -%} {%- if message['role'] == 'system' -%} {{- '<|system|>' + message['content'] -}} {%- else -%} {{- '<|' + message['role'] + '|>' + message['content'] + '<|end|>' -}} {%- endif -%} {%- endfor -%} {%- if add_generation_prompt -%} {{- '<|assistant|>' -}} {%- endif -%}