ai newsMi., 25. Nov.
EilmeldungYale’s Sonnenfeld: Nvidia is a ‘detriment’ to U.S. industrial might — not a champion

Veraltete Modell-Dateien auf Hugging Face: Downloads können Apps zum Absturz bringen

Eine Prüfung von 1.788 Kopien sechs beliebter Modelle auf Hugging Face zeigt: Viele enthalten ein veraltetes Chat-Layout, das manche Anwendungen crashen oder Tools der KI verbergen kann. Nutzer sollten ihre Dateien überprüfen.

dev.toDienstag 03:14 · 24.11.DE14 Min. Lesezeit
Bild: dev.to

Veröffentlicht am 24. Nov. • Bearbeitet am 24. Nov. • Originalerweise veröffentlicht auf Medium

Ich habe 1.788 Kopien von sechs populären Modellen auf Hugging Face überprüft. Viele tragen ein altes Chat-Layout, das manche Apps zum Absturz bringen oder die Tools der KI verbergen kann. So können Sie Ihre Kopie prüfen.

Ein Hinweis zur Entstehung: KI-Tools haben mir bei der Durchführung dieser Tests und beim Entwurf dieses Artikels geholfen. Die Ideen sind meine eigenen.

Wenn Sie KI-Modelle auf Ihrem eigenen Computer betreiben, haben Sie wahrscheinlich eines von Hugging Face heruntergeladen. Suchen Sie nach einem populären Modell wie Qwen3-8B, und Sie finden Hunderte Kopien, die von verschiedenen Personen hochgeladen wurden. Gleicher Name, gleiche Größe. Es liegt nahe anzunehmen, dass es sich um dasselbe handelt.

Tun sie aber nicht. Jeder Download ist eine einzelne Datei, die zwei Dinge enthält: das Modell selbst und ein kleines Stück Code, das festlegt, wie Ihr Gespräch für das Modell aufbereitet wird.

Stellen Sie sich ein Restaurant vor. Das Modell ist der Koch. Ihre App (Ollama, LM Studio oder Ihr eigener Code) ist der Kellner. Der Kellner schreibt jede Bestellung auf einen Zettel, und der Koch kann Zettel nur in einem ganz bestimmten Layout lesen. Dieses Zettel-Layout ist im Modell bereits mitgeliefert. Ingenieure nennen es die Chat-Vorlage.

Modellhersteller verbessern das Zettel-Layout manchmal nach der Veröffentlichung, zum Beispiel indem sie ein Feld für Sonderwünsche hinzufügen. Kopien, die vor der Änderung hochgeladen wurden, behalten das alte Layout für immer.

So sieht das in der Praxis aus. Fragen Sie Mistral 7B nach dem Wetter in Adelaide und geben Sie ihm ein Wetter-Tool. Mit dem aktuellen Layout liest das Modell Folgendes (vereinfacht):

[AVAILABLE_TOOLS] get_weather(city) [/AVAILABLE_TOOLS] [INST] What is the weather in Adelaide right now? [/INST] Vollbildmodus aufrufen Vollbildmodus beenden Mit dem alten Layout, das in den am häufigsten heruntergeladenen Kopien enthalten ist, liest es dies:

[INST] What is the weather in Adelaide right now? [/INST] Vollbildmodus aufrufen Vollbildmodus beenden Das Tool ist einfach weg. Kein Fehler, keine Warnung. Der Koch erfährt nie etwas von dem Sonderwunsch.

Ich wollte wissen, wie viele Menschen alte Layouts herunterladen und ob das tatsächlich das Verhalten der KI verändert. Ich habe zwei gängige Methoden getestet, um diese Dateien auszuführen: llama.cpp und Python-Code (Hugging Faces transformers-Bibliothek und llama-cpp-python). Ollama und LM Studio haben eine eigene Vorlagenverarbeitung, die ich nicht direkt getestet habe.

In technischer Sprache: Das Zettel-Layout ist die Chat-Vorlage, und die Modelldatei ist eine GGUF-Datei, das Format, das die meisten lokalen KI-Apps verwenden. So passen die beiden zusammen.

Ihre App sendet eine Liste von Nachrichten: einen Systemprompt, einen Benutzerzug, eventuell einen Tool-Aufruf und dessen Ergebnis. Das Modell sieht diese Liste nie. Es sieht einen langen String, aufgebaut exakt in dem Format, auf dem es trainiert wurde, mit speziellen Tokens wie <|im_start|> oder [INST] an den richtigen Stellen.

Die Chat-Vorlage ist das kleine Jinja-Programm, das diesen String zusammenbaut. Die Autoren des Modells liefern sie im Basis-Repo aus, in tokenizer_config.json oder chat_template.jinja. Wenn jemand das Modell nach GGUF konvertiert, wird die Vorlage als tokenizer.chat_template in die Datei kopiert. Von da an trägt die GGUF ihre eigene Kopie mit sich, eingefroren zum Zeitpunkt der Konvertierung.

Basis-Repos stehen nicht still. Autoren korrigieren Vorlagen nach der Veröffentlichung: einen Absturz bei bestimmter Nachrichtenform, ein Tool-Aufruf-Format, einen Whitespace-Bug. Das Basis-Repo erhält die Korrektur. Die GGUF-Kopien nicht, es sei denn, jemand lädt sie erneut hoch.

Die Frage ist also einfach: Wie viele GGUF-Downloads tragen eine Vorlage, die einen anderen Prompt aufbaut als den, den die Autoren heute ausliefern?

Die Hub-API kann die GGUF-Metadaten für jedes Repo in einem einzigen Listing-Aufruf zurückgeben, Vorlage inklusive. Für sechs populäre offene Modellfamilien habe ich alle Uploads abgerufen, die als Quantisierung des Basismodells markiert sind:

Das Tag wird von den Uploadenden gesetzt, und zahlreiche Fine-Tunes, Merges und unzensierte Varianten nutzen es ebenfalls. Das sind andere Modelle, daher habe ich nur reine Repacks behalten, die sauberen Kopien: Repos, deren Name der Name des Basismodells plus Quantisierungsbegriffe und sonst nichts ist. Alle unten genannten Kernzahlen basieren auf diesen 643 Uploads, gewichtet mit ihren Downloads der letzten 30 Tage.

Anschließend habe ich für jede Familie die Commit-Historie des Basis-Repos durchgesehen und jede Version der offiziellen Vorlage extrahiert. Das ist wichtig: Ein Upload, der einer älteren offiziellen Vorlage entspricht, ist veraltet, nicht verändert, und das sind zwei sehr verschiedene Geschichten.

Der Textvergleich allein erwies sich als nutzlos. Unsloths Qwen3-8B-Vorlage ist 737 Zeichen länger als die aktuelle Basis-Vorlage, baut aber denselben Prompt. Deshalb habe ich jede Vorlage mit 12 Testgesprächen gerendert: eine einfache Frage, ein Systemprompt, ein Gespräch über mehrere Runden, Tool-Definitionen, ein Tool-Aufruf und dessen Ergebnis, parallele Aufrufe, deaktiviertes Thinking, früheres Reasoning im Verlauf sowie ein Tool-Aufruf mit null-Inhalt (was die OpenAI-API zurückgibt und was die meisten Agent-Schleifen direkt zurücksenden).

Jede Vorlage habe ich zweimal gerendert, in zwei Engines:

Um sicherzugehen, dass die API mich nicht anlog, habe ich außerdem mit HTTP-Range-Requests die echten Datei-Header von 20 Uploads gelesen. Alle 20 stimmten exakt mit der Vorlage der API überein.

Hier ist das Gesamtergebnis vor den Details. Jeder Balken ist ein Modell, und die Farben zeigen, wie viele seiner Downloads in jeder Engine den offiziellen Prompt aufbauen.

Hier ist die Zeile, die bricht. Sie stammt aus der Vorlage, die Qwen am 28. April 2025 mit Qwen3-8B ausgeliefert hat:

{% - if '</think>' in message. content %} Vollbildmodus aufrufen Vollbildmodus beenden Wenn message.content null ist, was bei einem Assistentenzug der Fall ist, der nur ein Tool aufruft, kann Python nicht mit „in“ darauf zugreifen. Am 19. Mai 2025 hat Qwen das Basis-Repo korrigiert:

{% - if message. content is string %} {% - set content = message. content %} {% - else %} {% - set content = '' %} {% - endif %} Vollbildmodus aufrufen Vollbildmodus beenden Die Korrektur erreichte nie Qwen/Qwen3-8B-GGUF, Qwens eigenes GGUF-Repo. Es trägt weiterhin die April-Vorlage, und es ist mit Abstand die am häufigsten heruntergeladene Qwen3-8B-GGUF: 848.856 Downloads in den letzten 30 Tagen.

Das habe ich mit den echten Bibliotheken überprüft, nicht nur mit meinem eigenen Renderer. Mit der aktuellen Basis-Vorlage rendert transformers 5.24.0 das Gespräch problemlos. Mit der Vorlage in Qwens GGUF schlägt es fehl:

UndefinedError: 'dict object' has no attribute 'content' Vollbildmodus aufrufen Vollbildmodus beenden Auch llama-cpp-python 0.3.38, das seine Vorlage standardmäßig aus der GGUF übernimmt, schlägt fehl:

TypeError: argument of type 'NoneType' is not iterable Vollbildmodus aufrufen Vollbildmodus beenden Die beiden Fehler sehen unterschiedlich aus, weil transformers das leere content-Feld entfernt, bevor es rendert, sodass die Vorlage gar kein content findet, während llama-cpp-python es als None weitergibt. Es ist derselbe Bug: Die alte Vorlage erwartet, dass jeder Assistentenzug Text enthält.

Über alle reinen Qwen3-8B-Repacks hinweg tragen 84 Prozent der Downloads die veraltete Vorlage. In einem Python-Jinja-Stack (transformers, llama-cpp-python oder alles, was darauf aufbaut) bricht jede einzelne davon, sobald Ihr Agent zum ersten Mal einen Tool-Aufruf mit null-Inhalt zurücksendet, was genau das ist, was Clients im OpenAI-Stil tun.

Dann habe ich dieselben Vorlagen durch llama.cpp laufen lassen, und jede einzelne funktionierte. llama.cpps eigene Jinja-Engine erkennt, was eine Vorlage verarbeiten kann und was nicht, und füllt die Lücken selbst, sodass die veraltete Vorlage exakt denselben Prompt aufbaut wie die korrigierte. Wenn Sie Qwen3-8B in llama-server betreiben oder in etwas anderem, das llama.cpps eigene Vorlagen-Engine nutzt, betrifft Sie dieser Bug nie.

Das ist das Muster der gesamten Studie: Ob eine veraltete Vorlage Ihnen schadet, hängt von der Engine ab, in der Sie sie ausführen.

Die alte Vorlage verschwindet auch nicht. 17 Qwen3-8B-Uploads, die nach der Korrektur erstellt wurden, tragen sie weiterhin. Seit Januar 2026 erscheint ungefähr monatlich ein neuer, der jüngste am 6. November 2026.

Die beiden grauen Punkte vor der Korrektur stammen von Unsloth und ggml-org. ggml-org hat seine Datei später auf Qwens korrigierte Vorlage aktualisiert, und Unsloths Datei enthält eigene Bearbeitungen, die denselben Prompt wie die Korrektur aufbauen.

Mistrals Fall ist schlimmer, weil llama.cpp ihn nicht retten kann.

Mistral hat die v0.3-Vorlage zwischen Mai und August 2024 fünfmal aktualisiert. Die beiden am häufigsten heruntergeladenen GGUF-Uploads (MaziyarPanahi mit 60.608 Downloads, lmstudio-community mit 11.100) tragen noch immer die allererste Version vom 22. Mai 2024. Über alle reinen Repacks hinweg nutzen 97 Prozent der Downloads eine veraltete Mistral-Vorlage. Nur etwa 3 Prozent erhalten die aktuelle.

In Python-Jinja lehnt die alte Vorlage jeden Systemprompt ab:

TemplateError: Conversation roles must alternate user/assistant/user/assistant/... Vollbildmodus aufrufen Vollbildmodus beenden llama.cpp behandelt das, indem es den Systemprompt in den ersten Benutzerzug einfügt. Aber die alte Vorlage stammt aus der Zeit vor Mistrals Tool-Format, und genau da wird es still. Senden Sie eine Anfrage mit Tools, und llama.cpp baut einen Prompt auf, der gar keine Tools enthält. Kein [AVAILABLE_TOOLS]-Block, keine Warnung, kein Fehler. Das Modell erfährt nie, dass die Tools existieren. Senden Sie ein Gespräch, das ein Tool-Ergebnis enthält, erhalten Sie stattdessen dies:

HTTP 400: Unable to generate parser for this template. Vollbildmodus aufrufen Vollbildmodus beenden Mit den populärsten Mistral-Uploads schlägt Tool-Aufrufen also nicht laut fehl. Er findet einfach nie statt.

Die eigene Qwen2.5-7B-Instruct-GGUF von Qwen (786.204 Downloads) enthält ein Template vom 18. September 2024. Das Basis-Repository hat es am Folgetag ersetzt. Die Version in der GGUF zeigt dem Modell ein Beispiel für einen Tool-Aufruf mit verdoppelten geschweiften Klammern:

{{"name": <function-name>, "arguments": <args-json-object>}} Enter fullscreen mode Exit fullscreen mode anstelle von:

{"name": <function-name>, "arguments": <args-json-object>} Enter fullscreen mode Exit fullscreen mode Beide Engines bauen den Prompt mit den verdoppelten Klammern, daher erreicht dieser Fehler alle: 70 Prozent der Qwen2.5-7B-GGUF-Downloads. Ob sich das darauf auswirkt, wie gut das Modell Tools aufruft, ist eine Frage für den nächsten Abschnitt.

Das Template von OpenAI für gpt-oss durchlief in seiner ersten Woche vier Versionen. Die GGUF-Uploads blieben zu unterschiedlichen Zeitpunkten stehen:

Die Unterschiede sind klein, aber real. Das aktuelle offizielle Template fügt nach der Systemnachricht eine Leerzeile ein und übergibt das Ergebnis eines Tools als escapten JSON-String. Das Template von Unsloth übergibt das rohe JSON. Die Templates von lmstudio und bartowski fügen eine Leerzeile am Anfang des Tools-Blocks hinzu. Ein Upload lässt die Zeile Reasoning: medium vollständig weg. 62 Prozent der gpt-oss-20b-Downloads bauen in beiden Engines einen Prompt, der vom aktuellen offiziellen Template abweicht.

Nicht jede Modellfamilie hat dieses Problem. Qwen3.8-27B ist das am häufigsten heruntergeladene Modell der Untersuchung, mit 13,8 Millionen Downloads seiner sauberen Kopien in 30 Tagen. Jede dieser Kopien, die ein Template enthält, baut exakt den offiziellen Prompt: 183 von 188, und die übrigen 5 haben gar kein Template. Dasselbe gilt für alle 88 Phi-4-mini-Uploads. Das Template von Phi-4-mini hat sich nie geändert. Das Template von Qwen3.8-27B wurde noch am Release-Tag selbst korrigiert, vor der Welle der Uploads, und eine spätere Bearbeitung veränderte keinen der von mir getesteten Prompts.

Das ist die eigentliche Lehre. Das Risiko liegt nicht im GGUF-Format und nicht bei einem bestimmten Uploader. Es liegt in einem Template, das sich nach der ersten Upload-Welle geändert hat. Uploads aus der ersten Woche nach einem Release erhalten die meisten Downloads: 99 Prozent bei Qwen3-8B, Qwen2.5-7B und gpt-oss-20b, 92 Prozent bei Mistral und 90 Prozent bei Qwen3.8-27B. Genau in dieser ersten Woche korrigieren die Autoren noch ihre Templates.

Ein kleines Beispiel, wie unterschiedlich diese "identischen" Downloads sind: Ich habe die zehn am häufigsten heruntergeladenen Qwen3-8B-Dateien desselben Typs genommen (Q4_K_M, ein verbreitetes 4-Bit-Kompressionsniveau) und ihre digitalen Fingerabdrücke (SHA-256-Hashes) berechnet. Zehn Dateien, zehn verschiedene Fingerabdrücke.

Der Fingerabdruck einer Datei umfasst alles in ihr, also ist ein Teil davon Metadaten: der Template-Text, der Modellname, Notizen des Uploaders. Unterschiedliche Fingerabdrücke beweisen keine unterschiedlichen Gewichte. Aber jeder Uploader kann das Modell auch auf andere Weise komprimieren, und llama.cpp baut aus jeder sauberen Qwen3-8B-Kopie exakt denselben Prompt, sodass jeder Unterschied in den Antworten von den Gewichten stammt. Verändert es die Antworten?

Ich habe die größere Q8_0-Datei von Qwen als Referenz laufen lassen, plus acht Q4_K_M-Dateien von verschiedenen Uploadern, auf einem RTX-5090-Desktop. Derselbe llama.cpp-Build, dieselben Einstellungen mit deaktivierter Zufälligkeit, Qwens Thinking-Modus aus, und dieselben 300 Aufgaben:

Jede Q4_K_M-Datei erzielte zwischen 91,0 und 92,3 Prozent, die Q8_0-Referenz 92,7 Prozent. Keiner dieser Abstände ist mit 300 Aufgaben statistisch signifikant: der kleinste p-Wert gegenüber der Referenz liegt bei 0,18, und die übliche Schwelle ist 0,05.

Allerdings schreiben die Dateien nicht wortwörtlich dieselben Antworten. Die Läufe selbst sind wiederholbar: Qwens eigene Datei, zweimal mit denselben Einstellungen ausgeführt, lieferte bei allen 300 Aufgaben identische Antworten. Die meisten Paare verschiedener Dateien lieferten nur bei 23 bis 34 Prozent der Aufgaben identische Antworten, meist die kurzen Funktionsaufrufe, und jede Datei hatte 9 bis 13 Aufgaben, die sie anders als die Referenz richtig oder falsch löste.

Ein erneuter Durchlauf ändert nichts, diese Unterschiede stammen also aus der Kompression selbst. Sie gehen in beide Richtungen, weshalb sich die Punktzahlen kaum bewegen. Zwei Uploads, Aldaris und MaziyarPanahi, lieferten bei allen 300 Aufgaben identische Antworten, ihre Gewichte sind also praktisch identisch, nur mit unterschiedlichen Metadaten drumherum.

Ein nützliches Detail: Die Datei von eaddario ist 11 Prozent kleiner und etwa 8 Prozent schneller als die übrigen, bei gleicher Punktzahl.

Für Qwen3-8B spielt es also kaum eine Rolle, welcher Uploader das Modell komprimiert hat. Mit welchem Template man am Ende arbeitet, ist eine andere Geschichte.

Für die drei Familien, bei denen llama.cpp einen anderen Prompt baut, habe ich die Datei fixiert und nur das Template ausgetauscht:

Mistral: dieselben Gewichte, zwei verschiedene Produkte. Mit dem Template in der Datei führte das Modell bei 60 Function-Calling-Aufgaben null Tool-Aufrufe aus. Es antwortete in Prosa oder schrieb Python, das nichts aufruf.

Alle 20 Konversationen, die ein Tool-Ergebnis enthielten, kamen als HTTP 400 zurück. Mit dem aktuellen offiziellen Template führte dieselbe Datei in allen 60 Aufgaben einen Tool-Aufruf aus, 55 davon korrekt, und verwendete das Tool-Ergebnis in allen 20 Konversationen richtig. Über die 100 Aufgaben (60 Funktionsaufrufe, 20 Tool-Ergebnisse und 20 Multi-Turn-Chats) stieg die Punktzahl von 12 auf 87 Prozent: 78 Aufgaben wechselten von falsch zu richtig, 3 in die andere Richtung.

Die Regelbefolgung in Multi-Turn-Chats blieb in beiden Fällen bei 60 Prozent, weil llama.cpp den System-Prompt ins alte Template einfügt.

Qwen2.5 und gpt-oss: nichts Messbares. Mit den verdoppelten Klammern löste Qwen2.5 tatsächlich eine Function-Calling-Aufgabe mehr richtig als mit dem aktuellen Template (77 von 80 Aufgaben gegen 76 von 80, p = 1,0). Das ist kein signifikanter Unterschied. gpt-oss erzielte mit beiden Templates 92 von 100, und keine einzige Aufgabe wechselte von richtig zu falsch oder umgekehrt. Der Wortlaut mancher Antworten änderte sich (95 und 65 Prozent blieben identisch), aber ob die Antwort richtig war, nicht.

Das ist das klarste Ergebnis der gesamten Untersuchung. Ein Template-Unterschied in der Formatierung, etwa Leerzeichen, Klammern oder die Art, wie ein Tool-Ergebnis zitiert wird, veränderte nichts von dem, was ich maß. Ein Template-Unterschied in den Fähigkeiten, etwa ein Tool-Format, das das Template nicht kennt, schaltet die Funktion vollständig ab. In llama.cpp geschieht das ohne Fehlermeldung.

Die Kurzfassung: Prüfen Sie, was ein Template kann, nicht wie es aussieht. Ein Template, das sich um eine Leerzeile unterscheidet, ist wahrscheinlich in Ordnung. Ein Template, das älter ist als Tools, oder das bei null content abstürzt, ist es nicht.

Wer GGUF-Modelle in Python ausführt (llama-cpp-python oder eigenes Jinja), sollte davon ausgehen, dass das Template in der Datei veraltet sein kann. Übergeben Sie das Template des Basismodells explizit, statt der Datei zu vertrauen. In llama-cpp-python:

from llama_cpp import Llama from llama_cpp. llama_chat_format import Jinja2ChatFormatter template = open ( "chat_template.jinja" ). read ( ) # from the base model repo llm = Llama ( model_path = "Qwen3-8B-Q4_K_M.gguf" ) llm. chat_handler = Jinja2ChatFormatter ( template = template, eos_token = "<|im_end|>", bos_token = "<|endoftext|>" ). to_chat_handler ( ) Enter fullscreen mode Exit fullscreen mode Wer llama.cpp verwendet, ist vor Abstürzen geschützt, nicht vor Unterschieden. Für Tool-Aufrufe übergeben Sie das Basis-Template mit --chat-template-file und prüfen Sie den Prompt, den es für eine Ihrer echten Anfragen baut:

llama-server -m model.gguf --jinja --chat-template-file chat_template.jinja curl -s localhost:8080/apply-template -d @my_request.json | jq -r.prompt Enter fullscreen mode Exit fullscreen mode Wer Ollama oder LM Studio verwendet: Ich habe sie nicht getestet, weil sie Templates auf ihre eigene Weise behandeln. Ein kurzer Check funktioniert trotzdem: Geben Sie dem Modell ein Tool, stellen Sie eine Frage, die es benötigt, und sehen Sie, ob es das Tool aufruft. Wenn es das nie tut, vergleichen Sie sein Template mit dem des Basis-Repositorys.

Bevor Sie einen Upload wählen, prüfen Sie sein Template gegen das des Basis-Repositorys. Ich habe meine Skripte zu einem Checker mit einem einzigen Befehl zusammengefasst, der dies für jedes GGUF-Repository auf Hugging Face oder für eine bereits vorhandene Datei übernimmt:

uv run check_template.py bartowski/Qwen_Qwen3-8B-GGUF Enter fullscreen mode Exit fullscreen mode Es zeigt Ihnen, ob das Template aktuell, veraltet (und seit wann) oder bearbeitet ist, und welche Arten von Konversationen fehlschlagen. Mit --save chat_template.jinja schreibt es das aktuelle offizielle Template, bereit für --chat-template-file.

Wer GGUFs hochlädt, sollte sein Template erneut prüfen, wenn das Basis-Repository es ändert. Das ist eine Metadaten-Änderung, keine erneute Quantisierung.

Und ein Vorschlag für den Hub: Er parst das Template bereits aus jeder GGUF. Ein kleiner Hinweis "Template weicht vom Basismodell ab" auf der Modellseite würde jeden Fall in diesem Artikel abdecken.

Alles liegt auf GitHub unter github.com/vanshaj1999/gguf-template-check: der Checker, der Hub-Scan, der Renderer, der llama.cpp-Check, der Header-Check, das Benchmark-Harness und jedes Rohergebnis.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

Posted on Nov 24 • Edited on Nov 24 • Originally published at Medium

I checked 1,788 copies of six popular models on Hugging Face. Many carry an old chat layout that can crash some apps or hide the AI's tools. Here's how to check yours.

A note on how I made this: AI tools helped me run these tests and draft this article. The ideas are my own.

If you run AI models on your own computer, you've probably downloaded one from Hugging Face. Search for a popular model like Qwen3-8B and you'll find hundreds of copies, uploaded by different people. Same name, same size. It's natural to assume they're the same thing.

They aren't. Each download is a single file that holds two things: the model itself, and a small piece of code that decides how your conversation gets written out for the model to read.

Picture a restaurant. The model is the chef. Your app (Ollama, LM Studio, or your own code) is the waiter. The waiter writes every order on a ticket, and the chef can only read tickets in one exact layout. That ticket layout comes printed inside the model file. Engineers call it the chat template.

Model makers sometimes improve the ticket layout after release, for example by adding a box for special requests. Copies uploaded before the change keep the old layout forever.

Here's what that looks like in practice. Ask Mistral 7B "What's the weather in Adelaide?" and give it a weather tool. With the current layout, the model reads this (simplified):

[AVAILABLE_TOOLS] get_weather(city) [/AVAILABLE_TOOLS] [INST] What is the weather in Adelaide right now? [/INST] Enter fullscreen mode Exit fullscreen mode With the old layout, which is in the most downloaded copies, it reads this:

[INST] What is the weather in Adelaide right now? [/INST] Enter fullscreen mode Exit fullscreen mode The tool is simply gone. No error, no warning. The chef never hears about the special request.

I wanted to know how many people are downloading old layouts, and whether it actually changes what the AI does. I tested two common ways to run these files: llama.cpp, and Python code (Hugging Face's transformers library and llama-cpp-python). Ollama and LM Studio have their own template handling, and I didn't test them directly.

In engineering terms: the ticket layout is the chat template, and the model file is a GGUF file, the format most local AI apps use. Here is how the two fit together.

Your app sends a list of messages: a system prompt, a user turn, maybe a tool call and its result. The model never sees that list. It sees one long string, laid out in exactly the format it was trained on, with special tokens like <|im_start|> or [INST] in the right places.

The chat template is the small Jinja program that builds that string. The model's authors ship it in the base repo, in tokenizer_config.json or chat_template.jinja. When someone converts the model to GGUF, the template gets copied into the file as tokenizer.chat_template. From then on, the GGUF carries its own copy, frozen at the moment of conversion.

Base repos don't stand still. Authors fix templates after release: a crash on some message shape, a tool-calling format, a whitespace bug. The base repo gets the fix. The GGUF copies don't, unless someone re-uploads them.

So the question is simple: how many GGUF downloads carry a template that builds a different prompt from the one the authors ship today?

The Hub API can return the GGUF metadata for every repo in one listing call, template included. For six popular open model families, I pulled every upload tagged as a quantisation of the base model:

The tag is set by uploaders, and plenty of fine-tunes, merges and uncensored variants use it too. Those are different models, so I kept only pure repacks, the clean copies: repos whose name is the base model's name plus quantisation words and nothing else. Every headline number below uses those 643 uploads, weighted by their downloads over the last 30 days.

Then, for each family, I walked the base repo's commit history and pulled every version of the official template. That matters: an upload that matches an older official template is stale, not edited, and those are very different stories.

Text comparison turned out to be useless on its own. Unsloth's Qwen3-8B template is 737 characters longer than the current base template, but it builds the same prompt. So I rendered every template against 12 test conversations: a plain question, a system prompt, multi-turn chat, tool definitions, a tool call and its result, parallel calls, thinking switched off, earlier reasoning in the history, and a tool call with null content (which is what the OpenAI API returns, and what most agent loops send straight back).

I rendered each template twice, in two engines:

To make sure the API wasn't lying to me, I also read the real file header of 20 uploads with HTTP range requests. All 20 matched the API's template exactly.

Here's the overall result before the details. Each bar is one model, and the colours show how many of its downloads build the official prompt in each engine.

Here's the line that breaks. This is from the template Qwen shipped with Qwen3-8B on 28 April 2025:

{% - if '</think>' in message. content %} Enter fullscreen mode Exit fullscreen mode When message.content is null, which it is for an assistant turn that only calls a tool, Python can't run in on it. On 19 May 2025, Qwen fixed the base repo:

{% - if message. content is string %} {% - set content = message. content %} {% - else %} {% - set content = '' %} {% - endif %} Enter fullscreen mode Exit fullscreen mode The fix never reached Qwen/Qwen3-8B-GGUF, Qwen's own GGUF repo. It still carries the April template, and it's by far the most downloaded Qwen3-8B GGUF: 848,856 downloads in the last 30 days.

I checked this with the real libraries, not just my own renderer. With the current base template, transformers 5.24.0 renders the conversation fine. With the template inside Qwen's GGUF, it fails:

UndefinedError: 'dict object' has no attribute 'content' Enter fullscreen mode Exit fullscreen mode llama-cpp-python 0.3.38, which takes its template from the GGUF by default, fails too:

TypeError: argument of type 'NoneType' is not iterable Enter fullscreen mode Exit fullscreen mode The two errors look different because transformers removes the empty content field before it renders, so the template finds no content at all, while llama-cpp-python passes it on as None. It's the same bug: the old template expects every assistant turn to have text.

Across all Qwen3-8B pure repacks, 84% of downloads carry the stale template. In a Python Jinja stack (transformers, llama-cpp-python, or anything built on them), every one of them breaks the first time your agent sends back a tool call with null content, which is exactly what OpenAI-style clients do.

Then I ran the same templates through llama.cpp, and every one of them worked. llama.cpp's own Jinja engine detects what a template can and can't handle and fills the gaps itself, so the stale template builds exactly the same prompt as the fixed one. If you run Qwen3-8B in llama-server, or anything else that uses llama.cpp's own template engine, this bug never touches you.

That's the pattern for the whole study: whether a stale template hurts you depends on the engine you run it in.

The old template isn't going away, either. 17 Qwen3-8B uploads created after the fix still carry it. Since January 2026 a new one has appeared every month or so, the newest on 6 November 2026.

The two grey dots before the fix are Unsloth and ggml-org. ggml-org later updated its file to Qwen's fixed template, and Unsloth's file has its own edits that build the same prompt as the fix.

Mistral's case is worse, because llama.cpp can't save it.

Mistral updated the v0.3 template five times between May and August 2024. The two most downloaded GGUF uploads (MaziyarPanahi with 60,608 downloads, lmstudio-community with 11,100) still carry the very first version from 22 May 2024. Across all pure repacks, 97% of downloads use a stale Mistral template. Only about 3% get the current one.

In Python Jinja, the old template rejects any system prompt:

TemplateError: Conversation roles must alternate user/assistant/user/assistant/... Enter fullscreen mode Exit fullscreen mode llama.cpp handles that one by folding the system prompt into the first user turn. But the old template predates Mistral's tool format, and that's where it goes quiet. Send a request with tools and llama.cpp builds a prompt with no tools in it at all. No [AVAILABLE_TOOLS] block, no warning, no error. The model never learns the tools exist. Send a conversation that contains a tool result and you get this instead:

HTTP 400: Unable to generate parser for this template. Enter fullscreen mode Exit fullscreen mode So with the most popular Mistral uploads, tool calling doesn't fail loudly. It just never happens.

Qwen's own Qwen2.5-7B-Instruct-GGUF (786,204 downloads) carries a template from 18 September 2024. The base repo replaced it the next day. The version in the GGUF shows the model a tool-call example with doubled braces:

{{"name": <function-name>, "arguments": <args-json-object>}} Enter fullscreen mode Exit fullscreen mode instead of:

{"name": <function-name>, "arguments": <args-json-object>} Enter fullscreen mode Exit fullscreen mode Both engines build the prompt with the doubled braces, so this one reaches everyone: 70% of Qwen2.5-7B GGUF downloads. Whether it changes how well the model calls tools is a question for the next section.

OpenAI's template for gpt-oss went through four versions in its first week. The GGUF uploads froze at different points:

The differences are small but real. The current official template puts a blank line after the system message and passes a tool's result as an escaped JSON string. Unsloth's passes the raw JSON. lmstudio's and bartowski's add a blank line at the start of the tools block. One upload drops the Reasoning: medium line completely. 62% of gpt-oss-20b downloads build a different prompt from the current official template, in both engines.

Not every family has this problem. Qwen3.8-27B is the most downloaded model in the study, with 13.8 million downloads of its clean copies in 30 days. Every one of those copies that carries a template builds exactly the official prompt: 183 of 188, and the other 5 have no template at all. So do all 88 Phi-4-mini uploads. Phi-4-mini's template never changed. Qwen3.8-27B's was fixed on release day itself, before the wave of uploads, and its one later edit didn't change any prompt I tested.

That's the real lesson. The risk isn't GGUF, and it isn't any one uploader. It's a template that changed after the first wave of uploads. Uploads made in the first week after a release end up with most of the downloads: 99% for Qwen3-8B, Qwen2.5-7B and gpt-oss-20b, 92% for Mistral and 90% for Qwen3.8-27B. That first week is exactly when authors are still fixing their templates.

Here's a small sign of how different these "identical" downloads are. I took the ten most downloaded Qwen3-8B files of the same type (Q4_K_M, a common 4-bit compression level) and computed their digital fingerprints (SHA-256 hashes). Ten files, ten different fingerprints.

A file's fingerprint covers everything in it, so part of that is metadata: the template text, the model name, notes from the uploader. Different fingerprints don't prove different weights. But each uploader can also compress the model in a different way, and llama.cpp builds exactly the same prompt from every clean Qwen3-8B copy, so any difference in the answers comes from the weights. Does it change the answers?

I ran Qwen's larger Q8_0 file as a reference, plus eight Q4_K_M files from different uploaders, on an RTX 5090 desktop. Same llama.cpp build, same settings with randomness switched off, Qwen's thinking mode off, and the same 300 tasks:

Every Q4_K_M file scored between 91.0% and 92.3%, and the Q8_0 reference scored 92.7%. None of those gaps is statistically significant with 300 tasks: the smallest p-value against the reference is 0.18, and the usual bar is 0.05.

The files don't write word-for-word the same answers, though. The runs themselves are repeatable: Qwen's own file, run twice with the same settings, gave identical replies on all 300 tasks. Most pairs of different files gave identical replies on only 23% to 34% of tasks, mostly the short function calls, and each file got 9 to 13 tasks right or wrong differently from the reference. A rerun changes nothing, so those differences come from the compression itself. They go both ways, so the scores barely move. Two uploads, Aldaris and MaziyarPanahi, gave identical replies on all 300 tasks, so their weights are effectively the same, with different metadata around them.

One useful detail: eaddario's file is 11% smaller and about 8% faster than the rest, with the same score.

So for Qwen3-8B, which uploader compressed the model barely matters. Which template you end up with is a different story.

For the three families where llama.cpp builds a different prompt, I kept the file fixed and swapped only the template:

Mistral: same weights, two different products. With the template inside the file, the model made zero tool calls in 60 function-calling tasks. It answered in prose, or wrote Python that called nothing. All 20 conversations that contained a tool result came back as HTTP 400. With the current official template swapped in, the same file made a tool call in all 60 tasks, 55 of them correct, and used the tool result correctly in all 20 conversations. Over its 100 tasks (60 function calls, 20 tool results and 20 multi-turn chats), the score went from 12% to 87%: 78 tasks went from wrong to right, and 3 the other way. Rule-keeping across multi-turn chats stayed at 60% either way, because llama.cpp patches the system prompt into the old template.

Qwen2.5 and gpt-oss: nothing I could measure. With the doubled braces, Qwen2.5 actually got one more function-calling task right than with the current template (77 of 80 tasks against 76 of 80, p = 1.0). That isn't a significant difference. gpt-oss scored 92 of 100 with both templates, and not one task changed from right to wrong or back. The wording changed on some replies (95% and 65% stayed identical), but whether the answer was right didn't.

That's the clearest result in the whole study. A template difference in formatting, like whitespace, braces or how a tool result is quoted, didn't change anything I measured. A template difference in capability, like a tool format the template doesn't know, switches the feature off completely. In llama.cpp it does that without an error.

The short version: check what a template can do, not how it looks. A template that differs by a blank line is probably fine. A template that predates tools, or crashes on null content, isn't.

If you run GGUF models in Python (llama-cpp-python, or your own Jinja), assume the template in the file can be stale. Pass the base model's template explicitly instead of trusting the file. In llama-cpp-python:

from llama_cpp import Llama from llama_cpp. llama_chat_format import Jinja2ChatFormatter template = open ( "chat_template.jinja" ). read ( ) # from the base model repo llm = Llama ( model_path = "Qwen3-8B-Q4_K_M.gguf" ) llm. chat_handler = Jinja2ChatFormatter ( template = template, eos_token = "<|im_end|>", bos_token = "<|endoftext|>" ). to_chat_handler ( ) Enter fullscreen mode Exit fullscreen mode If you run llama.cpp, you're protected from crashes, not from differences. For tool calling, pass the base template with --chat-template-file, and check the prompt it builds for one of your real requests:

llama-server -m model.gguf --jinja --chat-template-file chat_template.jinja curl -s localhost:8080/apply-template -d @my_request.json | jq -r.prompt Enter fullscreen mode Exit fullscreen mode If you use Ollama or LM Studio, I didn't test them, because they handle templates their own way. A quick check still works: give the model a tool, ask a question that needs it, and see whether it calls the tool. If it never does, compare its template with the base repo's.

Before you pick an upload, check its template against the base repo's. I turned my scripts into a one-command checker that does this for any GGUF repo on Hugging Face, or a file you already have:

uv run check_template.py bartowski/Qwen_Qwen3-8B-GGUF Enter fullscreen mode Exit fullscreen mode It tells you if the template is up to date, out of date (and since when) or edited, and shows which kinds of conversation break. Add --save chat_template.jinja and it writes the current official template, ready for --chat-template-file.

If you upload GGUFs, re-check your template when the base repo changes it. It's a metadata edit, not a re-quantisation.

And one suggestion for the Hub: it already parses the template out of every GGUF. A small "template differs from base model" note on the model page would catch every case in this article.

Everything is on GitHub at github.com/vanshaj1999/gguf-template-check: the checker, the Hub scan, the renderer, the llama.cpp check, the header check, the benchmark harness and every raw result.

Originaltitel: Your AI Model Isn't Broken. The File You Downloaded Is Out of Date.Quelle: dev.to (dev.to). Original öffnen