Compare commits

..

3 commits

3 changed files with 16 additions and 6 deletions

View file

@ -318,7 +318,7 @@
(tags-payload (nth 1 (split-string raw-response "\n\n")))
(models (gethash "models" (json-parse-string tags-payload)))
(model-names (mapcar (lambda (model) (gethash "name" model)) models)))
model-names))
(mapcar #'intern model-names)))
(defun enrich-ollama-models (available library)
"Enrich the available models with metadata from the library of known models."
@ -327,6 +327,12 @@
(seq-find (lambda (x) (eq (car x) model)) library model))
available))
(defun generate-ollama-declaration ()
(gptel-make-ollama "Ollama"
:host "ollama:11434"
:stream t
:models (enrich-ollama-models (list-ollama-models) gptel--local-models)))
(use-package gptel
:hook
;; keep-sorted start
@ -350,11 +356,7 @@
:stream t
:key 'gptel-api-key-from-auth-source
)
(gptel-make-ollama "Ollama"
:host "ollama:11434"
:stream t
:models (enrich-ollama-models (list-ollama-models) gptel--local-models)
)
(generate-ollama-declaration)
)
(use-package power-mode)

View file

@ -3,6 +3,12 @@
(defconst gptel--local-models
'(
;; keep-sorted start
(
gemma3:latest
:description "A model from Google built on Gemini technology"
:context-window 128
:cutoff-date "2024-08"
)
(
hf.co/Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF:latest
:description "Uncensored model based on Llama-3.1-8b-Instruct"

View file

@ -53,3 +53,5 @@ fi
pod_id=$("${PODMAN[@]}" run --detach --rm "${MOUNTS[@]}" "${NETWORK[@]}" ollama:latest)
"${PODMAN[@]}" exec --interactive --tty "${pod_id}" ollama "$@"
"${PODMAN[@]}" kill "${pod_id}" > /dev/null
emacsclient --eval "(generate-ollama-declaration)"