Query the Ollama server for the list of installed models
This commit is contained in:
parent
75ed82967c
commit
7699aa4084
1 changed files with 9 additions and 1 deletions
|
|
@ -306,6 +306,14 @@
|
||||||
auto-mode-alist))
|
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
|
(use-package gptel
|
||||||
:hook
|
:hook
|
||||||
; keep-sorted start
|
; keep-sorted start
|
||||||
|
|
@ -328,7 +336,7 @@
|
||||||
)
|
)
|
||||||
(gptel-make-ollama "Ollama"
|
(gptel-make-ollama "Ollama"
|
||||||
:stream t
|
:stream t
|
||||||
:models '(llama3.2:latest)
|
:models (list-ollama-models)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue