-
I'm using gpt4all and chatgpt as backends. I discovered that the model I'm using with gpt4all (llama 3 8b instruct) needs a
chatgpt however doesn't want that value and responds with an http error if it's included. so i want to be able to include (use-package! gptel
:config
(setq! gptel-model 'Meta-Llama-3-8B-Instruct.Q4_0.gguf
gptel-backend (gptel-make-gpt4all "llama chat"
:protocol "http"
:host "localhost:4891"
:models '(Meta-Llama-3-8B-Instruct.Q4_0.gguf gpt-4o)
))
(defun my-gptel--request-data (original-fn backend prompts)
"Wrap ORIGINAL-FN to conditionally include min_p in the request data for BACKEND."
(let* ((data (funcall original-fn backend prompts))
(model (plist-get data :model)))
(when (string= model "Meta-Llama-3-8B-Instruct.Q4_0.gguf") ;; brittle and doesn't scale
(plist-put data :min_p 0.1))
data))
(advice-add 'gptel--request-data :around #'my-gptel--request-data)
) My ideas so far:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 12 replies
-
Thanks for bringing this up, this has been bothering me for a while. This feature is also needed by others, such as #330, #393. It's clear that we need a general way to do this. Adding variables like
(gptel-make-gpt4all "llama chat"
:protocol "http"
:host "localhost:4891"
:models '(Meta-Llama-3-8B-Instruct.Q4_0.gguf)
:params '(:min_p 0.1)) ;; <-- HERE
(gptel-make-gpt4all "llama chat"
:protocol "http"
:host "localhost:4891"
:models '((Meta-Llama-3-8B-Instruct.Q4_0.gguf :params '(:min_p 0.1)) ;; <-- HERE
gpt-4o))
What do you think? |
Beta Was this translation helpful? Give feedback.
-
I've added support for |
Beta Was this translation helpful? Give feedback.
I've added support for
:request-params
. Either of the above specifications (backend or model-specific configuration) should now work. Please test and let me know if it's satisfactory.