Start using Karthik's lovely GPTel package

This commit is contained in:
TEC 2024-03-21 17:16:36 +08:00
parent 9f0fa37d4c
commit 259ab2b3a5
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 26 additions and 0 deletions

View File

@ -3668,6 +3668,32 @@ the mode on startup, let's prevent installation of the package.
(package! evil-escape :disable t)
#+end_src
*** GPTel
#+call: confpkg("!Pkg gptel")
#+begin_src emacs-lisp :tangle packages.el
(package! gptel :pin "9eea4be5ed9c7a651619347f6b3191d083ec252e")
#+end_src
#+begin_src emacs-lisp
(use-package! gptel
:commands gptel gptel-menu gptel-mode gptel-send gptel-set-tpic
:config
(let (ollama-models)
(when (executable-find "ollama")
(with-temp-buffer
(call-process "ollama" nil t nil "list")
(goto-char (point-min))
(forward-line 1)
(while (and (not (eobp)) (looking-at "[^ \t]+"))
(push (match-string 0) ollama-models)
(forward-line 1))))
(setq-default gptel-model "nous-hermes2:latest"
gptel-backend (gptel-make-ollama "Ollama" :models ollama-models :stream t)))
(setq gptel-default-mode #'org-mode))
#+end_src
*** Consult
#+call: confpkg("!Pkg Consult")