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:
parent
d40b7d85f5
commit
726071645d
1 changed files with 25 additions and 14 deletions
|
@ -237,7 +237,7 @@
|
||||||
(defvar categories-alist
|
(defvar categories-alist
|
||||||
'(
|
'(
|
||||||
(:name "org" :modes (org-mode org-agenda-mode) :buffer-name () :type global)
|
(: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 "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 (+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)
|
(: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)))))
|
(string-trim (buffer-substring-no-properties (point-min) (point-max)))))
|
||||||
|
|
||||||
|
|
||||||
|
;; Default Model
|
||||||
|
;; TODO Consider switching to coder
|
||||||
(setq! gptel-backend
|
(setq! gptel-backend
|
||||||
(gptel-make-openai "llama-cpp"
|
(gptel-make-openai "llama-cpp"
|
||||||
:stream t
|
:stream t
|
||||||
:protocol "http"
|
:protocol "http"
|
||||||
:host "100.64.0.3:18083"
|
:host "100.64.0.3:18083"
|
||||||
:models '("llama-cpp-model")))
|
:models '("llama-cpp-biggerchat")))
|
||||||
(setq! gptel-model "llama-cpp-model")
|
(setq! gptel-model "llama-cpp-biggerchat")
|
||||||
|
|
||||||
(setq! gptel-directives '((default
|
;; Qwen-2.5-Coder-32B / Tabby model
|
||||||
. "You are a large language model living in Emacs and a helpful assistant. Respond concisely.")
|
(gptel-make-openai "llama-cpp-code"
|
||||||
(programming
|
:stream t
|
||||||
. "You are a large language model and a careful programmer. Provide code and only code as output without any additional text, prompt or note.")
|
:protocol "http"
|
||||||
(writing
|
:host "100.64.0.3:18080"
|
||||||
. "You are a large language model and a writing assistant. Respond concisely.")
|
:models '("codechat"))
|
||||||
(chat
|
|
||||||
. "You are a large language model and a conversation partner. Respond concisely.")))
|
|
||||||
(setq! gptel-expert-commands t)
|
|
||||||
(setq! gptel-temperature 0.2)
|
|
||||||
|
|
||||||
|
;; Groq API
|
||||||
(gptel-make-openai "groq"
|
(gptel-make-openai "groq"
|
||||||
:host "api.groq.com"
|
:host "api.groq.com"
|
||||||
:endpoint "/openai/v1/chat/completions"
|
:endpoint "/openai/v1/chat/completions"
|
||||||
|
@ -350,6 +349,18 @@
|
||||||
"llama3-8b-8192"))
|
"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-response-functions 'gptel-end-of-response)
|
||||||
(add-hook 'gptel-post-stream-hook 'gptel-auto-scroll)
|
(add-hook 'gptel-post-stream-hook 'gptel-auto-scroll)
|
||||||
|
|
||||||
|
@ -440,7 +451,7 @@
|
||||||
(forward-char)))
|
(forward-char)))
|
||||||
|
|
||||||
(use-package! tabby
|
(use-package! tabby
|
||||||
:hook (prog-mode . tabby-mode)
|
:hook (rustic-mode . tabby-mode)
|
||||||
:init
|
:init
|
||||||
(setq tabby-idle-delay 0.5)
|
(setq tabby-idle-delay 0.5)
|
||||||
(setq tabby--connection "http://100.64.0.3:8083")
|
(setq tabby--connection "http://100.64.0.3:8083")
|
||||||
|
|
Loading…
Add table
Reference in a new issue