diff --git a/.config/containers/systemd/ollama.container b/.config/containers/systemd/ollama.container new file mode 100644 index 0000000..6ae7f6c --- /dev/null +++ b/.config/containers/systemd/ollama.container @@ -0,0 +1,20 @@ +[Unit] +Description=A local LLM server + +[Container] +# keep-sorted start +ContainerName=ollama +Image=docker.io/ollama/ollama:latest +Network=ollama.network +PublishPort=11434:11434 +Volume=%h/.local/share/ollama:/root/.ollama:ro,z +# keep-sorted end + +[Install] +WantedBy=multi-user.target + +[Service] +# keep-sorted start +ExecStartPre=mkdir -p %h/.local/share/ollama +Restart=always +# keep-sorted end diff --git a/.config/containers/systemd/ollama.network b/.config/containers/systemd/ollama.network new file mode 100644 index 0000000..5f8c30b --- /dev/null +++ b/.config/containers/systemd/ollama.network @@ -0,0 +1,5 @@ +[Unit] +Description=Isolated network for my local LLM server + +[Network] +Internal=true diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 0be5a4f..e3a988b 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -307,17 +307,29 @@ ) (use-package gptel + :hook + ; keep-sorted start + (gptel-mode . gptel-highlight-mode) + (gptel-mode . visual-line-mode) + (gptel-post-response . gptel-end-of-response) + (gptel-post-stream . gptel-auto-scroll) + ; keep-sorted end :custom ; keep-sorted start - (gptel-backend (gptel-get-backend "Claude")) + (gptel-backend (gptel-get-backend "Ollama")) (gptel-default-mode 'org-mode) - (gptel-model 'claude-3-5-haiku-20241022) + (gptel-highlight-methods '(face margin)) + (gptel-model 'llama3.2:latest) ; keep-sorted end :preface (gptel-make-anthropic "Claude" :stream t :key 'gptel-api-key-from-auth-source ) + (gptel-make-ollama "Ollama" + :stream t + :models '(llama3.2:latest) + ) ) (use-package power-mode) diff --git a/.config/emacs/transient/values.el b/.config/emacs/transient/values.el index c77d63e..e9662fa 100644 --- a/.config/emacs/transient/values.el +++ b/.config/emacs/transient/values.el @@ -2,6 +2,7 @@ ; keep-sorted start (magit-commit "--gpg-sign=") (magit-diff:magit-revision-mode "--no-ext-diff" "--stat" "--show-signature") + (magit-fetch "--force" "--prune" "--tags") (magit-log:magit-log-mode "-n256" "--graph" "--decorate" "--show-signature") (magit-merge "--gpg-sign=") (magit-tag "--sign") diff --git a/.config/mimeapps.list b/.config/mimeapps.list index ff1ce92..ddbdff7 100644 --- a/.config/mimeapps.list +++ b/.config/mimeapps.list @@ -10,6 +10,8 @@ application/xhtml+xml=userapp-Firefox-RJEWT1.desktop application/x-extension-xhtml=userapp-Firefox-RJEWT1.desktop application/x-extension-xht=userapp-Firefox-RJEWT1.desktop x-scheme-handler/magnet=userapp-transmission-gtk-BAUQU2.desktop +audio/ogg=mpv.desktop; +audio/x-opus+ogg=mpv.desktop; [Added Associations] x-scheme-handler/http=userapp-Firefox-RJEWT1.desktop; diff --git a/.local/bin/llm-import-model b/.local/bin/llm-import-model new file mode 100755 index 0000000..ffd2c6c --- /dev/null +++ b/.local/bin/llm-import-model @@ -0,0 +1,9 @@ +#! /usr/bin/bash + +set -euo pipefail +IFS=$'\n\t' + +mkdir --parents ~/.local/share/ollama/ +pod_id=$(podman run --detach --rm --volume ~/.local/share/ollama/:/root/.ollama ollama:latest) +podman exec --interactive --tty "${pod_id}" ollama pull "${1}" +podman kill "${pod_id}"