3 ms·
Can you describe your setup on how you use LLMs within Emacs?
by mimischi 5mo ago
Can you describe your setup on how you use LLMs within Emacs?
- iLemming 5mo agoOf course. I've tried different AI packages and currently gptel and ECA remain the main ingredients. This is a quickly changing landscape, and things may change, but for now it feels very good. I like gptel because it's enormously extendable and exploitable - it allows me to send LLM requests from just about anywhere - I could be typing a message (like this very one) and suddenly in need of ideas for how to phrase something better, or explain simply, or fact-check my assumptions, whatever. Quick & dirty interaction that gets discarded in the same buffer. For longer investigations and research I would use a dedicated gptel buffer. Those get automatically saved. I don't use gptel as a coding assistant, even though you can do that, it's not really optimized for that kind of work. I use ECA. It works much better for me than every other alternative I tried, and I tried more than a few. What's crazy that I sometimes would type a prompt in ECA, then ask gptel (with a different model) to make it more "AI-friendly" changing the prompt in-place and then send it. All my MCPs are coded in Clojure (mostly babashka)¹ - because (like I said) giving an AI a Lisp REPL makes much more sense (maybe even more than using a statically typed language). I had to employ a few tricks so all the tools, skills and instructions can be shared between gptel, eca-emacs, ECA Desktop, Claude Code CLI, Claude Desktop App, and Copilot CLI. Even though I mostly use gptel and ECA, it's good to keep other options around, just in case. All the AI-related Emacs settings are in my config². Is this helpful, or you want some more concrete examples? — ¹ https://github.com/agzam/death-contraptions https://github.com/agzam/death-contraptions ² https://github.com/agzam/.doom.d/tree/main/modules/custom/ai https://github.com/agzam/.doom.d/tree/main/modules/custom/ai
- pandakar 5mo agoThis is good stuff :) Honestly, I am having a lot of fun just using org mode files as prompts and eventually output for a Claude Code instance in vterm. All these files get saved with the output and magit is of course amazing, just good affordances and history keeping.
- iLemming 5mo ago(setopt gptel-default-mode 'org-mode) For persistence: https://github.com/agzam/.doom.d/blob/main/modules/custom/ai/autoload/gptel.el#L360 https://github.com/agzam/.doom.d/blob/main/modules/custom/ai...
- zingar 5mo agoI’d like a concrete example on how you’re actually controlling emacs with LLMs. Is ECA the part that does that?
- iLemming 5mo agogptel has the built-in elisp eval tool. ECA doesn't have it built-in, I use my custom MCP (I posted the link in the comment above).