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) ) )