From ae8623f7ed1dd2a6e616c669b12d89a3bc0cdd93 Mon Sep 17 00:00:00 2001 From: larstvei Date: Fri, 7 Jun 2024 22:33:48 +0200 Subject: [PATCH] Use llama3 with gptel --- init.org | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/init.org b/init.org index 509347c..1528377 100644 --- a/init.org +++ b/init.org @@ -1248,7 +1248,7 @@ mu4e-use-fancy-chars t)) #+end_src -* ChatGPT +* LLM The ChatGPT client [[https://github.com/karthink/gptel][gptel]] needs an API key from the OpenAI API. This key can be stored in your ~.authinfo~ file by adding a line like this: @@ -1261,16 +1261,20 @@ Then the ~gptel-api-key~ can be set using auth source. + Default to using llama3, a local LLM. + #+begin_src emacs-lisp - ;; Interaction mode for ChatGPT (use-package gptel :defer t :hook ((gptel-mode . (lambda () (visual-line-mode 1))) (gptel-mode . (lambda () (auto-fill-mode 0)))) - :init - (setq gptel-default-mode 'org-mode - gptel-model "gpt-4" + :config + (setq gptel-backend (gptel-make-ollama "Ollama" + :host "localhost:11434" + :stream t + :models '("llama3")) + gptel-model "llama3" gptel-api-key (auth-source-pick-first-password :host "api.openai.com")))