Chat Template Check

Some libraries recognise a model's chat template by exact string equality against a stored copy. A re-upload that adds or drops the single trailing newline renders identically — Jinja drops one trailing newline when rendering — but fails the exact match and is rejected as unrecognised.

chat_template_check.py (in this Space's files) compares a candidate template — a local file or a Hub repo id — against a reference file, or against every stored template in a directory, and names the exact shape of any difference:

python3 chat_template_check.py <repo-id-or-file> <reference.jinja> --render-check
python3 chat_template_check.py <repo-id-or-file> --stored-dir <dir-of-stored-templates>

Measured verdicts (2026-11-20)

RepoStored copyVerdict
RedHatAI/gemma-4-26B-A4B-it-FP8-dynamicgemma4_v10.jinja (18,683 B)NEWLINE-ONLY — candidate drops the trailing newline (18,682 B)
vidore/colqwen2.5-v0.2qwen2_5_vl.jinja (1,017 B)NEWLINE-ONLY — candidate adds a trailing newline (1,018 B)
cbert33/Qwen3.8-27B-TURBO-Fable-Cold-Fusion-735-882-Heretic-Uncensored-FP8-KV-Calibratedqwen3_8.jinja (8,952 B)NEWLINE-ONLY — candidate adds a trailing newline (8,953 B)

In all three cases the byte difference count beyond the newline is zero. If the checker reads NEWLINE-ONLY against a library's stored copy, exact-match recognition will reject the template even though it renders the same.