{"id":50731655,"url":"https://github.com/daaboulex/unsloth-nix","last_synced_at":"2026-06-10T09:02:12.352Z","repository":{"id":362865414,"uuid":"1257355364","full_name":"Daaboulex/unsloth-nix","owner":"Daaboulex","description":"Unsloth (git main) packaged for NixOS — CPU/CUDA/ROCm LoRA fine-tuning envs","archived":false,"fork":false,"pushed_at":"2026-06-06T08:29:37.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-06T10:13:19.234Z","etag":null,"topics":["cuda","fine-tuning","flake","lora","machine-learning","nix","nixos","nixos-module","pytorch","rocm","unsloth"],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Daaboulex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-02T15:47:10.000Z","updated_at":"2026-06-06T08:29:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Daaboulex/unsloth-nix","commit_stats":null,"previous_names":["daaboulex/unsloth-nix"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Daaboulex/unsloth-nix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Funsloth-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Funsloth-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Funsloth-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Funsloth-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Daaboulex","download_url":"https://codeload.github.com/Daaboulex/unsloth-nix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Daaboulex%2Funsloth-nix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34144680,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","fine-tuning","flake","lora","machine-learning","nix","nixos","nixos-module","pytorch","rocm","unsloth"],"created_at":"2026-06-10T09:02:11.171Z","updated_at":"2026-06-10T09:02:12.344Z","avatar_url":"https://github.com/Daaboulex.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unsloth-nix\n\n\u003c!-- BEGIN generated:badges --\u003e\n[![CI](https://github.com/Daaboulex/unsloth-nix/actions/workflows/ci.yml/badge.svg)](https://github.com/Daaboulex/unsloth-nix/actions/workflows/ci.yml)\n[![NixOS unstable](https://img.shields.io/badge/NixOS-unstable-78C0E8?logo=nixos\u0026logoColor=white)](https://nixos.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n\u003c!-- END generated:badges --\u003e\n\n[Unsloth](https://github.com/unslothai/unsloth) — finetune LLMs 2x faster with ~70% less memory — packaged as a Nix flake. Tracks `unsloth` + `unsloth-zoo` from **git main** (always latest) glued onto nixpkgs' cached PyTorch / Transformers / PEFT / TRL stack (robust, substituted, never forked). Ships ready-to-deploy **CPU**, **CUDA**, and **ROCm** Python environments, dev shells, a NixOS module, and a runnable demo.\n\n\u003c!-- BEGIN generated:upstream --\u003e\n## Upstream\n\n| | |\n|---|---|\n| **Project** | \u003chttps://github.com/unslothai/unsloth\u003e (+ [unsloth-zoo](https://github.com/unslothai/unsloth-zoo)) |\n| **License** | unsloth: Apache-2.0; unsloth-zoo: LGPL-3.0-or-later (this packaging: MIT) |\n| **Tracked** | Git HEAD (`main`) of both repos |\n\nThe pinned commits, source hashes, and versions are the single source of truth\nin [`version.json`](./version.json). The daily `update.yml` workflow runs the\ncustom [`scripts/update.sh`](./scripts/update.sh), which re-pins both repos and\ncommits the bump to `main`.\n\u003c!-- END generated:upstream --\u003e\n\n## Why?\n\n`nixpkgs` ships `python3Packages.unsloth`, but it tracks the PyPI release and\nlags upstream by weeks — and Unsloth iterates fast (new model support, kernels,\nand bug fixes land on `main` constantly). This flake follows `main` for the two\nsmall, pure-Python Unsloth packages while inheriting the *entire* heavy\ndependency stack (torch, xformers, bitsandbytes, triton, transformers, ...)\nunchanged from nixpkgs. You get the latest Unsloth on a robust, cache-backed\nfoundation, with three accelerator targets and the full CI + auto-update\ncontract of the [Daaboulex Nix Packaging Standard](https://github.com/Daaboulex/nix-packaging-standard).\n\n## Outputs\n\n| Output | What |\n|---|---|\n| `packages.default` / `packages.cuda` | CUDA Python env (primary; NVIDIA GPU) |\n| `packages.cpu` | CPU Python env (cache-backed; built in CI) |\n| `packages.rocm` | ROCm Python env (AMD GPU; experimental — see below) |\n| `devShells.{default,cpu,rocm}` | env + lint hooks (`default` adds Jupyter) |\n| `apps.default` | `unsloth-demo` — assert CUDA + print the stack |\n| `overlays.default` | git-main `unsloth`/`unsloth-zoo` override for your own nixpkgs |\n| `nixosModules.default` | `programs.unsloth.enable` — install an env system-wide |\n\n\u003c!-- BEGIN generated:installation --\u003e\n## Installation\n\nRun the CUDA demo (NVIDIA host), or build an env directly:\n\n```bash\nnix run github:Daaboulex/unsloth-nix             # CUDA demo: assert GPU + print stack\nnix build github:Daaboulex/unsloth-nix#cpu       # CPU env\nnix build github:Daaboulex/unsloth-nix#cuda      # CUDA env (NVIDIA)\nnix build github:Daaboulex/unsloth-nix#rocm      # ROCm env (AMD, experimental)\nnix develop github:Daaboulex/unsloth-nix         # CUDA dev shell + Jupyter\n```\n\nAs a flake input with the NixOS module:\n\n```nix\n{\n  inputs.unsloth-nix.url = \"github:Daaboulex/unsloth-nix\";\n\n  # in your host config:\n  imports = [ inputs.unsloth-nix.nixosModules.default ];\n  nixpkgs.overlays = [ inputs.unsloth-nix.overlays.default ];\n  nixpkgs.config = { allowUnfree = true; cudaSupport = true; };\n  programs.unsloth = { enable = true; accelerator = \"cuda\"; };\n}\n```\n\n\u003c!-- END generated:installation --\u003e\n\n## Building the GPU envs (off-CI)\n\nCUDA/ROCm PyTorch is **not** on `cache.nixos.org`, so the CUDA and ROCm envs\nare not built in CI (CI builds and verifies only the CPU env and eval-gates the\nGPU envs). Build them on a machine configured with the community GPU cache so\nyou don't compile torch from source. Add the cache once (it installs the\ncorrect signing key for you):\n\n```bash\ncachix use cuda-maintainers          # CUDA artifacts\ncachix use nixos-rocm                # ROCm artifacts (AMD)\n\nnix build github:Daaboulex/unsloth-nix#cuda\nnix build github:Daaboulex/unsloth-nix#rocm\n```\n\nOr pass the substituter inline for a one-off CUDA build:\n\n```bash\nnix build github:Daaboulex/unsloth-nix#cuda \\\n  --extra-substituters https://cuda-maintainers.cachix.org \\\n  --extra-trusted-public-keys cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=\n```\n\n\u003e **ROCm is experimental.** Unsloth's hard dependencies (`xformers`,\n\u003e `bitsandbytes`) are CUDA-centric and AMD/ROCm support across the stack is\n\u003e still maturing in nixpkgs, so the `rocm` env may fail to evaluate on a given\n\u003e `nixpkgs` pin. The `rocm-eval` CI gate reports this honestly rather than\n\u003e hiding it.\n\n## Development\n\n```bash\nnix develop                  # dev shell + pre-commit hooks\nnix fmt                      # format\nnix flake check              # eval-gates + std-conformance + schema (no heavy build)\nnix flake show               # confirm outputs\n```\n\n`nix flake check` is fast: it evaluates the CUDA/ROCm envs (catching breakage)\nbut only *builds* the cache-backed CPU env.\n\n## Repository Structure\n\n```text\nunsloth-nix/\n├── flake.nix          # outputs: envs (cpu/cuda/rocm), overlay, module, app, checks\n├── lib.nix            # shared env builder (one overlay, three accelerator pkgs sets)\n├── overlay.nix        # pythonPackagesExtensions: git-main unsloth + unsloth-zoo\n├── module.nix         # nixosModules.default — programs.unsloth\n├── version.json       # pinned revs + hashes + versions (source of truth)\n├── apps/demo.py       # apps.default — unsloth-demo\n├── scripts/update.sh  # custom updater: re-pin both git srcs\n├── LICENSE            # MIT (packaging glue)\n└── README.md\n```\n\n## License\n\nThis packaging flake is [MIT](./LICENSE). Upstream `unsloth` is Apache-2.0 and\n`unsloth-zoo` is LGPL-3.0-or-later; their `meta.license` is preserved as\nshipped by nixpkgs.\n\n\u003c!-- BEGIN generated:footer --\u003e\n---\n\n*Maintained as part of the [Daaboulex](https://github.com/Daaboulex) NixOS ecosystem.*\n\u003c!-- END generated:footer --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaaboulex%2Funsloth-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaaboulex%2Funsloth-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaaboulex%2Funsloth-nix/lists"}