Make Ollama config pull models dynamically
This commit is contained in:
parent
6448c9f70e
commit
ae4178f270
@ -39,12 +39,22 @@
|
|||||||
:stream t
|
:stream t
|
||||||
:models '("gpt-4o"
|
:models '("gpt-4o"
|
||||||
"gpt-4o-mini")))
|
"gpt-4o-mini")))
|
||||||
(defvar gptel-backend-ollama (gptel-make-ollama "Ollama"
|
(defun ollama-models ()
|
||||||
:stream t
|
(if (executable-find "ollama")
|
||||||
:models '("llama3.1:latest"
|
(->> (shell-command-to-string "ollama list")
|
||||||
|
(s-lines)
|
||||||
|
(cdr)
|
||||||
|
(mapcar (lambda (line)
|
||||||
|
(let ((parts (s-split-up-to " " line 1 t)))
|
||||||
|
(car parts))))
|
||||||
|
(-filter #'s-present?))
|
||||||
|
(list "llama3.1:latest"
|
||||||
"mistral-nemo:latest"
|
"mistral-nemo:latest"
|
||||||
"gemma2:2b"
|
"gemma2:2b"
|
||||||
"tinyllama:latest")))
|
"tinyllama:latest")))
|
||||||
|
(defvar gptel-backend-ollama (gptel-make-ollama "Ollama"
|
||||||
|
:stream t
|
||||||
|
:models (ollama-models)))
|
||||||
(defvar gptel-backend-anthropic (gptel-make-anthropic "Claude"
|
(defvar gptel-backend-anthropic (gptel-make-anthropic "Claude"
|
||||||
:stream t
|
:stream t
|
||||||
:key (password-store-get "anthropic-api-key")))
|
:key (password-store-get "anthropic-api-key")))
|
||||||
|
Loading…
Reference in New Issue
Block a user