> 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/loslegen/install/pip-install.md).

# Unsloth via pip und uv installieren

Unsloth kann auf zwei Arten verwendet werden: über [Unsloth Studio](#unsloth-studio), die Web-UI, oder über [Unsloth Core](#unsloth-core), die codebasierte Version.&#x20;

## **Unsloth Studio**

#### **macOS, Linux, WSL:**

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

Verwenden Sie denselben Befehl zum Aktualisieren.

#### **Windows PowerShell:**

```bash
irm https://unsloth.ai/install.ps1 | iex
```

Verwenden Sie denselben Befehl zum Aktualisieren.

#### Starten:

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

Für detaillierte Installationsanweisungen und Anforderungen für Unsloth Studio, [sehen Sie sich unseren Leitfaden an](/docs/de/neu/studio/install.md).

### **Aus dem Haupt-Repo installieren**

#### **macOS-, Linux- und WSL-Entwicklerinstallationen:**

```bash
git clone https://github.com/unslothai/unsloth
cd unsloth
./install.sh --local
unsloth studio -H 0.0.0.0 -p 8888
```

#### **Windows PowerShell-Entwicklerinstallationen:**

```powershell
winget install -e --id Python.Python.3.13 --source winget
winget install --id=astral-sh.uv  -e --source winget
winget install --id Git.Git -e --source winget
git clone https://github.com/unslothai/unsloth
cd unsloth
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\install.ps1 --local
unsloth studio -H 0.0.0.0 -p 8888
```

### **Nightly-Installation**

#### **Nightly – MacOS, Linux, WSL:**

```bash
git clone https://github.com/unslothai/unsloth
cd unsloth
git checkout nightly
./install.sh --local
```

Dann jedes Mal zum Starten:

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

#### **Nightly – Windows:**

Im Windows PowerShell ausführen:

```bash
winget install -e --id Python.Python.3.13 --source winget
winget install --id=astral-sh.uv  -e --source winget
winget install --id Git.Git -e --source winget
git clone https://github.com/unslothai/unsloth
cd unsloth
git checkout nightly
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\install.ps1 --local
```

Dann jedes Mal zum Starten:

<pre class="language-bash"><code class="lang-bash"><strong>unsloth studio -H 0.0.0.0 -p 8888
</strong></code></pre>

### Deinstallation

Der empfohlene Weg, Unsloth Studio vollständig zu entfernen, ist das Deinstallationsskript für Ihr Betriebssystem. Es stoppt alle laufenden Server, entfernt die App, den CLI-Befehl, Launcher-Daten, Verknüpfungen und plattformspezifische Einträge (macOS `.app` Bundle + Launch Services; Windows-Startmenü + Registrierung + PATH):

**macOS, WSL, Linux:**

```shellscript
curl -fsSL https://raw.githubusercontent.com/unslothai/unsloth/main/scripts/uninstall.sh | sh
```

**Windows (PowerShell):**

```ps1
irm https://raw.githubusercontent.com/unslothai/unsloth/main/scripts/uninstall.ps1 | iex 
```

#### Manuelle Deinstallation

Wenn Sie lieber nur bestimmte Teile entfernen möchten:

**1. Nur die App entfernen** (behalten Sie Verlauf, Chats, Checkpoints und Exporte unverändert):

* **macOS, WSL, Linux:** `rm -rf ~/.unsloth/studio/unsloth_studio`
* **Windows (PowerShell):** `Remove-Item -Recurse -Force "$HOME\.unsloth\studio\unsloth_studio"`

**2. Unsloth vollständig entfernen** (behalten Sie andere Unsloth-Tools unverändert):

* **macOS, WSL, Linux:** `rm -rf ~/.unsloth/studio`
* **Windows (PowerShell):** `Remove-Item -Recurse -Force "$HOME\.unsloth\studio"`

**3. Alles Unsloth-bezogene entfernen:**

* **macOS, WSL, Linux:** `rm -rf ~/.unsloth`
* **Windows (PowerShell):** `Remove-Item -Recurse -Force "$HOME\.unsloth"`

{% hint style="warning" %}
Hinweis: Schritt 3 löscht alles in Verlauf, Chats, Modell-Checkpoints und Exporten. Dies kann nicht rückgängig gemacht werden.
{% endhint %}

**4. Verknüpfungen und symbolische Links entfernen:**

**macOS:**

```shellscript
rm -rf ~/Applications/Unsloth\ Studio.app ~/Desktop/Unsloth\ Studio
```

**Linux:**&#x20;

```shellscript
rm -f ~/.local/share/applications/unsloth-studio.desktop ~/Desktop/unsloth-studio.desktop
```

**WSL / Windows (PowerShell):**

```shellscript
Remove-Item -Force "$HOME\Desktop\Unsloth Studio.lnk"
Remove-Item -Force "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Unsloth Studio.lnk"
```

**5. Den CLI-Befehl entfernen:**

* **macOS, Linux, WSL:** `rm -f ~/.local/bin/unsloth`
* **Windows (PowerShell):** Der Installer hat das Verzeichnis der venv `Scripts` Verzeichnis zu Ihrem Benutzer-PATH hinzugefügt. Um es zu entfernen, öffnen Sie Einstellungen → System → Info → Erweiterte Systemeinstellungen → Umgebungsvariablen, suchen Sie `Path` unter Benutzervariablen und entfernen Sie den Eintrag, der auf `.unsloth\studio\...\Scripts`.

{% hint style="info" %}
Hinweis: Die Schritte 1-5 berühren Ihre heruntergeladenen HF-Modelldateien nicht. Siehe unten Gelöschte zwischengespeicherte HF-Modelldateien, wenn Sie diesen Speicherplatz freigeben möchten.
{% endhint %}

### **Zwischengespeicherte HF-Modelldateien löschen**

Du kannst alte Modelldateien entweder über das Papierkorb-Symbol in der Modellsuche löschen oder indem du den entsprechenden zwischengespeicherten Modellordner aus dem standardmäßigen Hugging-Face-Cache-Verzeichnis entfernst. Standardmäßig verwendet Hugging Face `~/.cache/huggingface/hub/` unter macOS/Linux/WSL und `C:\Users\<username>\.cache\huggingface\hub\` unter Windows.

* **macOS, Linux, WSL:** `~/.cache/huggingface/hub/`
* **Windows:** `%USERPROFILE%\.cache\huggingface\hub\`

Wenn `HF_HUB_CACHE` oder `HF_HOME` gesetzt ist, verwende stattdessen diesen Speicherort. Unter Linux und WSL kann `XDG_CACHE_HOME` auch den Standard-Cache-Stamm ändern.

## **Unsloth Core**

**Installieren Sie uv mit dem folgenden Befehl:**

**macOS, WSL, Linux:**

```shellscript
curl -LsSf https://astral.sh/uv/install.sh | sh
```

**Windows (PowerShell):**

```powershell
irm https://astral.sh/uv/install.ps1 | iex
```

**Installieren Sie Unsloth Core mit uv pip (empfohlen) für die neueste pip-Version:**

```bash
uv venv unsloth_env --python 3.13
source unsloth_env/bin/activate
uv pip install unsloth --torch-backend=auto
```

Oder einfach pip:

```bash
pip install unsloth
```

Zum Installieren **vLLM und Unsloth** zusammen, führen Sie aus:

```bash
uv pip install unsloth vllm --torch-backend=auto
```

Um die **neueste Hauptverzweigung** von Unsloth zu installieren, führen Sie aus:

{% code overflow="wrap" %}

```bash
uv pip install unsloth --torch-backend=auto
pip uninstall unsloth unsloth_zoo -y && pip install --no-deps git+https://github.com/unslothai/unsloth_zoo.git && pip install --no-deps git+https://github.com/unslothai/unsloth.git
```

{% endcode %}

Für **Installationen mit venv und virtuellen Umgebungen** Um Ihre Installation zu isolieren, damit Systempakete nicht beschädigt werden, und um irreparablen Schaden an Ihrem System zu reduzieren, verwenden Sie venv:

{% code overflow="wrap" %}

```bash
apt install python3.10-venv python3.11-venv python3.12-venv python3.13-venv -y
python -m venv unsloth_env
source unsloth_env/bin/activate
pip install --upgrade pip && pip install uv
uv pip install unsloth --torch-backend=auto
```

{% endcode %}

Wenn Sie Unsloth in Jupyter, Colab oder anderen Notebooks installieren, stellen Sie sicher, dass Sie dem Befehl `!` voranstellen. Das ist bei der Verwendung eines Terminals nicht nötig

{% hint style="info" %}
Python 3.13 wird jetzt unterstützt!
{% endhint %}

### Unsloth Core deinstallieren

Wenn Sie weiterhin auf Abhängigkeitsprobleme mit Unsloth stoßen, haben viele Nutzer sie durch erzwungenes Deinstallieren und erneutes Installieren von Unsloth behoben:

{% code overflow="wrap" %}

```bash
pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth
pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth_zoo
```

{% endcode %}

### Erweiterte Pip-Installation

{% hint style="warning" %}
Tun Sie **NICHT** dies, wenn Sie [Conda](/docs/de/loslegen/install/conda-install.md).
{% endhint %}

verwenden. Pip ist etwas komplexer, da es Abhängigkeitsprobleme gibt. Der pip-Befehl ist unterschiedlich für `torch 2.2,2.3,2.4,2.5` und CUDA-Versionen.

Für andere torch-Versionen unterstützen wir `torch211`, `torch212`, `torch220`, `torch230`, `torch240` und für CUDA-Versionen unterstützen wir `cu118` und `cu121` und `cu124`. Für Ampere-Geräte (A100, H100, RTX3090) und höher verwenden Sie `cu118-ampere` oder `cu121-ampere` oder `cu124-ampere`.

Zum Beispiel, wenn Sie `torch 2.4` und `CUDA 12.1`, verwenden Sie:

```bash
pip install --upgrade pip
pip install "unsloth[cu121-torch240] @ git+https://github.com/unslothai/unsloth.git"
```

Ein weiteres Beispiel, wenn Sie `torch 2.5` und `CUDA 12.4`, verwenden Sie:

```bash
pip install --upgrade pip
pip install "unsloth[cu124-torch250] @ git+https://github.com/unslothai/unsloth.git"
```

Und weitere Beispiele:

```bash
pip install "unsloth[cu121-ampere-torch240] @ git+https://github.com/unslothai/unsloth.git"
pip install "unsloth[cu118-ampere-torch240] @ git+https://github.com/unslothai/unsloth.git"
pip install "unsloth[cu121-torch240] @ git+https://github.com/unslothai/unsloth.git"
pip install "unsloth[cu118-torch240] @ git+https://github.com/unslothai/unsloth.git"

pip install "unsloth[cu121-torch230] @ git+https://github.com/unslothai/unsloth.git"
pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"

pip install "unsloth[cu121-torch250] @ git+https://github.com/unslothai/unsloth.git"
pip install "unsloth[cu124-ampere-torch250] @ git+https://github.com/unslothai/unsloth.git"
```

Oder führen Sie unten in einem Terminal aus, um den **optimalen** pip-Installationsbefehl zu erhalten:

```bash
wget -qO- https://raw.githubusercontent.com/unslothai/unsloth/main/unsloth/_auto_install.py | python -
```

Oder führen Sie das Folgende manuell in einer Python-REPL aus:

{% code overflow="wrap" %}

```python
# Lizenziert unter der Apache License, Version 2.0 ("License")
try: import torch
except: raise ImportError('Installieren Sie torch mit `pip install torch`')
from packaging.version import Version as V
import re
v = V(re.match(r"[0-9\.]{3,}", torch.__version__).group(0))
cuda = str(torch.version.cuda)
is_ampere = torch.cuda.get_device_capability()[0] >= 8
USE_ABI = torch._C._GLIBCXX_USE_CXX11_ABI
if cuda not in ("11.8", "12.1", "12.4", "12.6", "12.8", "13.0"): raise RuntimeError(f"CUDA = {cuda} wird nicht unterstützt!")
if   v <= V('2.1.0'): raise RuntimeError(f"Torch = {v} ist zu alt!")
elif v <= V('2.1.1'): x = 'cu{}{}-torch211'
elif v <= V('2.1.2'): x = 'cu{}{}-torch212'
elif v  < V('2.3.0'): x = 'cu{}{}-torch220'
elif v  < V('2.4.0'): x = 'cu{}{}-torch230'
elif v  < V('2.5.0'): x = 'cu{}{}-torch240'
elif v  < V('2.5.1'): x = 'cu{}{}-torch250'
elif v <= V('2.5.1'): x = 'cu{}{}-torch251'
elif v  < V('2.7.0'): x = 'cu{}{}-torch260'
elif v  < V('2.7.9'): x = 'cu{}{}-torch270'
elif v  < V('2.8.0'): x = 'cu{}{}-torch271'
elif v  < V('2.8.9'): x = 'cu{}{}-torch280'
elif v  < V('2.9.1'): x = 'cu{}{}-torch290'
elif v  < V('2.9.2'): x = 'cu{}{}-torch291'
else: raise RuntimeError(f"Torch = {v} ist zu neu!")
if v > V('2.6.9') and cuda not in ("11.8", "12.6", "12.8", "13.0"): raise RuntimeError(f"CUDA = {cuda} wird nicht unterstützt!")
x = x.format(cuda.replace(".", ""), "-ampere" if False else "") # is_ampere ist wegen flash-attn fehlerhaft
print(f'pip install --upgrade pip && pip install --no-deps git+https://github.com/unslothai/unsloth-zoo.git && pip install "unsloth[{x}] @ git+https://github.com/unslothai/unsloth.git" --no-build-isolation')
```

{% endcode %}


---

# 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/loslegen/install/pip-install.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.
