Enrich the Ollama models list with metadata for known models

This commit is contained in:
Ohad Livne 2025-11-17 00:17:26 +02:00
parent 7998f20d52
commit d187c19d71
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D

View file

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