> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/de/grundlagen/inference-and-deployment/troubleshooting-inference.md).

# Inferenz-Fehlerbehebung

### Das Ausführen in Unsloth funktioniert gut, aber nach dem Export und dem Ausführen auf anderen Plattformen sind die Ergebnisse schlecht

Manchmal kann es vorkommen, dass Ihr Modell in Unsloth läuft und gute Ergebnisse liefert, aber wenn Sie es auf einer anderen Plattform wie Ollama oder vLLM verwenden, die Ergebnisse schlecht sind oder Sie Kauderwelsch bzw. endlose/unendliche Generierungen erhalten *oder* wiederholte Ausgabe&#x6E;**.**

* Die häufigste Ursache für diesen Fehler ist die Verwendung einer <mark style="background-color:blue;">**inkorrekten Chat-Vorlage**</mark>**.** Es ist entscheidend, dieselbe Chat-Vorlage zu verwenden, die beim Training des Modells in Unsloth verwendet wurde und später, wenn Sie es in einem anderen Framework wie llama.cpp oder Ollama ausführen. Beim Inferencing aus einem gespeicherten Modell ist es wichtig, die korrekte Vorlage anzuwenden.
* Sie müssen das richtige `eos-Token`. Wenn nicht, erhalten Sie möglicherweise bei längeren Generierungen Kauderwelsch.
* Es kann auch daran liegen, dass Ihre Inferenz-Engine ein unnötiges "Start der Sequenz"-Token hinzufügt (oder im Gegenteil dessen Fehlen), also prüfen Sie bitte beide Hypothesen!
* <mark style="background-color:green;">**Verwenden Sie unsere konversationellen Notebooks, um die Chat-Vorlage zu erzwingen - das behebt die meisten Probleme.**</mark>
  * Qwen-3 14B Konversationelles Notebook [**In Colab öffnen**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_\(14B\)-Reasoning-Conversational.ipynb)
  * Gemma-3 4B Konversationelles Notebook [**In Colab öffnen**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Gemma3_\(4B\).ipynb)
  * Llama-3.2 3B Konversationelles Notebook [**In Colab öffnen**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3.2_\(1B_and_3B\)-Conversational.ipynb)
  * Phi-4 14B Konversationelles Notebook [**In Colab öffnen**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Phi_4-Conversational.ipynb)
  * Mistral v0.3 7B Konversationelles Notebook [**In Colab öffnen**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Mistral_v0.3_\(7B\)-Conversational.ipynb)
  * **Weitere Notebooks in unseren** [**Notebooks-Repository**](https://github.com/unslothai/notebooks)**.**

### Speichern in `safetensors`, nicht `bin` Format in Colab

Wir speichern in `.bin` in Colab, da es etwa 4x schneller ist, aber setzen Sie `safe_serialization = None` um das Speichern in `.safetensors`. Also `model.save_pretrained(..., safe_serialization = None)` oder `model.push_to_hub(..., safe_serialization = None)`

### Wenn das Speichern in GGUF oder vLLM 16bit abstürzt

Sie können versuchen, die maximale GPU-Nutzung während des Speicherns zu verringern, indem Sie `maximum_memory_usage`.

Der Standardwert ist `model.save_pretrained(..., maximum_memory_usage = 0.75)`. Reduzieren Sie ihn z. B. auf 0,5, um 50 % des maximalen GPU-Speichers oder weniger zu verwenden. Dies kann OOM-Abstürze beim Speichern reduzieren.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://unsloth.ai/docs/de/grundlagen/inference-and-deployment/troubleshooting-inference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
