Compare commits

..

No commits in common. "45e530a9839a605b9d6b69062f5d48e7cd0a3ccb" and "ed44c92fc9985392f021f67f560f6d2927684a51" have entirely different histories.

5 changed files with 7 additions and 22 deletions

View file

@ -307,12 +307,11 @@
(defun list-ollama-models () (defun list-ollama-models ()
"Query the local Ollama server for the list of installed models." "Query the local Ollama server for the list of installed models."
(let* ((tags-buffer (url-retrieve-synchronously "http://ollama:11434/api/tags")) (condition-case error-var
(raw-response (with-current-buffer tags-buffer (buffer-string))) (mapcar #'intern (mapcar #'car (mapcar #'split-string (cdr (process-lines "podllama" "list")))))
(tags-payload (nth 1 (split-string raw-response "\n\n"))) (error
(models (gethash "models" (json-parse-string tags-payload))) (message "Failed to list local models: %s" error-var)
(model-names (mapcar (lambda (model) (gethash "name" model)) models))) ())))
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."
@ -331,12 +330,11 @@
;; keep-sorted end ;; keep-sorted end
:custom :custom
;; keep-sorted start ;; keep-sorted start
(gptel--system-message "You are a sassy, sharp-tongued personal assistant. I need you to assist me in crafting responses to questions, dripping with ascerbic wit and sarcasm.")
(gptel-backend (gptel-get-backend "Ollama")) (gptel-backend (gptel-get-backend "Ollama"))
(gptel-default-mode 'org-mode) (gptel-default-mode 'org-mode)
(gptel-expert-commands t) (gptel-expert-commands t)
(gptel-highlight-methods '(face margin)) (gptel-highlight-methods '(face margin))
(gptel-model 'hf.co/unsloth/Devstral-Small-2507-GGUF:latest) (gptel-model 'llama3.2:latest)
;; keep-sorted end ;; keep-sorted end
:preface :preface
(load "local-models.el") (load "local-models.el")
@ -345,7 +343,6 @@
:key 'gptel-api-key-from-auth-source :key 'gptel-api-key-from-auth-source
) )
(gptel-make-ollama "Ollama" (gptel-make-ollama "Ollama"
:host "ollama:11434"
:stream t :stream t
:models (enrich-ollama-models (list-ollama-models) gptel--local-models) :models (enrich-ollama-models (list-ollama-models) gptel--local-models)
) )

View file

@ -1,5 +1,3 @@
;; -*- lexical-binding: t; -*-
(defconst gptel--local-models (defconst gptel--local-models
'( '(
;; keep-sorted start ;; keep-sorted start
@ -20,11 +18,6 @@
:context-window 32 :context-window 32
:cutoff-date "2023-10" :cutoff-date "2023-10"
) )
(
hf.co/unsloth/Devstral-Small-2507-GGUF:latest
:description "Agentic LLM for software engineering tasks"
:context-window 128
)
( (
llama3.2:latest llama3.2:latest
:description "Instruction-tuned model optimized for multilingual dialogue" :description "Instruction-tuned model optimized for multilingual dialogue"

View file

@ -1,3 +0,0 @@
# keep-sorted start
HOSTALIASES=~/.config/hosts
# keep-sorted end

View file

@ -1 +0,0 @@
ollama localhost

View file

@ -8,9 +8,8 @@ podman --transient-store run --rm -ti \
--env XDG_RUNTIME_DIR=/tmp \ --env XDG_RUNTIME_DIR=/tmp \
--hostname localhost \ --hostname localhost \
--mount type=bind,source="${XDG_RUNTIME_DIR}"/"${WAYLAND_DISPLAY}",target=/tmp/"${WAYLAND_DISPLAY}" \ --mount type=bind,source="${XDG_RUNTIME_DIR}"/"${WAYLAND_DISPLAY}",target=/tmp/"${WAYLAND_DISPLAY}" \
--mount type=bind,source="$(systemd-path user-configuration)"/emacs/site-lisp/local-models.el,target=/root/.config/emacs/site-lisp/local-models.el \
--mount type=bind,readonly=true,source="$(systemd-path user)"/.keys/vaults,target=/root/.age/key \ --mount type=bind,readonly=true,source="$(systemd-path user)"/.keys/vaults,target=/root/.age/key \
--mount type=bind,readonly=true,source="$(systemd-path user)"/.keys/vaults.pub,target=/root/.age/key.pub \ --mount type=bind,readonly=true,source="$(systemd-path user)"/.keys/vaults.pub,target=/root/.age/key.pub \
--mount type=bind,source="$(systemd-path user)"/Vaults,target=/root/Vaults \ --mount type=bind,source="$(systemd-path user)"/Vaults,target=/root/Vaults \
--network systemd-ollama \ --network none \
vaulter:latest vaulter:latest