Skip to content

Instantly share code, notes, and snippets.

@krupkat
Last active July 27, 2023 11:21
Show Gist options
  • Save krupkat/ac790f9d4bc618d414072bb6ae31caea to your computer and use it in GitHub Desktop.
Save krupkat/ac790f9d4bc618d414072bb6ae31caea to your computer and use it in GitHub Desktop.
[llama.cpp on Nix] #nix #llm
{ pkgs ? import <nixpkgs> {} }:
let
clblast = pkgs.callPackage ./clblast {};
in
pkgs.callPackage ./llama { inherit clblast; }
{ lib
, stdenv
, fetchFromGitHub
, cmake
, ninja
, clblast
, ocl-icd
, python3
}:
stdenv.mkDerivation rec {
pname = "llama.cpp";
version = "b5472ea";
src = fetchFromGitHub {
owner = "ggerganov";
repo = "llama.cpp";
rev = "master-b5472ea";
hash = "sha256-O96tIt9F3tZMEEG3FP+zKe7NX05+m4gU+iZaFElEl4s=";
};
nativeBuildInputs = [
cmake
ninja
];
buildInputs = [
clblast
ocl-icd
(python3.withPackages (pkgs: with pkgs; [ numpy sentencepiece ]))
];
cmakeFlags = [
"-DLLAMA_CLBLAST=ON"
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment