RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Errors / Tokenizer mismatches / Quantized model produces garbage / never stops generating
Tokenizer mismatches
Verified by owner

Quantized model produces garbage / never stops generating

(no error — output is incoherent, repeats, or generates until max tokens)
By Eruo Fredoline · Last verified May 8, 2026

Cause

The model is fine; the chat template (or stop tokens) doesn't match what it was trained on. Symptoms: assistant responses run on past the natural stopping point, get into role-play loops, or come out as gibberish from token one.

Two distinct causes:

  • Wrong chat template. Llama 3 uses <|start_header_id|>...<|end_header_id|>; ChatML uses <|im_start|>...<|im_end|>; Mistral uses [INST]...[/INST]. Mixing them looks like instruction-following from the runner's view but the model receives garbled boundaries.
  • EOS token not being respected. Many GGUFs ship with a generic <|endoftext|> while the model was trained to emit <|im_end|> or <|eot_id|>. The runner doesn't see the real stop signal.

Solution

1. Verify the chat template in the GGUF (or in tokenizer_config.json for HF models):

# llama.cpp — print the embedded template
./llama-cli -m model.gguf --chat-template chatml --prompt "test"
# Common values: chatml, llama2, llama3, mistral, gemma, vicuna, deepseek

If the embedded template is wrong/missing, override at runtime:

./llama-server -m model.gguf --chat-template llama3

2. Check the configured stop tokens. llama.cpp and Ollama derive these from the GGUF, but custom quants may have stripped them. In Ollama Modelfile:

PARAMETER stop "<|im_end|>"
PARAMETER stop "<|eot_id|>"

3. Re-pull from a reputable uploader. Check bartowski/<model> or lmstudio-community/<model> on Hugging Face — they ship correct templates and stop tokens. Avoid uploads that only have Q2_K and no Q4 (often hasty conversions).

4. Confirm you're on the right chat format in your client. OpenWebUI, LM Studio, and Open WebUI each have a "chat template" override per-model — pick the one that matches the model card's documented format.

Related errors

  • Model loaded but tokenizer vocab size mismatch
  • TypeError: 'NoneType' object is not subscriptable in tokenizer
  • OSError: Can't load tokenizer for ... / no file named tokenizer.json
  • GGUF model outputs garbage — tokenizer / chat-template mismatch
  • Model produces gibberish or repeats one token forever

Did this fix it?

If your case was different, email Contact support with what you saw and we'll update the page. If it worked but took different commands on your platform, we want to know that too.