# Unsloth via pip und uv installieren

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

## **Unsloth Studio**

#### **MacOS, Linux, WSL:**

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

Verwende denselben Befehl zum Aktualisieren oder verwende `unsloth studio update`.

#### **Windows PowerShell:**

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

Verwende denselben Befehl zum Aktualisieren oder verwende `unsloth studio update`.

#### Starten:

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

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

### **Aus dem Haupt-Repository installieren**

#### **Entwicklerinstallationen für macOS, Linux, WSL:**

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

#### **Entwicklerinstallationen für Windows PowerShell:**

```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:**

In 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>

### Deinstallieren

Um Unsloth Studio zu deinstallieren, befolge diese 4 Schritte:

#### **1. Die Anwendung entfernen**

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

Dadurch wird die Anwendung entfernt, aber deine Modell-Checkpoints, Exporte, der Verlauf, der Cache und die Chats bleiben erhalten.

#### **2. Verknüpfungen und symbolische Links entfernen**

**macOS:**

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

**Linux:**

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

**WSL / Windows (PowerShell):**

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

#### **3. Den CLI-Befehl entfernen**

**MacOS, Linux, WSL:**

```bash
rm -f ~/.local/bin/unsloth
```

**Windows (PowerShell):** Das Installationsprogramm hat das `Scripts` -Verzeichnis des venv zu deinem Benutzer-PATH hinzugefügt. Um es zu entfernen, öffne Einstellungen → System → Info → Erweiterte Systemeinstellungen → Umgebungsvariablen, suche `Path` unter Benutzervariablen und entferne den Eintrag, der auf `.unsloth\studio\...\Scripts`.

#### **4. Alles entfernen (optional)**

Um auch Verlauf, Cache, Chats, Modell-Checkpoints und Modellexporte zu löschen, lösche den gesamten Unsloth-Ordner:

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

Beachte, dass heruntergeladene HF-Modelldateien separat im Hugging-Face-Cache gespeichert werden — keine der oben genannten Schritte wird sie entfernen. Siehe **Modelldateien löschen** unten, wenn du diesen Speicherplatz freigeben möchtest.

{% hint style="warning" %}
Hinweis: Die Verwendung der `rm -rf` -Befehle wird **alles löschen**, einschließlich deines Verlaufs, Caches, Chats usw.
{% 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 Standard-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 das standardmäßige Cache-Root ändern.

## **Unsloth Core**

**Mit uv pip installieren (empfohlen) für die neueste pip-Version:**

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv unsloth_env --python 3.13
source unsloth_env/bin/activate
uv pip install unsloth --torch-backend=auto
```

Oder einfach mit pip:

```bash
pip install unsloth
```

Um **vLLM und Unsloth** zusammen zu installieren, führe aus:

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

Um den **aktuellen Hauptzweig** von Unsloth zu installieren, führe 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 **venv- und virtuelle-Umgebungen-Installationen** um deine Installation zu isolieren, damit Systempakete nicht beschädigt werden, und um irreparable Schäden an deinem System zu reduzieren, verwende 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 du Unsloth in Jupyter, Colab oder anderen Notebooks installierst, stelle sicher, dass du dem Befehl das Präfix `!`voranstellst. Das ist bei der Verwendung eines Terminals nicht notwendig

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

### Unsloth Core deinstallieren

Wenn du weiterhin auf Abhängigkeitsprobleme mit Unsloth stößt, haben viele Nutzer sie behoben, indem sie Unsloth zwangsweise deinstalliert und neu installiert haben:

{% 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" %}
Tu **NICHT** verwende dies nicht, wenn du [Conda](/docs/de/loslegen/install/conda-install.md).
{% endhint %}

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 verwende `cu118-ampere` oder `cu121-ampere` oder `cu124-ampere`.

Wenn du zum Beispiel `torch 2.4` und `CUDA 12.1`hast, verwende:

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

Ein weiteres Beispiel: Wenn du `torch 2.5` und `CUDA 12.4`hast, verwende:

```bash
pip install --upgrade pip
hast, verwende:
```

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ühre das Folgende 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ühre das Folgende manuell in einer Python-REPL aus:

{% code overflow="wrap" %}

```python
# Lizenziert unter der Apache License, Version 2.0 (die „Lizenz“)
try: import torch
except: raise ImportError('Install torch via `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} not supported!")
if   v <= V('2.1.0'): raise RuntimeError(f"Torch = {v} too old!")
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} too new!")
if v > V('2.6.9') and cuda not in ("11.8", "12.6", "12.8", "13.0"): raise RuntimeError(f"CUDA = {cuda} not supported!")
x = x.format(cuda.replace(".", ""), "-ampere" if False else "") # is_ampere is broken due to flash-attn
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: 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:

```
GET https://unsloth.ai/docs/de/loslegen/install/pip-install.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
