> 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).

# Fehlerbehebung bei der Inferenz

Wenn du Probleme beim Ausführen oder Speichern deines Modells hast.

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

Es kann vorkommen, dass Ihr Modell in Unsloth ausgeführt wird und gute Ergebnisse liefert, aber wenn Sie es auf einer anderen Plattform wie Ollama oder vLLM verwenden, sind die Ergebnisse schlecht oder Sie erhalten möglicherweise Kauderwelsch, endlose/unendliche Generierungen *oder* wiederholte Ausgabe&#x6E;**.**

* Die häufigste Ursache für diesen Fehler ist die Verwendung einer <mark style="background-color:blue;">**falschen Chat-Vorlage**</mark>**.** Es ist wichtig, dieselbe Chat-Vorlage zu verwenden, die beim Training des Modells in Unsloth verwendet wurde, und später auch, wenn Sie es in einem anderen Framework wie llama.cpp oder Ollama ausführen. Beim Inferenzieren aus einem gespeicherten Modell ist es entscheidend, die richtige Vorlage anzuwenden.
* Sie müssen das richtige `eos-Token`verwenden. Andernfalls kann es bei längeren Generierungen zu Kauderwelsch kommen.
* Es könnte auch daran liegen, dass Ihre Inferenz-Engine ein unnötiges "Start-of-Sequence"-Token hinzufügt (oder umgekehrt daran fehlt), also prüfen Sie beide Hypothesen!
* <mark style="background-color:green;">**Verwenden Sie unsere Konversations-Notebooks, um die Chat-Vorlage zu erzwingen – das behebt die meisten Probleme.**</mark>
  * Qwen-3 14B Konversations-Notebook [**In Colab öffnen**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_\(14B\)-Reasoning-Conversational.ipynb)
  * Gemma-3 4B Konversations-Notebook [**In Colab öffnen**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Gemma3_\(4B\).ipynb)
  * Llama-3.2 3B Konversations-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 Konversations-Notebook [**In Colab öffnen**](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Phi_4-Conversational.ipynb)
  * Mistral v0.3 7B Konversations-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-Repo**](https://github.com/unslothai/notebooks)**.**

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

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

### Wenn das Speichern als GGUF oder vLLM 16-Bit abstürzt

Sie können versuchen, die maximale GPU-Auslastung beim Speichern zu reduzieren, 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 nutzen. Dadurch können OOM-Abstürze beim Speichern reduziert werden.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
