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

# Installer Unsloth via pip et uv

Installez Unsloth Studio manuellement ou installez Unsloth Core avec pip, uv ou un environnement virtuel.

**Unsloth Desktop**, **Unsloth Studio**, et **Unsloth Core** s'installent différemment. Cette page couvre l'installation manuelle de Studio et le package Core basé sur le code.

### Unsloth Desktop

Pour l'application de bureau native, utilisez le téléchargement de l'OS plutôt que les commandes ci-dessous :

* <i class="fa-apple">:apple:</i> [Télécharger pour macOS](https://unsloth.ai/download/mac)
* <i class="fa-windows">:windows:</i> [Télécharger pour Windows](https://unsloth.ai/download/windows)
* <i class="fa-linux">:linux:</i> [Télécharger pour Linux](https://unsloth.ai/download/linux)

## **Unsloth Studio**

**Unsloth Studio** est notre interface web. Suivez ci-dessous pour l'installation native :

{% tabs %}
{% tab title="macOS, Linux, WSL" %}
**Installez Unsloth :**

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

Utilisez la même commande pour mettre à jour.
{% endtab %}

{% tab title="Windows" %}
**Installez Unsloth :**

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

Utilisez la même commande pour mettre à jour.
{% endtab %}

{% tab title="Docker" %}
Le [l'image Docker d'Unsloth](https://hub.docker.com/r/unsloth/unsloth) `unsloth/unsloth` est disponible sur Docker. [Lire le guide.](https://unsloth.ai/docs/get-started/install/docker)
{% endtab %}

{% tab title="Homebrew" %}
**Installez Unsloth :**

```bash
brew install --cask unsloth
```

Mettre à jour Unsloth :

```bash
brew upgrade --cask unsloth
```

{% endtab %}

{% tab title="WinGet" %}
**Installez Unsloth :**

```powershell
winget install --id UnslothAI.Unsloth -e
```

Mettre à jour Unsloth :

```powershell
winget upgrade --id UnslothAI.Unsloth -e
```

{% endtab %}
{% endtabs %}

#### Lancer :

{% columns %}
{% column %}
Lancement local standard :

```bash
unsloth studio
```

Pour plus de détails sur l'installation et la désinstallation, veuillez consulter la [section Installation d'Unsloth Studio](/docs/fr/nouveau/studio/install.md) .
{% endcolumn %}

{% column %}
Lancer Unsloth en toute sécurité via HTTPS :

```bash
unsloth studio --secure
```

Utilisez un [tunnel Cloudflare gratuit](/docs/fr/notions-de-base/comment-servir-des-llm-locaux-partout-acces-distant-securise-avec-cloudflare-et-unsloth.md) sur Windows, Mac ou Linux.
{% endcolumn %}
{% endcolumns %}

### **Installer depuis le dépôt principal**

#### **Installations développeur pour 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
```

#### **Installations développeur 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
```

### **Installation nightly**

#### **Nightly - macOS, Linux, WSL :**

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

Puis, pour lancer à chaque fois :

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

#### **Nightly - Windows :**

Exécutez dans Windows PowerShell :

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

Puis, pour lancer à chaque fois :

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

### **Utiliser une ancienne version**

#### **Unsloth Desktop**

Pour utiliser une ancienne version d'Unsloth Desktop, c'est très simple. Consultez simplement [nos versions GitHub](https://github.com/unslothai/unsloth/releases) et sélectionnez la version spécifique que vous souhaitez installer dans la zone « Assets ».

#### **Unsloth Studio**

Pour utiliser une ancienne version d'Unsloth Studio, suivez ci-dessous avec la version et les noms souhaités :

**macOS, Linux, WSL :**

```shellscript
uv pip install \
  --python "$HOME/.unsloth/studio/unsloth_studio/bin/python" \
  --reinstall --no-deps "unsloth==VERSION"

"$HOME/.unsloth/studio/unsloth_studio/bin/unsloth" studio -p 8888
```

**Windows :**&#x20;

```shellscript
uv pip install `
  --python "$env:USERPROFILE\.unsloth\studio\unsloth_studio\Scripts\python.exe" `
  --reinstall --no-deps "unsloth==VERSION"

& "$env:USERPROFILE\.unsloth\studio\unsloth_studio\Scripts\unsloth.exe" studio -p 8888
```

### Désinstaller

La méthode recommandée pour supprimer complètement Unsloth Studio est le script de désinstallation de votre OS. Il arrête tous les serveurs en cours d'exécution, supprime l'application, la commande CLI, les données du lanceur, les raccourcis et les entrées spécifiques à la plateforme (bundle macOS  `.app` + Launch Services ; menu Démarrer Windows + registre + 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 
```

#### Désinstallation manuelle

Si vous préférez supprimer uniquement certaines parties :

**1. Supprimer uniquement l'application** (conserve l'historique, les chats, les points de contrôle et les exportations intacts) :

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

**2. Supprimer Unsloth entièrement** (conserve les autres outils Unsloth intacts) :

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

**3. Supprimer tout ce qui est lié à Unsloth :**

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

{% hint style="warning" %}
Remarque : l'étape 3 supprime tout l'historique, les chats, les points de contrôle des modèles et les exportations. Cela ne peut pas être annulé.
{% endhint %}

**4. Supprimer les raccourcis et les liens symboliques :**

**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. Supprimer la commande CLI :**

* **macOS, Linux, WSL :** `rm -f ~/.local/bin/unsloth`
* **Windows (PowerShell) :** L'installateur a ajouté le répertoire `Scripts` de l'environnement virtuel à votre PATH utilisateur. Pour le supprimer, ouvrez Paramètres → Système → À propos → Paramètres système avancés → Variables d'environnement, recherchez `Path` sous Variables utilisateur, puis supprimez l'entrée pointant vers `.unsloth\studio\...\Scripts`.

{% hint style="info" %}
Remarque : les étapes 1 à 5 ne touchent pas à vos fichiers de modèles HF téléchargés. Consultez ci-dessous Supprimer les fichiers de modèles HF mis en cache si vous souhaitez récupérer cet espace.
{% endhint %}

### **Suppression des fichiers de modèles HF mis en cache**

Vous pouvez supprimer les anciens fichiers de modèle soit depuis l'icône de suppression dans la recherche de modèles, soit en supprimant le dossier de modèle mis en cache correspondant du répertoire de cache Hugging Face par défaut. Par défaut, Hugging Face utilise `~/.cache/huggingface/hub/` sur macOS/Linux/WSL et `C:\Users\<username>\.cache\huggingface\hub\` sur Windows.

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

Si `HF_HUB_CACHE` ou `HF_HOME` est défini, utilisez cet emplacement à la place. Sur Linux et WSL, `XDG_CACHE_HOME` peut également modifier la racine du cache par défaut.

## **Unsloth Core**

**Installez uv avec la commande suivante :**

**macOS, WSL, Linux :**

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

**Windows (PowerShell) :**

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

**Installez Unsloth Core avec uv pip (recommandé) pour la dernière version de pip :**

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

Ou simplement pip :

```bash
pip install unsloth
```

Pour installer **vLLM et Unsloth** ensemble, exécutez :

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

Pour installer **la dernière branche principale** d'Unsloth, exécutez :

{% 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 %}

Pour **les installations via venv et environnements virtuels** afin d'isoler votre installation, de ne pas casser les paquets système et de réduire les dommages irréparables à votre système, utilisez 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 %}

Si vous installez Unsloth dans Jupyter, Colab ou d'autres notebooks, veillez à préfixer la commande avec `!`. Ce n'est pas nécessaire lors de l'utilisation d'un terminal

{% hint style="info" %}
Python 3.13 est désormais pris en charge !
{% endhint %}

### Désinstaller Unsloth Core

Si vous rencontrez encore des problèmes de dépendances avec Unsloth, de nombreux utilisateurs les ont résolus en forçant la désinstallation puis la réinstallation d'Unsloth :

{% 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 %}

### Installation avancée avec pip

{% hint style="warning" %}
Faites **PAS** n'utilisez pas ceci si vous avez [Conda](/docs/fr/commencer/install/conda-install.md).
{% endhint %}

Pip est un peu plus complexe car il y a des problèmes de dépendances. La commande pip est différente pour `torch 2.2,2.3,2.4,2.5` et les versions de CUDA.

Pour les autres versions de torch, nous prenons en charge `torch211`, `torch212`, `torch220`, `torch230`, `torch240` et pour les versions de CUDA, nous prenons en charge `cu118` et `cu121` et `cu124`. Pour les appareils Ampere (A100, H100, RTX3090) et supérieurs, utilisez `cu118-ampere` ou `cu121-ampere` ou `cu124-ampere`.

Par exemple, si vous avez `torch 2.4` et `CUDA 12.1`, utilisez :

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

Autre exemple, si vous avez `torch 2.5` et `CUDA 12.4`, utilisez :

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

Et autres exemples :

```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"
```

Ou, exécutez ce qui suit dans un terminal pour obtenir la **optimale** commande d'installation pip :

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

Ou, exécutez ce qui suit manuellement dans un REPL Python :

{% code overflow="wrap" %}

```python
# Sous licence Apache, version 2.0 (la "License")
try: import torch
except: raise ImportError('Installez 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} non prise en charge !")
if   v <= V('2.1.0'): raise RuntimeError(f"Torch = {v} trop ancien !")
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} trop récent !")
if v > V('2.6.9') and cuda not in ("11.8", "12.6", "12.8", "13.0"): raise RuntimeError(f"CUDA = {cuda} non prise en charge !")
x = x.format(cuda.replace(".", ""), "-ampere" if False else "") # is_ampere est défaillant à cause de 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
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/fr/commencer/install/pip-install.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.
