Query the Ollama server for the list of installed models
This commit is contained in:
parent
75ed82967c
commit
73463a241f
1 changed files with 9 additions and 1 deletions
|
|
@ -306,6 +306,14 @@
|
|||
auto-mode-alist))
|
||||
)
|
||||
|
||||
(defun list-ollama-models ()
|
||||
"Query the local Ollama server for the list of installed models"
|
||||
(condition-case error-var
|
||||
(mapcar #'intern (mapcar #'car (mapcar #'split-string (cdr (process-lines "podllama" "list")))))
|
||||
(error
|
||||
(message "Failed to list local models: %s" error-var)
|
||||
())))
|
||||
|
||||
(use-package gptel
|
||||
:hook
|
||||
; keep-sorted start
|
||||
|
|
@ -328,7 +336,7 @@
|
|||
)
|
||||
(gptel-make-ollama "Ollama"
|
||||
:stream t
|
||||
:models '(llama3.2:latest)
|
||||
:models (list-ollama-models)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue