diff --git a/.github/workflows/nix_build.yaml b/.github/workflows/nix_build.yaml index 71ad59d0..e0076af6 100644 --- a/.github/workflows/nix_build.yaml +++ b/.github/workflows/nix_build.yaml @@ -21,7 +21,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - uses: cachix/cachix-action@v14 with: - name: text-generation-inference + name: huggingface # If you chose signing key for write access authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' env: diff --git a/.github/workflows/nix_cache.yaml b/.github/workflows/nix_cache.yaml index 967a5982..7c73e584 100644 --- a/.github/workflows/nix_cache.yaml +++ b/.github/workflows/nix_cache.yaml @@ -20,7 +20,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - uses: cachix/cachix-action@v14 with: - name: text-generation-inference + name: huggingface # If you chose signing key for write access authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" env: diff --git a/.github/workflows/nix_tests.yaml b/.github/workflows/nix_tests.yaml index d9b91048..4f68ff60 100644 --- a/.github/workflows/nix_tests.yaml +++ b/.github/workflows/nix_tests.yaml @@ -25,7 +25,7 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - uses: cachix/cachix-action@v14 with: - name: text-generation-inference + name: huggingface # If you chose signing key for write access authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' env: diff --git a/Dockerfile.nix b/Dockerfile.nix index f1e7e0f5..90390de6 100644 --- a/Dockerfile.nix +++ b/Dockerfile.nix @@ -6,7 +6,7 @@ FROM nixos/nix:2.18.8 AS builder RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf RUN nix profile install nixpkgs#cachix -RUN cachix use text-generation-inference +RUN cachix use huggingface WORKDIR /root ADD . . RUN nix build . diff --git a/README.md b/README.md index 79991590..f4c6c562 100644 --- a/README.md +++ b/README.md @@ -256,7 +256,7 @@ Another option is to install `text-generation-inference` locally using [Nix](htt we only support Nix on x86_64 Linux with CUDA GPUs. When using Nix, all dependencies can be pulled from a binary cache, removing the need to build them locally. -First follow the instructions to [install Cachix and enable the TGI cache](https://app.cachix.org/cache/text-generation-inference). +First follow the instructions to [install Cachix and enable the Hugging Face cache](https://app.cachix.org/cache/huggingface). Setting up the cache is important, otherwise Nix will build many of the dependencies locally, which can take hours. diff --git a/flake.lock b/flake.lock index 2c6e8063..e57990c8 100644 --- a/flake.lock +++ b/flake.lock @@ -102,7 +102,7 @@ "flake-parts": "flake-parts_3", "nix-test-runner": "nix-test-runner_3", "nixpkgs": [ - "tgi-nix", + "hf-nix", "nixpkgs" ], "pre-commit-hooks": "pre-commit-hooks_3" @@ -579,6 +579,26 @@ "type": "github" } }, + "hf-nix": { + "inputs": { + "flake-compat": "flake-compat_4", + "flake-utils": "flake-utils_7", + "nixpkgs": "nixpkgs_6" + }, + "locked": { + "lastModified": 1747919133, + "narHash": "sha256-VvF1naQOvv7yulQ5/cDiaxkNxlh1Y84QMZnderv1szk=", + "owner": "huggingface", + "repo": "hf-nix", + "rev": "9c71e026d6c7c8588ef85a5f7c77f57d598e038c", + "type": "github" + }, + "original": { + "owner": "huggingface", + "repo": "hf-nix", + "type": "github" + } + }, "nix-filter": { "locked": { "lastModified": 1731533336, @@ -718,16 +738,16 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1746711195, - "narHash": "sha256-bSpM2ySq12PBOVN7jZdzXsc99iRoYOyolh5wz43+CjQ=", + "lastModified": 1747820358, + "narHash": "sha256-fTqsZsUX6M3yeEvgyQvXcbGmT2CaRVyVwsi8eK29Oj4=", "owner": "danieldk", "repo": "nixpkgs", - "rev": "6b7a66b06ccb09ac95872ac6ddf952e0660672ab", + "rev": "d3c1681180717528068082103bf323147de6ab0b", "type": "github" }, "original": { "owner": "danieldk", - "ref": "kernel-builder-cuda-12.9.0", + "ref": "cudatoolkit-12.9-kernel-builder", "repo": "nixpkgs", "type": "github" } @@ -836,19 +856,19 @@ "inputs": { "crate2nix": "crate2nix", "flake-utils": "flake-utils_6", + "hf-nix": "hf-nix", "nix-filter": "nix-filter", "nixpkgs": [ - "tgi-nix", + "hf-nix", "nixpkgs" ], - "rust-overlay": "rust-overlay", - "tgi-nix": "tgi-nix" + "rust-overlay": "rust-overlay" } }, "rust-overlay": { "inputs": { "nixpkgs": [ - "tgi-nix", + "hf-nix", "nixpkgs" ] }, @@ -970,27 +990,6 @@ "repo": "default", "type": "github" } - }, - "tgi-nix": { - "inputs": { - "flake-compat": "flake-compat_4", - "flake-utils": "flake-utils_7", - "nixpkgs": "nixpkgs_6" - }, - "locked": { - "lastModified": 1747733488, - "narHash": "sha256-LYov4H9zvqXXlFKdytcVcDioH416c+LWfyw/HWta0qw=", - "owner": "huggingface", - "repo": "text-generation-inference-nix", - "rev": "61c730990efa58e64c652bf15253aae47dd0f7dd", - "type": "github" - }, - "original": { - "owner": "huggingface", - "ref": "merge-with-kernel-builder", - "repo": "text-generation-inference-nix", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 13f40054..b5b13cad 100644 --- a/flake.nix +++ b/flake.nix @@ -2,15 +2,15 @@ inputs = { crate2nix = { url = "github:nix-community/crate2nix"; - inputs.nixpkgs.follows = "tgi-nix/nixpkgs"; + inputs.nixpkgs.follows = "hf-nix/nixpkgs"; }; nix-filter.url = "github:numtide/nix-filter"; - tgi-nix.url = "github:huggingface/text-generation-inference-nix/merge-with-kernel-builder"; - nixpkgs.follows = "tgi-nix/nixpkgs"; + hf-nix.url = "github:huggingface/hf-nix"; + nixpkgs.follows = "hf-nix/nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; rust-overlay = { url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "tgi-nix/nixpkgs"; + inputs.nixpkgs.follows = "hf-nix/nixpkgs"; }; }; outputs = @@ -21,7 +21,7 @@ nixpkgs, flake-utils, rust-overlay, - tgi-nix, + hf-nix, }: flake-utils.lib.eachDefaultSystem ( system: @@ -33,10 +33,10 @@ }; pkgs = import nixpkgs { inherit system; - inherit (tgi-nix.lib) config; + inherit (hf-nix.lib) config; overlays = [ rust-overlay.overlays.default - tgi-nix.overlays.default + hf-nix.overlays.default (import nix/overlay.nix) ]; }; diff --git a/nix/overlay.nix b/nix/overlay.nix index 069fdd80..0eb07c2a 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -13,26 +13,26 @@ final: prev: { ( python-self: python-super: with python-self; { # Python package override example: - transformers = python-super.transformers.overrideAttrs ( - _: _: { - src = final.fetchFromGitHub { - owner = "huggingface"; - repo = "transformers"; - rev = "v4.51.0"; - hash = "sha256-dnVpc6fm1SYGcx7FegpwVVxUY6XRlsxLs5WOxYv11y8="; - }; - } - ); - huggingface-hub = python-super.huggingface-hub.overrideAttrs ( - _: _: { - src = final.fetchFromGitHub { - owner = "huggingface"; - repo = "huggingface_hub"; - rev = "v0.30.0"; - hash = "sha256-sz+n1uoWrSQPqJFiG/qCT6b4r08kD9MsoPZXbfWNB2o="; - }; - } - ); + #transformers = python-super.transformers.overrideAttrs ( + # _: _: { + # src = final.fetchFromGitHub { + # owner = "huggingface"; + # repo = "transformers"; + # rev = "v4.51.0"; + # hash = "sha256-dnVpc6fm1SYGcx7FegpwVVxUY6XRlsxLs5WOxYv11y8="; + # }; + # } + #); + #huggingface-hub = python-super.huggingface-hub.overrideAttrs ( + # _: _: { + # src = final.fetchFromGitHub { + # owner = "huggingface"; + # repo = "huggingface_hub"; + # rev = "v0.30.0"; + # hash = "sha256-sz+n1uoWrSQPqJFiG/qCT6b4r08kD9MsoPZXbfWNB2o="; + # }; + # } + #); } ) ];