desktop-arrow-downInstall Unsloth via pip and uv

To install Unsloth locally via Pip, follow the steps below:

Unsloth can be used in two ways: through Unsloth Studio, the web UI, or through Unsloth Core, the code-based version.

Unsloth Studio

MacOS, Linux, WSL:

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

Use the same command to update.

Windows PowerShell:

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

Use the same command to update.

Launch Unsloth Studio:

unsloth studio -H 0.0.0.0 -p 8888

For detailed Unsloth Studio install instructions and requirements, view our guide.

Uninstall Unsloth Studio

You can uninstall Unsloth Studio by deleting its install folder usually located under $HOME/.unsloth/studio on Mac/Linux/WSL and %USERPROFILE%\.unsloth\studio on Windows. Or run:

  • MacOS, WSL, Linux: rm -rf ~/.unsloth/studio

  • Windows (PowerShell): Remove-Item -Recurse -Force "$HOME\.unsloth\studio"

  • Optional: remove $HOME\.unsloth on Windows or ~/.unsloth on MacOS/Linux/WSL if you want to delete all Unsloth files

circle-exclamation

Deleting model files

You can delete old model files either from the bin icon in model search or by removing the relevant cached model folder from the default Hugging Face cache directory. By default, Hugging Face uses ~/.cache/huggingface/hub/ on macOS/Linux/WSL and C:\Users\<username>\.cache\huggingface\hub\ on Windows.

  • MacOS, Linux, WSL: ~/.cache/huggingface/hub/

  • Windows: %USERPROFILE%\.cache\huggingface\hub\

If HF_HUB_CACHE or HF_HOME is set, use that location instead. On Linux and WSL, XDG_CACHE_HOME can also change the default cache root.

Troubleshooting

If you're still encountering dependency issues with Unsloth, many users have resolved them by forcing uninstalling and reinstalling Unsloth:

Unsloth Core

Install with uv pip (recommended) for the latest pip release:

Or just pip:

To install vLLM and Unsloth together, do:

To install the latest main branch of Unsloth, do:

For venv and virtual environments installs to isolate your installation to not break system packages, and to reduce irreparable damage to your system, use venv:

If you're installing Unsloth in Jupyter, Colab, or other notebooks, be sure to prefix the command with !. This isn't necessary when using a terminal

circle-info

Python 3.13 is now supported!

Uninstall Unsloth Core

If you're still encountering dependency issues with Unsloth, many users have resolved them by forcing uninstalling and reinstalling Unsloth:

Advanced Pip Installation

circle-exclamation

Pip is a bit more complex since there are dependency issues. The pip command is different for torch 2.2,2.3,2.4,2.5 and CUDA versions.

For other torch versions, we support torch211, torch212, torch220, torch230, torch240 and for CUDA versions, we support cu118 and cu121 and cu124. For Ampere devices (A100, H100, RTX3090) and above, use cu118-ampere or cu121-ampere or cu124-ampere.

For example, if you have torch 2.4 and CUDA 12.1, use:

Another example, if you have torch 2.5 and CUDA 12.4, use:

And other examples:

Or, run the below in a terminal to get the optimal pip installation command:

Or, run the below manually in a Python REPL:

Last updated

Was this helpful?