From patchwork Mon Aug 14 12:56:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Tai X-Patchwork-Id: 52836 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 713F427BBEA; Mon, 14 Aug 2023 13:57:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2B5FB27BBE9 for ; Mon, 14 Aug 2023 13:57:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVX85-0001C5-0a; Mon, 14 Aug 2023 08:57:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVX82-0001Bu-Um for guix-patches@gnu.org; Mon, 14 Aug 2023 08:57:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVX82-0001MX-MP for guix-patches@gnu.org; Mon, 14 Aug 2023 08:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qVX82-0002pM-C4 for guix-patches@gnu.org; Mon, 14 Aug 2023 08:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65287] [PATCH v2] gnu: Add gpt4all-backend References: In-Reply-To: Resent-From: Andy Tai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Aug 2023 12:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65287 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65287@debbugs.gnu.org Cc: Andy Tai Received: via spool by 65287-submit@debbugs.gnu.org id=B65287.169201781010832 (code B ref 65287); Mon, 14 Aug 2023 12:57:02 +0000 Received: (at 65287) by debbugs.gnu.org; 14 Aug 2023 12:56:50 +0000 Received: from localhost ([127.0.0.1]:33159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVX7p-0002ob-A9 for submit@debbugs.gnu.org; Mon, 14 Aug 2023 08:56:49 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]:42034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qVX7n-0002oB-GV for 65287@debbugs.gnu.org; Mon, 14 Aug 2023 08:56:48 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-686f94328a4so2857800b3a.0 for <65287@debbugs.gnu.org>; Mon, 14 Aug 2023 05:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692017801; x=1692622601; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=2FSG5OfufTdUEIRv/MluvEyBH3XIE/jNb9VO/6E5OOQ=; b=K5M8MzU8msEMEvbk1At8S9RhNk9E9fsrHIxYjdExV1B0VGdqr7qDih2ez4zgBZ9iNg Pkh38KFmVSRGoGuHpF0XBPd/t+SoYla/RLuZMu8GseFxqqkMx02EfPTVXJDFLvDNXFaq 0gqxsO7EHG0EGzbzY5syu5xwQw1yd2DedEQruA8vpXk2y4o9SpJNwrurz1gzCivNqTqU wpK6MYGPdeJ1j8ELtkW4VqRSL/wHgpCrpDYV7Edziav6a/rOVaytPsuIYpOqOtxzKLk0 nplETGK1rqcGK5H6y4lx1r3CvZJrk5TZejZBIkVoGrMWOiNLJg75PTAf9IbPt4AunV79 SnUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692017801; x=1692622601; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2FSG5OfufTdUEIRv/MluvEyBH3XIE/jNb9VO/6E5OOQ=; b=Xb/Lwx/mni+znj7mU61rVKFlqZIBtNXZg+zvtRregr6+JtzQg/aE7t2vkGgrOoe+vU EGglIKEBYJKY2HX3WFU3qYbzTzB92o4ZXm8LP8N5PZSC6sbBBhjW1dTTk5vFzlKE7en7 8xtQiHWsTZK7O/c1tK/okEusox8aWZiUlPz4qayBThZiOpF/gdulxb+R7cKoSXbt3LKl LEoiChiueJdNjUSFrPe9fSRoLeYYS4bhSdV9WTBBtjVw27x5m9y4xdWT2vt4o6mC0Sz8 hg0U0DfxAeKunpLotPyCfQsS36WqTTH+MIXBen47lEsGOQPSfHcV2Dw5aKwoFA9VIg6K OPwg== X-Gm-Message-State: AOJu0Ywl7/RO5PglpWdAnsinXGH/YV+1pNMBArVeiLIQa+7Hep6JGQXM /3OwDNdDeL4GDf1m0syELvDXL0afXEVTmQ== X-Google-Smtp-Source: AGHT+IGKulheI9GWXOx4mPVG2Z8wlXdYILjRpmAwKh5DM4lOvsk6fupKKdOUeOE3hM5MsJ+WJhK1ZA== X-Received: by 2002:a05:6a20:1585:b0:125:928d:6745 with SMTP id h5-20020a056a20158500b00125928d6745mr12255006pzj.15.1692017801217; Mon, 14 Aug 2023 05:56:41 -0700 (PDT) Received: from localhost.localdomain ([98.37.226.98]) by smtp.googlemail.com with ESMTPSA id e12-20020a63ae4c000000b0055b44a901absm2482813pgp.70.2023.08.14.05.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 05:56:40 -0700 (PDT) From: Andy Tai Date: Mon, 14 Aug 2023 05:56:37 -0700 Message-ID: <837e0362b70ffb44f87a9002306a0efc178cee79.1692017713.git.atai@atai.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (gpt4all-backend): New variable --- gnu/packages/machine-learning.scm | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) base-commit: b15381460ed74e72792ff182dd2ca7a06ba59b0c diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index c32180615b..7af7ba8b5f 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -4801,3 +4801,59 @@ (define-public oneapi-dnnl "OneAPI Deep Neural Network Library (oneDNN) is a cross-platform performance library of basic building blocks for deep learning applications.") (license license:asl2.0))) + + +(define-public gpt4all-backend + (let ((commit "108d950874e457ced4d5d1f0569dfb43bbd25734") + (version "0.3.0") + (revision "1")) + (package + (name "gpt4all-backend") + (version (git-version version revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nomic-ai/gpt4all") + (commit commit) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1x2w3x5abqkwjp043ijqfsmsm72783a245y5bri9bs1cpfyr0xyr")))) + (build-system cmake-build-system) + ;; (inputs (list llama-cpp)) + ;; TODO: when upstream supports using system installed llama-cpp, use it + (arguments + (list #:tests? #f ;no test target + #:configure-flags #~(list (string-append + "-DCMAKE_INSTALL_PREFIX=" + #$output)) + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (mkdir-p #$output) ;ensure it exists + (chdir "gpt4all-backend"))) + (add-after 'chdir 'fix-install-path + (lambda _ + (substitute* "CMakeLists.txt" + (("CMAKE_INSTALL_PREFIX") + "CMAKE_INSTALL_PREFIX_ignored")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out #$output) + (lib (string-append out "/lib"))) + (mkdir-p lib) + ;; Install the .so targets. + (for-each (lambda (file) + (install-file file lib)) + (find-files "." "\\.so")))))))) + (home-page "https://gpt4all.io/index.html") + (synopsis "C/C model backend used by GPT4All for inference on the CPU") + (description + "GPT4All backend acts as a universal library/wrapper for all models that +the GPT4All ecosystem supports. Language bindings are built on top of this universal +library. The native GPT4all Chat application directly uses this library for all +inference.") + (license license:expat)))) + +