Compare commits

..

No commits in common. "1b7fb23a2e89cc14ae13b217209812f8c57831f0" and "e7bd7fc24f007a7a58e1d6c03eba4d7d3a3495cb" have entirely different histories.

3 changed files with 6 additions and 16 deletions

View file

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

View file

@ -3,12 +3,6 @@
(defconst gptel--local-models (defconst gptel--local-models
'( '(
;; keep-sorted start ;; 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 hf.co/Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF:latest
:description "Uncensored model based on Llama-3.1-8b-Instruct" :description "Uncensored model based on Llama-3.1-8b-Instruct"

View file

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