at 25.11-pre 1.8 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 6 # build-system 7 setuptools, 8 setuptools-scm, 9 10 # dependencies 11 bitsandbytes, 12 numpy, 13 packaging, 14 torch, 15 unsloth-zoo, 16 xformers, 17 tyro, 18 transformers, 19 datasets, 20 sentencepiece, 21 tqdm, 22 accelerate, 23 trl, 24 peft, 25 protobuf, 26 huggingface-hub, 27 hf-transfer, 28 diffusers, 29 torchvision, 30}: 31 32buildPythonPackage rec { 33 pname = "unsloth"; 34 version = "2025.4.1"; 35 pyproject = true; 36 37 # Tags on the GitHub repo don't match 38 src = fetchPypi { 39 pname = "unsloth"; 40 inherit version; 41 hash = "sha256-9LtDGfdWH7R3U/xi+aK3V4zA+vs83S6Cp0F2NQKvSdY="; 42 }; 43 44 build-system = [ 45 setuptools 46 setuptools-scm 47 ]; 48 49 dependencies = [ 50 bitsandbytes 51 numpy 52 packaging 53 torch 54 unsloth-zoo 55 xformers 56 tyro 57 transformers 58 datasets 59 sentencepiece 60 tqdm 61 accelerate 62 trl 63 peft 64 protobuf 65 huggingface-hub 66 hf-transfer 67 diffusers 68 torchvision 69 ]; 70 71 # pyproject.toml requires an obsolete version of protobuf, 72 # but it is not used. 73 # Upstream issue: https://github.com/unslothai/unsloth-zoo/pull/68 74 pythonRelaxDeps = [ 75 "protobuf" 76 ]; 77 78 # The source repository contains no test 79 doCheck = false; 80 81 # Importing requires a GPU, else the following error is raised: 82 # NotImplementedError: Unsloth: No NVIDIA GPU found? Unsloth currently only supports GPUs! 83 dontUsePythonImportsCheck = true; 84 85 meta = { 86 description = "Finetune Llama 3.3, DeepSeek-R1 & Reasoning LLMs 2x faster with 70% less memory"; 87 homepage = "https://github.com/unslothai/unsloth"; 88 changelog = "https://github.com/unslothai/unsloth/releases/tag/${version}"; 89 license = lib.licenses.asl20; 90 maintainers = with lib.maintainers; [ hoh ]; 91 }; 92}