git: dc0912208a27 - main - misc/py-gguf: New port: Read and write ML models in GGUF for GGML

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 10 Mar 2025 22:10:44 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=dc0912208a27d212128d8e423afbb7c96f3df28f

commit dc0912208a27d212128d8e423afbb7c96f3df28f
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-03-10 14:57:01 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-03-10 22:10:42 +0000

    misc/py-gguf: New port: Read and write ML models in GGUF for GGML
---
 misc/Makefile          |  1 +
 misc/py-gguf/Makefile  | 37 +++++++++++++++++++++++++++++++++++++
 misc/py-gguf/distinfo  |  3 +++
 misc/py-gguf/pkg-descr |  3 +++
 4 files changed, 44 insertions(+)

diff --git a/misc/Makefile b/misc/Makefile
index e7b16776e5aa..ccb62c3afd73 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -437,6 +437,7 @@
     SUBDIR += py-files-to-prompt
     SUBDIR += py-fleep
     SUBDIR += py-fuzzy
+    SUBDIR += py-gguf
     SUBDIR += py-gluoncv
     SUBDIR += py-gluonnlp
     SUBDIR += py-halo
diff --git a/misc/py-gguf/Makefile b/misc/py-gguf/Makefile
new file mode 100644
index 000000000000..918cd5af3ece
--- /dev/null
+++ b/misc/py-gguf/Makefile
@@ -0,0 +1,37 @@
+PORTNAME=	gguf
+DISTVERSION=	0.16.0
+CATEGORIES=	misc python # machine-learning
+#MASTER_SITES=	PYPI # the PYPI version is way behind of llama-cpp
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Read and write ML models in GGUF for GGML
+WWW=		https://ggml.ai \
+		https://github.com/ggml-org/llama.cpp
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}poetry-core>=1.0.0:devel/py-poetry-core@${PY_FLAVOR}
+RUN_DEPENDS=	${PYNUMPY} \
+		${PYTHON_PKGNAMEPREFIX}pyyaml>=5.1:devel/py-pyyaml@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}sentencepiece>=0.1.98:textproc/py-sentencepiece@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}tqdm>=4.27:misc/py-tqdm@${PY_FLAVOR}
+
+USES=		python shebangfix
+USE_PYTHON=	pep517 autoplist pytest
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	ggml-org
+GH_PROJECT=	llama.cpp
+GH_TAGNAME=	b4837
+
+WRKSRC=		${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME}/gguf-py
+
+SHEBANG_GLOB=	*.py
+
+NO_ARCH=	yes
+
+# tests as of 0.16.0: 5 passed in 1.64s
+
+.include <bsd.port.mk>
diff --git a/misc/py-gguf/distinfo b/misc/py-gguf/distinfo
new file mode 100644
index 000000000000..342771fb3afc
--- /dev/null
+++ b/misc/py-gguf/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1741639456
+SHA256 (ggml-org-llama.cpp-0.16.0-b4837_GH0.tar.gz) = 60587fd5b417ac35d691284e1b117a8c114f10c8d3960494551a4e49338b5e0f
+SIZE (ggml-org-llama.cpp-0.16.0-b4837_GH0.tar.gz) = 20796825
diff --git a/misc/py-gguf/pkg-descr b/misc/py-gguf/pkg-descr
new file mode 100644
index 000000000000..4a376dec83c3
--- /dev/null
+++ b/misc/py-gguf/pkg-descr
@@ -0,0 +1,3 @@
+gguf is a Python module for reading and writing ML models in GGUF for GGML.
+
+gguf is a spin-off of the llama-cpp project.