refactor: Refactor gptel config

- Set default model to "llama-cpp-biggerchat"
- Rework configurations for "llama-cpp-code" and "groq"
- Update buffer names in categories-alist
- Change tabby hook from prog-mode to rustic-mode only for now
This commit is contained in:
Tristan D. 2024-11-26 18:18:23 +01:00
parent d40b7d85f5
commit 726071645d
Signed by: tristan
SSH key fingerprint: SHA256:9oFM1J63hYWJjCnLG6C0fxBS15rwNcWwdQNMOHYKJ/4

View file

@ -237,7 +237,7 @@
(defvar categories-alist
'(
(:name "org" :modes (org-mode org-agenda-mode) :buffer-name () :type global)
(:name "gptel" :modes nil :buffer-name ("*llama-cpp*" "*gptel*" "*groq*" "*gptel-context*" "*gptel-query*") :type global)
(:name "gptel" :modes nil :buffer-name ("*llama-cpp*" "*llama-cpp-code*" "*llama-cpp-bigchat*" "*llama-cpp-biggerchat*" "*gptel*" "*groq*" "*gptel-context*" "*gptel-query*") :type global)
(:name "terminal" :modes (vterm-mode term-mode) :buffer-name () :type per-project)
(:name "misc" :modes (+doom-dashboard-mode native-comp-limple-mode messages-buffer-mode) :buffer-name () :type global)
(:name "misc" :modes (special-mode fundamental-mode) :buffer-name () :type per-project)
@ -321,25 +321,24 @@
(string-trim (buffer-substring-no-properties (point-min) (point-max)))))
;; Default Model
;; TODO Consider switching to coder
(setq! gptel-backend
(gptel-make-openai "llama-cpp"
:stream t
:protocol "http"
:host "100.64.0.3:18083"
:models '("llama-cpp-model")))
(setq! gptel-model "llama-cpp-model")
:models '("llama-cpp-biggerchat")))
(setq! gptel-model "llama-cpp-biggerchat")
(setq! gptel-directives '((default
. "You are a large language model living in Emacs and a helpful assistant. Respond concisely.")
(programming
. "You are a large language model and a careful programmer. Provide code and only code as output without any additional text, prompt or note.")
(writing
. "You are a large language model and a writing assistant. Respond concisely.")
(chat
. "You are a large language model and a conversation partner. Respond concisely.")))
(setq! gptel-expert-commands t)
(setq! gptel-temperature 0.2)
;; Qwen-2.5-Coder-32B / Tabby model
(gptel-make-openai "llama-cpp-code"
:stream t
:protocol "http"
:host "100.64.0.3:18080"
:models '("codechat"))
;; Groq API
(gptel-make-openai "groq"
:host "api.groq.com"
:endpoint "/openai/v1/chat/completions"
@ -350,6 +349,18 @@
"llama3-8b-8192"))
(setq! gptel-directives '((default
. "You are a large language model living in Emacs and a helpful assistant. Respond concisely.")
(programming
. "You are a large language model and a careful programmer. Provide code and only code as output without any additional text, prompt or note.")
(writing
. "You are a large language model and a writing assistant. Respond concisely.")
(chat
. "You are a large language model and a conversation partner. Respond concisely."))
gptel-expert-commands t
gptel-temperature 0.2)
(add-hook 'gptel-post-response-functions 'gptel-end-of-response)
(add-hook 'gptel-post-stream-hook 'gptel-auto-scroll)
@ -440,7 +451,7 @@
(forward-char)))
(use-package! tabby
:hook (prog-mode . tabby-mode)
:hook (rustic-mode . tabby-mode)
:init
(setq tabby-idle-delay 0.5)
(setq tabby--connection "http://100.64.0.3:8083")