From 4c09ef735dd204199e72dab66f2b604856e66a67 Mon Sep 17 00:00:00 2001 From: bd Date: Mon, 13 Oct 2025 00:08:12 -0400 Subject: Set default system-directive, turn off thinking for gptel --- .config/emacs/modules/bd--chat.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.config/emacs/modules/bd--chat.el b/.config/emacs/modules/bd--chat.el index 41a9262..dc093f4 100644 --- a/.config/emacs/modules/bd--chat.el +++ b/.config/emacs/modules/bd--chat.el @@ -60,13 +60,14 @@ channel, which is issuing the PART command." (use-package gptel :bind (("C-c g" . gptel-menu) - ("C-c C-g" . (lambda () (interactive) (gptel "*evka*") (switch-to-buffer "*evka*")))) + ("C-c C-t" . (lambda () (interactive) (gptel "*evka*") (switch-to-buffer "*evka*")))) :config (defvar bd/llama-cpp-buffer-name "*llama-cpp-proc*") (defvar bd/llama-cpp-reasoning-buffer-name "*llama-cpp-reasoning*") (defvar bd/llama-cpp-port "4568") (defvar bd/llama-cpp-threads "8") - (defvar bd/llama-cpp-model-file "Qwen3-4B-Q4_K_M.gguf") + (defvar bd/llama-cpp-model-file "Qwen3-4B.Q5_K_M.gguf") + ;; most models seem to ignore this, or llama-cpp doesn't add /no_think like it's supposed to (defvar bd/llama-cpp-reasoning-budget nil) (defun bd/gptel-start-backend () (interactive) @@ -99,6 +100,9 @@ channel, which is issuing the PART command." (bd/gptel-start-backend) + (add-to-list 'gptel-directives + '(evka . "You are a wolf (furry) named Evka hired as a secretary to complete language-based tasks. First describe an action your character does, e.x.: *I tap my claws on the desk*. Finish by responding to the task as tersely as possible, in character./no_think")) + (setopt gptel-model 'qwen-4b gptel-backend (gptel-make-openai "llama-cpp" :stream t @@ -106,10 +110,8 @@ channel, which is issuing the PART command." :host (concat "localhost:" bd/llama-cpp-port) :models '(qwen-4b)) gptel-max-tokens 500 - gptel-include-reasoning bd/llama-cpp-reasoning-buffer-name) - - (gptel-make-preset 'default - :system "You are a wolf (furry) named Evka hired as a secretary to complete language-based tasks. Keep the thinking stage brief. First describe an action your character does, e.x.: *I tap my claws on the desk*. Finish by responding to the task as tersely as possible, in character.")) + gptel--system-message (alist-get 'evka gptel-directives) + gptel-include-reasoning bd/llama-cpp-reasoning-buffer-name)) (provide 'bd--chat) -- cgit v1.2.3