unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andy Tai <atai@atai.org>
To: 65287@debbugs.gnu.org
Cc: Andy Tai <atai@atai.org>
Subject: [bug#65287] [PATCH v2] gnu: Add gpt4all-backend
Date: Mon, 14 Aug 2023 05:56:37 -0700	[thread overview]
Message-ID: <837e0362b70ffb44f87a9002306a0efc178cee79.1692017713.git.atai@atai.org> (raw)
In-Reply-To: <b7d71736646f8ef8bc2ace7bd9cc392b313abd14.1692014931.git.atai@atai.org>

* gnu/packages/machine-learning.scm (gpt4all-backend): New variable
---
 gnu/packages/machine-learning.scm | 56 +++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

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))))
+
+

base-commit: b15381460ed74e72792ff182dd2ca7a06ba59b0c
-- 
2.41.0





  reply	other threads:[~2023-08-14 12:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 12:09 [bug#65287] [PATCH] gnu: Add gpt4all-backend Andy Tai
2023-08-14 12:56 ` Andy Tai [this message]
2023-08-14 13:00 ` [bug#65287] [PATCH v3] " Andy Tai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837e0362b70ffb44f87a9002306a0efc178cee79.1692017713.git.atai@atai.org \
    --to=atai@atai.org \
    --cc=65287@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).