From 1780cbb35167e444dfffae613d1397e898780f6f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 13 Dec 2024 14:45:14 +0100 Subject: [PATCH] python312Packages.llm-gguf: init at 0.2 --- .../python-modules/llm-gguf/default.nix | 49 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/python-modules/llm-gguf/default.nix diff --git a/pkgs/development/python-modules/llm-gguf/default.nix b/pkgs/development/python-modules/llm-gguf/default.nix new file mode 100644 index 0000000000000..e8aef9c055065 --- /dev/null +++ b/pkgs/development/python-modules/llm-gguf/default.nix @@ -0,0 +1,49 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + httpx, + llama-cpp-python, + llm, +}: + +buildPythonPackage rec { + pname = "llm-gguf"; + version = "0.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "simonw"; + repo = "llm-gguf"; + tag = version; + hash = "sha256-ihMOiQnTfgZKICVDoQHLOMahrd+GiB+HwWFBMyIcs0A="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + httpx + llama-cpp-python + llm + ]; + + pythonImportsCheck = [ "llm_gguf" ]; + + # Tests require internet access (downloading models) + doCheck = false; + + meta = { + description = "Run models distributed as GGUF files using LLM"; + homepage = "https://github.com/simonw/llm-gguf"; + changelog = "https://github.com/simonw/llm-gguf/releases/tag/${src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3f605d17548cd..fe63b5e8b43b4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7584,6 +7584,8 @@ self: super: with self; { llm = callPackage ../development/python-modules/llm { }; + llm-gguf = callPackage ../development/python-modules/llm-gguf { }; + llmx = callPackage ../development/python-modules/llmx { }; llvmlite = callPackage ../development/python-modules/llvmlite {