Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Unslothai Unsloth Pyproject Configuration

From Leeroopedia
Revision as of 17:02, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Unslothai_Unsloth_Pyproject_Configuration.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Knowledge Sources
Domains Build_System, Configuration
Last Updated 2026-02-07 08:40 GMT

Overview

Project configuration file defining build system, package metadata, dependencies, and optional GPU-specific installation targets for the Unsloth package.

Description

The pyproject.toml file is the central build and packaging configuration for Unsloth. It uses setuptools with dynamic versioning via setuptools-scm, specifies Python >=3.9 compatibility, and defines an extensive set of optional dependency groups covering different CUDA versions (cu118 through cu130), Intel GPU, AMD GPU, and convenience targets for Colab and Kaggle environments. It also configures ruff linter/formatter settings with Unsloth's custom kwarg spacing rules.

Usage

Reference this configuration when installing Unsloth with specific GPU backends (e.g., pip install unsloth[cu124]) or when understanding the project's dependency matrix and build requirements.

Code Reference

Source Location

Signature

[build-system]
requires = ["setuptools>=80.9.0", "setuptools-scm>=9.2.0"]
build-backend = "setuptools.build_meta"

[project]
name = "unsloth"
dynamic = ["version"]
requires-python = ">=3.9,<3.14"
license = "Apache-2.0"
description = "2-5X faster training, reinforcement learning & finetuning."

Import

pip install unsloth
# Or with specific GPU backend:
pip install "unsloth[cu124]"
pip install "unsloth[colab]"

I/O Contract

Inputs

Name Type Required Description
optional dependency group string No GPU backend selector (cu118, cu121, cu124, cu126, cu128, cu130, colab, kaggle, amd, intel-gpu-*)
Python version string Yes Must be >=3.9, <3.14

Outputs

Name Type Description
Installed package Python package Unsloth with selected dependencies installed
Version string Dynamically determined via setuptools-scm from git tags

Usage Examples

Standard Installation

# Install with CUDA 12.4 support
pip install "unsloth[cu124]"

# Install for Google Colab
pip install "unsloth[colab]"

# Install base (HuggingFace dependencies only)
pip install "unsloth[base]"

Development Installation

# Clone and install in editable mode
git clone https://github.com/unslothai/unsloth.git
cd unsloth
pip install -e ".[cu124]"

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment