Free | No tracking | Every fact with a source|German and English

Error / Models and files

Confusing answers, endless loops, or tags like <|im_end|> (wrong chat template)

The model writes control characters into the response, plays both sides of the conversation, or never stops because the chat template doesn’t fit.

The message

… <|im_end|> <|im_start|>user …  (Modell redet mit sich selbst und hört nicht auf)

Affects: Ollama, llama.cpp, LM Studio, KoboldCpp, Open WebUI

Why is this happening?

Every chat model expects its input in a fixed format with special markers. This template is usually stored in the GGUF file. If it’s missing, broken, or a base model is loaded instead of an Instruct variant, the model doesn’t recognize the end of its response.

How to fix it

  1. Check whether you loaded a chat or Instruct variant (the name usually includes “Instruct”, “Chat”, or “it”). Pure base models are not meant for chats.
  2. Ollama: Load models preferably directly from the Ollama library or with ollama run hf.co/<nutzer>/<repo>:<quant>. Then the template is chosen automatically from the GGUF file metadata.
  3. Ollama with your own Modelfile: Use ollama show --modelfile <modellname> to check whether a TEMPLATE is listed. A Modelfile created only with FROM datei.gguf and without a matching TEMPLATE often causes this error. Copy the template and PARAMETER stop from the Modelfile of the same model in the official library.
  4. llama.cpp: Start llama-server without --chat-template so the template from the model is used (the Jinja engine is enabled by default). Make sure you have not set --no-jinja.
  5. LM Studio and KoboldCpp: Update to the latest version and load a current GGUF file of the model, because older uploads sometimes contain faulty templates.
  6. If the problem only happens in one frontend, test the same model directly in the terminal with ollama run. If it works there, the issue is with parameters in the frontend (for example, a custom stop word or template).

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.