Emacs salmagundi, gptel setup, 2026-12-04
gptel and presets
For a while now I've included a rather bad configuration of gptel in my Emacs
setup. For various reasons I'm not a big user of AI, I simply doesn't find it
very interesting. I've tried a few LLMs, and each time I want to try a new one
I've commented out the previous setting of gptel-backend and added a new one.
I just couldn't be bothered doing something more organised. This morning I found
I had 3 such settings commented out, and a 4th one that was active. It was time
to bring some order so this morning I finally dug into gptel-make-preset.
I settled on having one gptel-make-<llm name> and one gptel-make-preset per
(working) model, like this:
(gptel-make-openai "Ergo 1.0"
:host "bedrock-runtime.eu-north-1.amazonaws.com"
:endpoint "/openai/v1/chat/completions"
:key #'gptel-api-key-from-auth-source
:stream t
:models '("global.amazon.ergo-1.0"))
(gptel-make-preset 'ergo
:description "Ergo 1.0 on Bedrock"
:backend "Ergo 1.0"
:model 'global.amazon.ergo-1.0)
and then I set the initial model/backend like this
(setopt
gptel-model 'global.amazon.ergo-1.0
gptel-backend (gptel-get-backend "Ergo 1.0"))
With this I can now choose between the models in gptel's menu. Now I just have to see if this makes any difference at all in my daily activities.
gptel and tools (web search)
I've found that one way of dealing with the limits in an LLM's training data is to make use of a web search tool. Just recently I tried working out some details in our Keycloak config, but with plain gptel it failed. At the time I resorted to use the search assistant in DuckDuckGo, but I'd seen that gptel has tool support so I thought I'd see if I can find a web search tool for it.
It turns out that gptel-agent, from the same author as gptel, includes web search. It was also rather simple to set up
(use-package gptel-agent
:after gptel
:config
(gptel-agent-update))
I added a binding to gptel-agent as well and now I have a bunch of tools
available. So far I've only taken advantage of the web search though.