summaryrefslogtreecommitdiff
path: root/llama.cpp/.devops/nix/sif.nix
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-02-12 20:57:17 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-02-12 20:57:17 +0100
commitb333b06772c89d96aacb5490d6a219fba7c09cc6 (patch)
tree211df60083a5946baa2ed61d33d8121b7e251b06 /llama.cpp/.devops/nix/sif.nix
downloadllmnpc-b333b06772c89d96aacb5490d6a219fba7c09cc6.tar.gz
Engage!
Diffstat (limited to 'llama.cpp/.devops/nix/sif.nix')
-rw-r--r--llama.cpp/.devops/nix/sif.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/llama.cpp/.devops/nix/sif.nix b/llama.cpp/.devops/nix/sif.nix
new file mode 100644
index 0000000..7a5e1dd
--- /dev/null
+++ b/llama.cpp/.devops/nix/sif.nix
@@ -0,0 +1,27 @@
+{
+ lib,
+ singularity-tools,
+ llama-cpp,
+ bashInteractive,
+ interactive ? false,
+}:
+
+let
+ optionalInt = cond: x: if cond then x else 0;
+in
+singularity-tools.buildImage rec {
+ inherit (llama-cpp) name;
+ contents = [ llama-cpp ] ++ lib.optionals interactive [ bashInteractive ];
+
+ # These are excessive (but safe) for most variants. Building singularity
+ # images requires superuser privileges, so we build them inside a VM in a
+ # writable image of pre-determined size.
+ #
+ # ROCm is currently affected by https://github.com/NixOS/nixpkgs/issues/276846
+ #
+ # Expected image sizes:
+ # - cpu/blas: 150M,
+ # - cuda, all gencodes: 560M,
+ diskSize = 4096 + optionalInt llama-cpp.useRocm 16384;
+ memSize = diskSize;
+}