From d187c19d7192221a9b89cbb7194ca7cd3e206778 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Mon, 17 Nov 2025 00:17:26 +0200 Subject: [PATCH] Enrich the Ollama models list with metadata for known models --- .config/emacs/init.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 5a0c5b2..5a3e8cb 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -313,6 +313,13 @@ (message "Failed to list local models: %s" error-var) ()))) +(defun enrich-ollama-models (available library) + "Enrich the available models with metadata from the library of known models." + (mapcar + (lambda (model) + (seq-find (lambda (x) (eq (car x) model)) library model)) + available)) + (use-package gptel :hook ;; keep-sorted start @@ -330,13 +337,14 @@ (gptel-model 'llama3.2:latest) ;; keep-sorted end :preface + (load "local-models.el") (gptel-make-anthropic "Claude" :stream t :key 'gptel-api-key-from-auth-source ) (gptel-make-ollama "Ollama" :stream t - :models (list-ollama-models) + :models (enrich-ollama-models (list-ollama-models) gptel--local-models) ) )