Enrich the Ollama models list with metadata for known models
This commit is contained in:
parent
7998f20d52
commit
d187c19d71
1 changed files with 9 additions and 1 deletions
|
|
@ -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)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue