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
- 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.
- 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. - Ollama with your own Modelfile: Use
ollama show --modelfile <modellname>to check whether a TEMPLATE is listed. A Modelfile created only withFROM datei.ggufand without a matching TEMPLATE often causes this error. Copy the template andPARAMETER stopfrom the Modelfile of the same model in the official library. - llama.cpp: Start
llama-serverwithout--chat-templateso the template from the model is used (the Jinja engine is enabled by default). Make sure you have not set--no-jinja. - 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.
- 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:
- Your own ChatGPT with Ollama and Open WebUI
Run a language model locally on Windows - with the Ollama app, suitable models for 8 to 24 GB, context length, command line, and Open WebUI… - LM Studio: Your First Local Chat
Install LM Studio on Windows, load a suitable language model, and chat offline, even with your own documents. - Chat with your own documents (AnythingLLM)
Set up AnythingLLM Desktop on Windows, load PDFs into a workspace, and ask questions locally — with sources and privacy.
Terms for this
Similar errors
- GGUF: unknown model architecture (program too old for the model)
- Model forgets the beginning or ignores long texts (context length too small)
- Very slow responses because the model does not fit in VRAM
- AMD graphics card not being used (ROCm or Vulkan)
- GGUF: tensor '…' data is not within the file bounds, model is corrupted or incomplete (model file incomplete)
Sources
- https://docs.ollama.com/modelfile
- https://docs.ollama.com/import
- https://huggingface.co/docs/hub/ollama
- https://raw.githubusercontent.com/ggml-org/llama.cpp/master/tools/server/README.md
Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.