From nobody Sun Jul 28 23:57:52 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXJMh3wGPz5Ry0J; Sun, 28 Jul 2024 23:57:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXJMh2n9nz4fmQ; Sun, 28 Jul 2024 23:57:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722211072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w3cSxY1849g8pm2ZOzD7q97I9QhZAfAfQFwkrT99tPw=; b=oghfwzXx8LMO2dturzhEJiil6alPrAihT5M/ZTfZYWN1YrclBy9GOJsg2LXXnVI9AS3eDy 5B8rYsnCWWXkDOxy59VgiccSVjEVItsr1xuTSOtGye9435waa+FrzUgBBZ/o7SF/+mJ+8F LlDd76mnubz8aqTnki4zC91011fCo2XabQlXxlbSeFtjBXKOvOC72Iaj6VQUUxE6A7/8G6 CKIVmNeHVCnXWmueciyu8Va44NILcpg3lpL6anKI8tPC6bfd1Pidp54cnhXCZQgzOKUsfR QOoEtcEMcDytmgGf874NfiLvkT3Ng+lruEqSh4owyt3MN8lbreHqM8/s0UiOXw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722211072; a=rsa-sha256; cv=none; b=x3o4HLb2ZATQC3O8o3JnAAKeHCD5Aurp2HizcnAwT8mwD2bp/gaDQB/6Av8HUGcAMkoAG6 xgrIfhcFdTOjYZBSqZeoET0EWeLIDs/NSAcNGp07N9BUiVUx91Aa9wQ+JhGKJWZr6TVRE+ OnYPnojcpnmRN7bTHKXxWIOEhI0lO+VkNlc6pwyLaIDGYAKVP11gxCqGcdsL4+ySynzlwU A7HgBqW63g0AdkBIoirDf5bTOFD7AUQKAIPoqtTi+uFCwkR6gAMB4SiG4wXEPfds+bbM9j oSwgY9lMPs6W1btykjOZ4VnBerU3ms/v5+J8tCtp6tDBk4JAySgQZsAyQgJzcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722211072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=w3cSxY1849g8pm2ZOzD7q97I9QhZAfAfQFwkrT99tPw=; b=bD/Gdk3ZbUmwfqcohDrnpPHwBUvh+NDFtHHiPsnldqn+ZHH+Lgz8rOn9rjcVYK2AFAKCFz +bfnzjbvsfbhK4PIsxe7qGmuyC5lUGociShGlDfFCe7s8tQC+IrZwlCrOuQipze/FZ2hbp IyMgISVfHJRgjEzIjXZqT3y9NOkPoUAAeSHPPW1VUIUIKjoc68n8m0T2/QtZCSHR1RoMNc hqgP16iUcXSk3blXTQQLNl7p3M0TmQ+/9Vw5pC8H/UW1rWGHwbHl5fCUS5rFVUkRSPdPwN qmlGxmMd3RzfBP0edvooGP/ZYJMZRznpQmhM0rxdBYxhZD3ePAwCSof10QVlnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXJMh2Ns8z1BGd; Sun, 28 Jul 2024 23:57:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SNvqIC005524; Sun, 28 Jul 2024 23:57:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SNvqTA005521; Sun, 28 Jul 2024 23:57:52 GMT (envelope-from git) Date: Sun, 28 Jul 2024 23:57:52 GMT Message-Id: <202407282357.46SNvqTA005521@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: cd0465f5d2c1 - main - misc/py-llama-cpp-python: New port: Python bindings for the llama.cpp library List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd0465f5d2c19aecf6c863c5ac5565890cd7b554 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=cd0465f5d2c19aecf6c863c5ac5565890cd7b554 commit cd0465f5d2c19aecf6c863c5ac5565890cd7b554 Author: Yuri Victorovich AuthorDate: 2024-07-28 23:47:17 +0000 Commit: Yuri Victorovich CommitDate: 2024-07-28 23:57:43 +0000 misc/py-llama-cpp-python: New port: Python bindings for the llama.cpp library --- misc/Makefile | 1 + misc/py-llama-cpp-python/Makefile | 38 ++++++++++++++++++++++ misc/py-llama-cpp-python/distinfo | 5 +++ .../files/patch-llama__cpp_llama__cpp.py | 11 +++++++ misc/py-llama-cpp-python/pkg-descr | 5 +++ 5 files changed, 60 insertions(+) diff --git a/misc/Makefile b/misc/Makefile index e6e9bfdede5b..f99169f04911 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -445,6 +445,7 @@ SUBDIR += py-lightgbm SUBDIR += py-lightning-utilities SUBDIR += py-litellm + SUBDIR += py-llama-cpp-python SUBDIR += py-llm SUBDIR += py-llm-claude-3 SUBDIR += py-log_symbols diff --git a/misc/py-llama-cpp-python/Makefile b/misc/py-llama-cpp-python/Makefile new file mode 100644 index 000000000000..1a8d2ad7f44b --- /dev/null +++ b/misc/py-llama-cpp-python/Makefile @@ -0,0 +1,38 @@ +PORTNAME= llama-cpp-python +DISTVERSIONPREFIX= v +DISTVERSION= 0.2.84 +CATEGORIES= misc # machine-learning +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Python bindings for the llama.cpp library +WWW= https://llama-cpp-python.readthedocs.io/en/latest/ + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE.md + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}scikit-build-core>0:devel/py-scikit-build-core@${PY_FLAVOR} \ + cmake:devel/cmake-core +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}diskcache>=5.6.1:devel/py-diskcache@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}Jinja2>=2.11.3:devel/py-Jinja2@${PY_FLAVOR} \ + ${PYNUMPY} \ + ${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.5.0:devel/py-typing-extensions@${PY_FLAVOR} +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}fastapi>=0.100.0:www/py-fastapi@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pydantic-settings>=2.0.1:devel/py-pydantic-settings@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}sse-starlette>=1.6.1:www/py-sse-starlette@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}starlette-context>=0.3.6:www/py-starlette-context@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}uvicorn>=0.22.0:www/py-uvicorn@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyyaml>=5.1:devel/py-pyyaml@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}httpx>=0.24.1:www/py-httpx@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}scipy>=1.10:science/py-scipy@${PY_FLAVOR} + +USES= python shebangfix +USE_PYTHON= pep517 autoplist pytest + +USE_GITHUB= yes +GH_ACCOUNT= abetlen +GH_TUPLE= ggerganov:llama.cpp:4730fac:cpp/vendor/llama.cpp + +SHEBANG_GLOB= *.py + +.include diff --git a/misc/py-llama-cpp-python/distinfo b/misc/py-llama-cpp-python/distinfo new file mode 100644 index 000000000000..79307b9535ed --- /dev/null +++ b/misc/py-llama-cpp-python/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1722209930 +SHA256 (abetlen-llama-cpp-python-v0.2.84_GH0.tar.gz) = 5b030c3ee8aeefa2f3b49c0788f34b7da3fef2502dd856c68d9ede6b93dd8e53 +SIZE (abetlen-llama-cpp-python-v0.2.84_GH0.tar.gz) = 274756 +SHA256 (ggerganov-llama.cpp-4730fac_GH0.tar.gz) = 8b54c2f6c0560e48cf2af91840c33d81f688edfecbd11043d4bf7c098a125497 +SIZE (ggerganov-llama.cpp-4730fac_GH0.tar.gz) = 19005559 diff --git a/misc/py-llama-cpp-python/files/patch-llama__cpp_llama__cpp.py b/misc/py-llama-cpp-python/files/patch-llama__cpp_llama__cpp.py new file mode 100644 index 000000000000..64e43300b493 --- /dev/null +++ b/misc/py-llama-cpp-python/files/patch-llama__cpp_llama__cpp.py @@ -0,0 +1,11 @@ +--- llama_cpp/llama_cpp.py.orig 2024-07-28 03:36:26 UTC ++++ llama_cpp/llama_cpp.py +@@ -28,7 +28,7 @@ def _load_shared_library(lib_base_name: str): + # for llamacpp) and "llama" (default name for this repo) + _lib_paths: List[pathlib.Path] = [] + # Determine the file extension based on the platform +- if sys.platform.startswith("linux"): ++ if sys.platform.startswith("linux") or sys.platform.startswith("freebsd"): + _lib_paths += [ + _base_path / f"lib{lib_base_name}.so", + ] diff --git a/misc/py-llama-cpp-python/pkg-descr b/misc/py-llama-cpp-python/pkg-descr new file mode 100644 index 000000000000..6c5bf2aa148e --- /dev/null +++ b/misc/py-llama-cpp-python/pkg-descr @@ -0,0 +1,5 @@ +llama-cpp-python is the Python bindings for the llama.cpp library/ + +The main goal of llama.cpp is to enable LLM inference with minimal setup and +state-of-the-art performance on a wide variety of hardware - locally and in +the cloud.