Files
millerson-overlay.nix/packages/llama-cpp/package.nix
T
alex 6013b17aad chore(packages): bump pins to current upstream releases
Refresh every package pin so the overlay stops carrying versions upstream
has moved past, and repair the pins where an automated bump had produced a
version that no longer resolves:

- graphify 0.9.61 -> 1.0.0 and back to tag tracking: the branch-tracking
  update script generated v0.9.77-unstable-<date> for a rev = "v${version}"
  src, a tag that never existed
- radar 1.13.1 -> 1.16.2 (upstream retagged its releases as k8s-ui-v*)
- llama-cpp b9645 -> b11439
- hipengine 0.5.0 -> 0.6.1, traycer 1.3.0 -> 1.4.2, freetoken 0.1.2 -> 0.1.3
- awg-tool 0.4.0, freebuff 0.2.19, kubernetes-mcp-server 0.0.67,
  marmel 0-unstable-2026-10-05, open-code-review 1.12.12,
  ds4 0-unstable-2026-09-20
- version-string normalisation for the branch-tracked packages already at
  their newest commit (g3, haivemind, shardr, skillsmcp)

Every changed src hash was re-fetched and verified. omniroute stays at
3.8.50: 3.8.51 changes its npm lockfile, so its npmDepsHash would have to
be recomputed before the bump is usable.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-10-06 16:46:26 +03:00

118 lines
3.8 KiB
Nix

{
lib,
# Build skeleton: nixpkgs' own llama-cpp derivation (b-tag layout, cmake/npm
# plumbing), retargeted at the pinned tag below.
llama-cpp,
fetchFromGitHub,
rocmPackages,
# nixpkgs-latest's nodejs/npm hooks: referenced only to strip them from
# nativeBuildInputs (the npm/web UI build is disabled below).
nodejs_latest,
npmHooks,
# Strix Halo (Radeon 8060S). clr/rocBLAS/hipBLAS come prefixed for this arch
# by the scoped rocmPackages in ./default.nix.
rocmGpuTargets ? [ "gfx1151" ],
}:
let
# Upstream release tag. Bump with:
# nix flake prefetch github:ggml-org/llama.cpp/b<NNNN>
# then update buildNumber and the src hash.
buildNumber = "11439";
# HIP flags from the llm-engine.nix bring-up config. The -I paths for
# hipBLASLt/rocWMMA are dropped because this tag's HIP backend links
# hipBLAS/rocBLAS only; GGML_HIPBLASLT and GGML_CUDA_ENABLE_UNIFIED_MEMORY
# are also unused by b9645 (cmake warns and ignores them).
hipFlags = lib.concatStringsSep " " [
"-mllvm"
"-amdgpu-early-inline-all=true"
"-mllvm"
"-amdgpu-function-calls=false"
"-mprefer-vector-width=512"
"-famd-opt"
"-mllvm"
"-inline-threshold=600"
"-mllvm"
"-unroll-threshold=150"
];
in
(llama-cpp.override {
inherit rocmPackages rocmGpuTargets;
rocmSupport = true;
vulkanSupport = true;
cudaSupport = false;
}).overrideAttrs
(old: {
version = buildNumber;
src = fetchFromGitHub {
owner = "ggml-org";
repo = "llama.cpp";
tag = "b${buildNumber}";
# Tarball hash (this tag has no submodules).
hash = "sha256-9KUkThRm+kvYOguP08JOPtjQjtDsDqgh1e50NdR0V5I=";
};
# The embedded web UI is disabled via cmakeFlags, so none of the npm
# machinery is needed: no dependency tree, and npmConfigHook hard-fails
# when npmDeps is null, so it (and nodejs) must come off the inputs.
npmDeps = null;
npmRoot = null;
npmDepsHash = null;
nativeBuildInputs = builtins.filter (x: x != nodejs_latest && x != npmHooks.npmConfigHook) (
old.nativeBuildInputs or [ ]
);
# The release tarball has no .git; upstream wants the build id in COMMIT.
postPatch = ''
echo ${buildNumber} > COMMIT
'';
# Replaces the base derivation's npm build step. CMAKE_HIP_FLAGS holds
# several space-separated flags, so it must be appended as an array element:
# plain cmakeFlags scalars are word-split by the cmake hook.
preConfigure = ''
prependToVar cmakeFlags "-DLLAMA_BUILD_COMMIT:STRING=$(cat COMMIT)"
cmakeFlagsArray+=("-DCMAKE_HIP_FLAGS=${hipFlags}")
'';
cmakeFlags =
builtins.filter (f: !(builtins.isString f && builtins.match ".*LLAMA_BUILD_NUMBER.*" f != null)) (
old.cmakeFlags or [ ]
)
++ [
"-DCMAKE_C_FLAGS=-march=znver5"
"-DCMAKE_CXX_FLAGS=-march=znver5"
"-DGGML_CPU=ON"
"-DGGML_AVX=ON"
"-DGGML_AVX_VNNI=ON"
"-DGGML_AVX2=ON"
"-DGGML_BMI2=ON"
"-DGGML_AVX512=ON"
"-DGGML_AVX512_VNNI=ON"
"-DGGML_AVX512_VBMI=ON"
"-DGGML_AVX512_BF16=ON"
"-DGGML_FMA=ON"
"-DGGML_F16C=ON"
"-DHIP_PLATFORM=amd"
"-DGGML_CUDA_FORCE_CUBLAS=OFF"
"-DGGML_HIPBLASLT=ON"
"-DGGML_HIP_NO_VMM=ON"
"-DGGML_HIP_GRAPHS=ON"
"-DGGML_CUDA_ENABLE_UNIFIED_MEMORY=ON"
"-DGGML_HIP_ROCWMMA_FATTN=OFF"
"-DGGML_HIP_MMQ_MFMA=ON"
"-DGGML_CUDA_FA_ALL_QUANTS=ON"
"-DCMAKE_BUILD_TYPE=Release"
"-DLLAMA_BUILD_NUMBER:STRING=${buildNumber}"
(lib.cmakeBool "LLAMA_BUILD_UI" false)
(lib.cmakeBool "LLAMA_USE_PREBUILT_UI" false)
];
# The base's update script tracks nixpkgs' llama-cpp attr, not this pin.
passthru = builtins.removeAttrs (old.passthru or { }) [ "updateScript" ] // {
category = "AI Inference";
};
})