<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ollama-Buddy on Emacs@ Dyerdwelling</title><image><url/><title>Ollama-Buddy on Emacs@ Dyerdwelling</title><link>https://www.emacs.dyerdwelling.family/tags/ollama-buddy/</link><width>32</width><height>32</height></image><link>https://www.emacs.dyerdwelling.family/tags/ollama-buddy/</link><description>Recent content in Ollama-Buddy on Emacs@ Dyerdwelling</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>captainflasmr@gmail.com (James Dyer)</managingEditor><webMaster>captainflasmr@gmail.com (James Dyer)</webMaster><lastBuildDate>Wed, 04 Mar 2026 09:34:00 +0000</lastBuildDate><atom:link href="https://www.emacs.dyerdwelling.family/tags/ollama-buddy/index.xml" rel="self" type="application/rss+xml"/><item><title>Ollama Buddy - Web Search Integration</title><link>https://www.emacs.dyerdwelling.family/emacs/20260212142000-emacs--web-search-integration-in-ollama-buddy/</link><pubDate>Wed, 04 Mar 2026 09:34:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20260212142000-emacs--web-search-integration-in-ollama-buddy/</guid><description>&lt;p>One of the fundamental limitations of local LLMs is their knowledge cutoff - they don&amp;rsquo;t know about anything that happened after their training data ended. The new web search integration in &lt;a href="https://github.com/captainflasmr/ollama-buddy">ollama-buddy&lt;/a> solves this by fetching current information from the web and injecting it into your conversation context. Ollama has a specific API web search section, so it has now been activated!&lt;/p>
&lt;p>Here is a demonstration:&lt;/p>
&lt;p>&lt;a href="https://www.youtube.com/watch?v=05VzAajH404">https://www.youtube.com/watch?v=05VzAajH404&lt;/a>&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;p>The web search feature implements a multi-stage pipeline that transforms search queries into clean, LLM-friendly context, your search query is sent to Ollama&amp;rsquo;s Web Search API, the API returns structured search results with URLs and snippets.&lt;/p>
&lt;p>I have decided that each URL by default is fetched and processed through Emacs&amp;rsquo; built-in &lt;code>eww&lt;/code> and &lt;code>shr&lt;/code> HTML rendering, but this can of course be configured, set &lt;code>ollama-buddy-web-search-content-source&lt;/code> to control how content is retrieved:&lt;/p>
&lt;ul>
&lt;li>`eww&amp;rsquo; (default): Fetch each URL and render through eww/shr for clean text&lt;/li>
&lt;li>`api&amp;rsquo;: Use content returned directly from Ollama API (faster, less refined)&lt;/li>
&lt;/ul>
&lt;p>The &lt;code>shr&lt;/code> (Simple HTML Renderer) library does an excellent job of converting HTML to readable plain text, stripping ads, navigation, and other noise, so I thought why not just use this rather than the return results from the ollama API, as they didn&amp;rsquo;t seem to be particularly accurate.&lt;/p>
&lt;p>The cleaned text is formatted with org headings showing the source URL and attached to your conversation context, so when you send your next prompt, the search results are automatically included in the context. The LLM can now reason about current information as if it had this knowledge all along.&lt;/p>
&lt;p>There are multiple ways to search; firstly, is inline &lt;code>@search()&lt;/code> syntax in your prompts (gradually expanding the inline prompting language!), so for example:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">What are the key improvements in @search(Emacs 31 new features)?
Compare @search(Rust async programming) with @search(Go concurrency model)
&lt;/code>&lt;/pre>&lt;p>ollama-buddy automatically detects these markers, executes the searches, attaches the results, and then sends your prompt, so you can carry out multiple searches.&lt;/p>
&lt;p>You can also manual Search and Attach, Use &lt;code>C-c / a&lt;/code> (or &lt;code>M-x ollama-buddy-web-search-attach&lt;/code>)&lt;/p>
&lt;p>The search executes, results are attached to your session, and the &lt;code>♁1&lt;/code> indicator appears in the header line and the results can be viewed from the attachments menu, so for example would display something like:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>* Web Searches (1)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>** latest Emacs 31 features
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>*** 1. Hide Minor Modes in the Modeline in Emacs 31
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>*** 2. New Window Commands For Emacs 31
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>*** 3. Latest version of Emacs (GNU Emacs FAQ)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>*** 4. bug#74145: 31.0.50; Default lexical-binding to t
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>*** 5. New in Emacs 30 (GNU Emacs FAQ)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>with each header foldable, containing the actual search results.&lt;/p>
&lt;p>There is a little configuration required to go through the ollama API, first, get an API key from &lt;a href="https://ollama.com/settings/keys">https://ollama.com/settings/keys&lt;/a> (it&amp;rsquo;s free). Then configure:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(use-package ollama-buddy
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :bind
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c o&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-role-transient-menu)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c O&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-transient-menu-wrapper)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :custom
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">;; Required: Your Ollama web search API key&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-web-search-api-key &lt;span style="color:#e6db74">&amp;#34;your-api-key-here&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For clarification, the content source options are as follows:&lt;/p>
&lt;p>The &lt;code>ollama-buddy-web-search-content-source&lt;/code> variable controls how content is retrieved:&lt;/p>
&lt;p>&lt;strong>&lt;code>eww&lt;/code> (default, recommended)&lt;/strong>&lt;/p>
&lt;p>Fetches each URL and renders HTML through Emacs&amp;rsquo; eww/shr. Produces cleaner, more complete content but requires additional HTTP requests.&lt;/p>
&lt;p>Pros:&lt;/p>
&lt;ul>
&lt;li>Much cleaner text extraction&lt;/li>
&lt;li>Full page content, not just snippets&lt;/li>
&lt;li>Removes ads, navigation, clutter&lt;/li>
&lt;li>Works with any website&lt;/li>
&lt;/ul>
&lt;p>Cons:&lt;/p>
&lt;ul>
&lt;li>Slightly slower (additional HTTP requests)&lt;/li>
&lt;li>Requires network access for each URL&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>&lt;code>api&lt;/code> (experimental)&lt;/strong>&lt;/p>
&lt;p>Uses content returned directly from the Ollama API without fetching individual URLs. Faster but content quality depends on what the API provides.&lt;/p>
&lt;p>Pros:&lt;/p>
&lt;ul>
&lt;li>Faster (single API call)&lt;/li>
&lt;li>Less network traffic&lt;/li>
&lt;/ul>
&lt;p>Cons:&lt;/p>
&lt;ul>
&lt;li>Content may be truncated&lt;/li>
&lt;li>Quality varies by source&lt;/li>
&lt;li>May miss important context&lt;/li>
&lt;/ul>
&lt;p>I strongly recommend sticking with &lt;code>eww&lt;/code> - the quality difference is substantial.&lt;/p>
&lt;p>By default, web search fetches up to 5 URLs with 2000 characters per result. This provides rich context without overwhelming the LLM&amp;rsquo;s context window.&lt;/p>
&lt;p>For longer research sessions, you can adjust:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-web-search-max-results &lt;span style="color:#ae81ff">10&lt;/span>) &lt;span style="color:#75715e">;; More sources&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-web-search-snippet-length &lt;span style="color:#ae81ff">5000&lt;/span>) &lt;span style="color:#75715e">;; Longer excerpts&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Be mindful of your LLM&amp;rsquo;s context window limits. With 5 results at 2000 chars each, you&amp;rsquo;re adding ~10K characters to your context.&lt;/p>
&lt;p>The web search integration fundamentally expands what your local LLMs can do. They&amp;rsquo;re no longer limited to their training data - they can reach out, fetch current information, and reason about it just like they would with any other context, so hopefully this will now make &lt;code>ollama-buddy&lt;/code> a little more useful&lt;/p></description></item><item><title>Ollama Buddy v2.5 - RAG (Retrieval-Augmented Generation) Support</title><link>https://www.emacs.dyerdwelling.family/emacs/20260224104044-emacs--ollama-buddy-v2/</link><pubDate>Tue, 24 Feb 2026 11:50:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20260224104044-emacs--ollama-buddy-v2/</guid><description>&lt;p>One of the things that has always slightly bothered me about chatting with a local LLM is that it only knows what it was trained on (although I suppose most LLMs are like that) . Ask it about your own codebase, your org notes, your project docs - and it&amp;rsquo;s just guessing. Well, not anymore! Ollama Buddy now ships with proper Retrieval Augmented Generation support built-in&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;h2 id="what-even-is-rag">What even is RAG?&lt;/h2>
&lt;p>If you haven&amp;rsquo;t come across the term before, the basic idea is simple. Instead of asking the LLM a question cold, you first go off and find the most relevant bits of text from your own documents, then you hand those bits to the LLM along with your question. The LLM now has actual context to work with rather than just vibes. The &amp;ldquo;retrieval&amp;rdquo; part is done using vector embeddings - each chunk of your documents gets turned into a mathematical representation, and at query time your question gets the same treatment. Chunks that are mathematically &amp;ldquo;close&amp;rdquo; to your question are the ones that get retrieved.&lt;/p>
&lt;p>In this case, I have worked to keep the whole pipeline inside Emacs; it talks to Ollama directly to contact an embedding model, which then returns the required information. I have tried to make this as Emacs Org-friendly as possible by storing the embedding information in Org files.&lt;/p>
&lt;h2 id="getting-started">Getting started&lt;/h2>
&lt;p>You&amp;rsquo;ll need an embedding model pulled alongside your chat model. The default is &lt;code>nomic-embed-text&lt;/code> which is a solid general-purpose choice:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-sh" data-lang="sh">&lt;span style="display:flex;">&lt;span>ollama pull nomic-embed-text
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>or just do it within ollama-buddy from the Model Management page.&lt;/p>
&lt;h2 id="indexing-your-documents">Indexing your documents&lt;/h2>
&lt;p>The main entry point is &lt;code>M-x ollama-buddy-rag-index-directory&lt;/code>. Point it at a directory and it will crawl through, chunk everything up, generate embeddings for each chunk, and save an index file. The first time you run this it can take a while depending on how much content you have and how fast your machine is - subsequent updates are much quicker as it only processes changed files.&lt;/p>
&lt;p>Supported file types (and I even managed to get pdf text extraction working!):&lt;/p>
&lt;ul>
&lt;li>Emacs Lisp (&lt;code>.el&lt;/code>)&lt;/li>
&lt;li>Python, JavaScript, TypeScript, Go, Rust, C/C++, Java, Ruby - basically most languages&lt;/li>
&lt;li>Org-mode and Markdown&lt;/li>
&lt;li>Plain text&lt;/li>
&lt;li>PDF files (if you have &lt;code>pdftotext&lt;/code> from poppler-utils installed)&lt;/li>
&lt;li>YAML, TOML, JSON, HTML, CSS&lt;/li>
&lt;/ul>
&lt;p>Files over 1MB are skipped (configurable), and the usual suspects like &lt;code>.git&lt;/code>, &lt;code>node_modules&lt;/code>, &lt;code>__pycache__&lt;/code> are excluded automatically.&lt;/p>
&lt;p>The index gets saved into &lt;code>~/.emacs.d/ollama-buddy/rag-indexes/&lt;/code> as a &lt;code>.rag&lt;/code> file named after the directory. You can see what you&amp;rsquo;ve got with &lt;code>M-x ollama-buddy-rag-list-indexes&lt;/code>.&lt;/p>
&lt;h2 id="the-chunking-strategy">The chunking strategy&lt;/h2>
&lt;p>One thing I&amp;rsquo;m quite happy with here is the chunking. Rather than just splitting on a fixed character count, documents are split into overlapping word-based chunks. The defaults are:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-rag-chunk-size &lt;span style="color:#ae81ff">400&lt;/span>) &lt;span style="color:#75715e">; ~500 tokens per chunk&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-rag-chunk-overlap &lt;span style="color:#ae81ff">50&lt;/span>) &lt;span style="color:#75715e">; 50-word overlap between chunks&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The overlap is important - it means a piece of information that sits right at a chunk boundary doesn&amp;rsquo;t get lost. Each chunk also tracks its source file and line numbers, so you can see exactly where a result came from.&lt;/p>
&lt;h2 id="searching-and-attaching-context">Searching and attaching context&lt;/h2>
&lt;p>Once you have an index, there are two main ways to use it:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;code>M-x ollama-buddy-rag-search&lt;/code> - searches and displays the results in a dedicated buffer so you can read through them&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;code>M-x ollama-buddy-rag-attach&lt;/code> - searches and attaches the results directly to your chat context&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>The second one is the useful one for day-to-day work. After running it, your next chat message will automatically include the retrieved document chunks as context. The status line shows &lt;code>♁N&lt;/code> (where N is the number of attached searches) so you always know what context is in play. Clear everything with &lt;code>M-x ollama-buddy-clear-attachments&lt;/code> or &lt;code>C-c 0&lt;/code>.&lt;/p>
&lt;p>You can also trigger searches inline using the &lt;code>@rag()&lt;/code> syntax directly in your prompt and is something fun I have been working on to include an inline command language of sorts, but more about that in a future post.&lt;/p>
&lt;p>The similarity search uses cosine similarity with sensible defaults (hopefully!)&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-rag-top-k &lt;span style="color:#ae81ff">5&lt;/span>) &lt;span style="color:#75715e">; return top 5 matching chunks&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-rag-similarity-threshold &lt;span style="color:#ae81ff">0.3&lt;/span>) &lt;span style="color:#75715e">; filter out low-relevance results&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Bump &lt;code>top-k&lt;/code> if you want more context, lower the threshold if you&amp;rsquo;re not getting enough results.&lt;/p>
&lt;h2 id="a-practical-example">A practical example&lt;/h2>
&lt;p>Say you&amp;rsquo;ve been working on a large Emacs package and you want the LLM to help you understand something specific. You&amp;rsquo;d do:&lt;/p>
&lt;ol>
&lt;li>&lt;code>M-x ollama-buddy-rag-index-directory&lt;/code> → point at your project directory&lt;/li>
&lt;li>Wait for indexing to complete (the chat header-line shows progress)&lt;/li>
&lt;li>&lt;code>M-x ollama-buddy-rag-attach&lt;/code> → type your search query, e.g. &amp;ldquo;streaming filter process&amp;rdquo;&lt;/li>
&lt;li>Ask your question in the chat buffer as normal&lt;/li>
&lt;/ol>
&lt;p>The LLM now has the relevant source chunks as context and can give you a much more grounded answer than it would cold.&lt;/p>
&lt;p>And the important aspect, especially regarding local models which don&amp;rsquo;t often have the huge context sizes often found in online LLMs is that it allows for very efficient context retrieval.&lt;/p>
&lt;h2 id="that-s-pretty-much-it">That&amp;rsquo;s pretty much it!&lt;/h2>
&lt;p>The whole thing is self-contained inside Emacs, no external packages or vector databases, you index once, search as needed, and the LLM gets actual information rather than hallucinating answers about your codebase or anything else that you would want to ingest and it will hopefully make working with local LLMs through ollama noticeably more useful and accurate.&lt;/p></description></item><item><title>Ollama Buddy v2.0 - LLMs can now call Emacs functions!</title><link>https://www.emacs.dyerdwelling.family/emacs/20260216084213-emacs--ollama-buddy-v2/</link><pubDate>Mon, 16 Feb 2026 08:56:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20260216084213-emacs--ollama-buddy-v2/</guid><description>&lt;p>Tool calling has landed in ollama-buddy!, it&amp;rsquo;s originally not something I really thought I would end up doing, but as ollama has provided tool enabled models and an API for this feature then I felt obliged to add it. So now LLMs through ollama can now actually do things inside Emacs rather than just talk about them, my original &amp;ldquo;do things only in the chat buffer and copy and paste&amp;rdquo; might have gone right out the window in an effort to fully support the ollama API!&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;p>What is Tool Calling?&lt;/p>
&lt;p>The basic idea is simple: instead of the model only generating text, it can request to invoke functions. You ask &amp;ldquo;what files are in my project?&amp;rdquo;, and instead of guessing, the model calls list_directory, gets the real answer, and responds with actual information.&lt;/p>
&lt;p>This creates a conversational loop:&lt;/p>
&lt;ol>
&lt;li>You send a prompt&lt;/li>
&lt;li>The model decides it needs to call a tool&lt;/li>
&lt;li>ollama-buddy executes the tool and feeds the result back&lt;/li>
&lt;li>The model generates a response using the real data&lt;/li>
&lt;li>Steps 2-4 repeat if more tools are needed&lt;/li>
&lt;/ol>
&lt;p>All of this is transparent - you just see the final response in the chat buffer.&lt;/p>
&lt;p>The new ollama-buddy-tools.el module ships with 8 built-in tools:&lt;/p>
&lt;p>Safe tools (read-only, enabled by default):&lt;/p>
&lt;ul>
&lt;li>&lt;strong>read_file&lt;/strong> - read file contents&lt;/li>
&lt;li>&lt;strong>list_directory&lt;/strong> - list directory contents&lt;/li>
&lt;li>&lt;strong>get_buffer_content&lt;/strong> - read an Emacs buffer&lt;/li>
&lt;li>&lt;strong>list_buffers&lt;/strong> - list open buffers with optional regex filtering&lt;/li>
&lt;li>&lt;strong>search_buffer&lt;/strong> - regex search within a buffer&lt;/li>
&lt;li>&lt;strong>calculate&lt;/strong> - evaluate math expressions via calc-eval&lt;/li>
&lt;/ul>
&lt;p>Unsafe tools (require safe mode off):&lt;/p>
&lt;ul>
&lt;li>&lt;strong>write_file&lt;/strong> - write content to files&lt;/li>
&lt;li>&lt;strong>execute_shell&lt;/strong> - run shell commands&lt;/li>
&lt;/ul>
&lt;p>Safe mode is on by default, so the model can only read - it can&amp;rsquo;t modify anything unless you explicitly allow it, I think this is quite a nice simple implementation, at the moment I generally have safe mode off but always allowing confirmation for each tool action, but of course you can configure as necessary.&lt;/p>
&lt;p>&lt;strong>Example Session&lt;/strong>&lt;/p>
&lt;p>With a tool-capable model like qwen3:8b and tools enabled (C-c W):&lt;/p>
&lt;p>&lt;strong>&amp;gt;&amp;gt; PROMPT: What defuns are defined in ollama-buddy-tools.el?&lt;/strong>&lt;/p>
&lt;p>The model calls &lt;strong>search_buffer&lt;/strong> with a regex pattern, gets the list of function definitions, and gives you a nicely formatted summary. No copy-pasting needed.&lt;/p>
&lt;p>&lt;strong>Custom Tools&lt;/strong>&lt;/p>
&lt;p>You can register your own tools with ollama-buddy-tools-register:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil"> (ollama-buddy-tools-register
&amp;#39;my-tool
&amp;#34;Description of what the tool does&amp;#34;
&amp;#39;((type . &amp;#34;object&amp;#34;)
(required . [&amp;#34;param1&amp;#34;])
(properties . ((param1 . ((type . &amp;#34;string&amp;#34;)
(description . &amp;#34;Parameter description&amp;#34;))))))
(lambda (args)
(let ((param1 (alist-get &amp;#39;param1 args)))
(format &amp;#34;Result: %s&amp;#34; param1)))
t) ; t = safe tool
&lt;/code>&lt;/pre>&lt;p>The registration API takes a name, description, JSON schema for parameters, an implementation function, and a safety flag. The model sees the schema and decides when to call your tool based on the conversation.&lt;/p>
&lt;p>A ⚒ symbol now appears next to tool-capable models everywhere - header line, model selector (C-c m), and model management buffer (C-c M). This follows the same pattern as the existing ⊙ vision indicator, so you can see at a glance which models support tools.&lt;/p>
&lt;p>That&amp;rsquo;s it. Pull a tool-capable model (qwen3, llama3.1, mistral, etc.) or use an online tool enabled model from ollama and start chatting. Next up is probably some web searching!, as again the ollama API supports this, so you will be able to pull in the latest from the interwebs to augment your prompt definition!&lt;/p></description></item><item><title>Spent a bit of free time polishing ollama-buddy - github Copilot is now onboard!</title><link>https://www.emacs.dyerdwelling.family/emacs/20260204100913-emacs--ollama-buddy-updates---github-copilot-integration-plus-others/</link><pubDate>Wed, 04 Feb 2026 10:40:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20260204100913-emacs--ollama-buddy-updates---github-copilot-integration-plus-others/</guid><description>&lt;p>I&amp;rsquo;ve had a little free time recently (figuring out this baby stuff!) and thought I would spend time revisiting and refining my AI assistant &lt;a href="https://github.com/captainflasmr/ollama-buddy">ollama-buddy&lt;/a>&lt;/p>
&lt;p>I&amp;rsquo;ve been playing around with agentic coding and keeping up-to-date on the rapid development of the Emacs AI package landscape and I think I have refined in my own mind my idea of what I would like to see in an Emacs AI assistant.&lt;/p>
&lt;p>The headline change regarding the latest release of ollama-buddy is GitHub Copilot integration; the rest of the work is about smoothing the UI and simplifying day-to-day use.&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;p>What’s new - the Copilot addition (v1.2)&lt;/p>
&lt;ul>
&lt;li>GitHub Copilot Chat API support via a new file, ollama-buddy-copilot.el, so Copilot models can be used alongside your existing providers.&lt;/li>
&lt;li>Authentication uses GitHub’s device flow (OAuth). No API key required: M-x ollama-buddy-copilot-login opens a browser and guides you through secure authentication.&lt;/li>
&lt;li>Copilot models are identified with a &amp;ldquo;p:&amp;rdquo; prefix (for example, p:gpt-4o). The header line shows a &amp;ldquo;p&amp;rdquo; indicator when the Copilot provider is loaded so you always know it’s available.&lt;/li>
&lt;li>Copilot access exposes a broad set of models from multiple vendors through the Copilot interface: OpenAI (gpt-4o, gpt-5), Anthropic (claude-sonnet-4, claude-opus-4.5), Google (gemini-2.5-pro), and xAI models.&lt;/li>
&lt;li>Quick usage notes:
&lt;ol>
&lt;li>Ensure you have an active GitHub Copilot subscription.&lt;/li>
&lt;li>Run M-x ollama-buddy-copilot-login.&lt;/li>
&lt;li>Enter the device code in your browser at github.com/login/device when prompted.&lt;/li>
&lt;li>Select a Copilot model with C-c m (e.g., p:gpt-4o).&lt;/li>
&lt;/ol>
&lt;/li>
&lt;li>Example config to load Copilot support:&lt;/li>
&lt;/ul>
&lt;!--listend-->
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">(use-package ollama-buddy
:bind
(&amp;#34;C-c o&amp;#34; . ollama-buddy-menu)
(&amp;#34;C-c O&amp;#34; . ollama-buddy-transient-menu-wrapper)
:config
(require &amp;#39;ollama-buddy-copilot nil t))
&lt;/code>&lt;/pre>&lt;p>Other notable updates in this release series&lt;/p>
&lt;ul>
&lt;li>&lt;strong>v1.2.1 (2026-02-02)&lt;/strong>
&lt;ul>
&lt;li>Attachment count indicator on the header line so you get a constant visual reminder that the session has attachments.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>v1.1.5 (2026-01-31)&lt;/strong>
&lt;ul>
&lt;li>Global system prompt feature (enabled by default): sets a baseline set of instructions (for example, to prefer plain prose and avoid markdown tables) that is prepended to session-specific system prompts. This helps keep responses consistent across providers and things like malformed markdown tables for example, which seems to be common. There’s a toggle (ollama-buddy-global-system-prompt-enabled) and a quick command to flip it (ollama-buddy-toggle-global-system-prompt), plus a transient-menu entry.&lt;/li>
&lt;li>Consolidated model management: streamlined into a single model management buffer (C-c W) and the welcome screen now points to that buffer for model tasks.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>v1.1.4 (2026-01-31)&lt;/strong>
&lt;ul>
&lt;li>Header-line and keybinding cleanup: C-c RET to send prompts (matches gptel, as I feel this seems intuitive), removed a redundant backend indicator, shortened the markdown indicator to &amp;ldquo;MD&amp;rdquo;, and fixed markdown → org heading conversion to keep structure sane.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>v1.1.3 (2026-01-31)&lt;/strong>
&lt;ul>
&lt;li>Chat UX improvements and simplification: added ollama-buddy-auto-scroll (default nil — don’t auto-scroll so you can read while streaming) and ollama-buddy-pulse-response (flashes the response on completion, taking from gptel again, as if there is no autoscrolling it is useful to visually see when the response has completed). Removed the model name coloring feature and related toggles to simplify code and improve org-mode performance.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>v1.1.2 (2026-01-30)&lt;/strong>
&lt;ul>
&lt;li>Streamlined welcome screen and model selection, clearer provider indicators in the header line and an improved list of enabled online LLM providers.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul></description></item><item><title>Ollama buddy now supports cloud models!</title><link>https://www.emacs.dyerdwelling.family/emacs/20260128082917-emacs--ollama-buddy-now-supports-cloud-models/</link><pubDate>Wed, 28 Jan 2026 08:29:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20260128082917-emacs--ollama-buddy-now-supports-cloud-models/</guid><description>&lt;p>Having another look at my AI assistant - ollama-buddy, its been a while and it seems ollama has moved on since I started creating this package last year, so I have developed a new roadmap and the first step is to add ollama cloud models!&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;p>Here are some references to the project, including a youtube channel where I upload ollama-buddy demonstrations:&lt;/p>
&lt;p>&lt;a href="https://melpa.org/#/ollama-buddy">https://melpa.org/#/ollama-buddy&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://github.com/captainflasmr/ollama-buddy">https://github.com/captainflasmr/ollama-buddy&lt;/a>&lt;/p>
&lt;p>Here is the changelog for the cloud model implementation:&lt;/p>
&lt;h2 id="1-dot-1">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2026-01-28 Wed&amp;gt; &lt;/span>&lt;/span> &lt;strong>1.1&lt;/strong>&lt;/h2>
&lt;p>Added Ollama Cloud Models support&lt;/p>
&lt;ul>
&lt;li>Cloud models (running on ollama.com infrastructure) now work seamlessly&lt;/li>
&lt;li>&lt;code>ollama-buddy-cloud-signin&lt;/code> to automatically open browser for authentication&lt;/li>
&lt;li>Cloud models are proxied through the local Ollama server which handles authentication&lt;/li>
&lt;li>Use &lt;code>C-u C-c m&lt;/code> or transient menu &amp;ldquo;Model &amp;gt; Cloud&amp;rdquo; to select cloud models&lt;/li>
&lt;li>Status line shows ☁ indicator when using a cloud model&lt;/li>
&lt;li>Available cloud models include: qwen3-coder:480b-cloud, deepseek-v3.1:671b-cloud, gpt-oss:120b-cloud, minimax-m2.1:cloud, and more&lt;/li>
&lt;/ul></description></item><item><title>Expanding Ollama Buddy: Mistral Codestral Integration</title><link>https://www.emacs.dyerdwelling.family/emacs/20251211081935-emacs--expanding-ollama-buddy-mistral-codestral-integration/</link><pubDate>Thu, 11 Dec 2025 08:19:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20251211081935-emacs--expanding-ollama-buddy-mistral-codestral-integration/</guid><description>&lt;p>Ollama Buddy now supports Mistral&amp;rsquo;s Codestral - a powerful code-generation model from Mistral AI that seamlessly integrates into the ollama-buddy ecosystem.&lt;/p>
&lt;p>&lt;a href="https://github.com/captainflasmr/ollama-buddy">https://github.com/captainflasmr/ollama-buddy&lt;/a>&lt;/p>
&lt;p>&lt;a href="https://melpa.org/#/ollama-buddy">https://melpa.org/#/ollama-buddy&lt;/a>&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions_001.jpg" width="100%">
&lt;/figure>
&lt;p>So now we have:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Local Ollama models&lt;/strong> — full control, complete privacy&lt;/li>
&lt;li>&lt;strong>OpenAI&lt;/strong> — extensive model options and API maturity&lt;/li>
&lt;li>&lt;strong>Claude&lt;/strong> — reasoning and complex analysis&lt;/li>
&lt;li>&lt;strong>Gemini&lt;/strong> — multimodal capabilities&lt;/li>
&lt;li>&lt;strong>Grok&lt;/strong> — advanced reasoning models&lt;/li>
&lt;li>&lt;strong>Codestral&lt;/strong> — specialized code generation &lt;strong>NEW&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>To get up and running&amp;hellip;&lt;/p>
&lt;p>First, sign up at &lt;a href="https://console.mistral.ai/">Mistral AI&lt;/a> and generate an API key from your dashboard.&lt;/p>
&lt;p>Add this to your Emacs configuration:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(use-package ollama-buddy
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :bind
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c o&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-menu)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c O&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-transient-menu-wrapper)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :custom
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-codestral-api-key
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (auth-source-pick-first-password :host &lt;span style="color:#e6db74">&amp;#34;ollama-buddy-codestral&amp;#34;&lt;/span> :user &lt;span style="color:#e6db74">&amp;#34;apikey&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :config
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (require &lt;span style="color:#e6db74">&amp;#39;ollama-buddy-codestral&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> &lt;span style="color:#66d9ef">t&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Once configured, Codestral models will appear in your model list with an &lt;code>s:&lt;/code> prefix (e.g., &lt;code>s:codestral-latest&lt;/code>). You can:&lt;/p>
&lt;ul>
&lt;li>Select it from the model menu (&lt;code>C-c m&lt;/code>)&lt;/li>
&lt;li>Use it with any command that supports model selection&lt;/li>
&lt;li>Switch between local and cloud models on-the-fly&lt;/li>
&lt;/ul></description></item><item><title>Ollama Buddy v1.0: A Simple AI Assistant</title><link>https://www.emacs.dyerdwelling.family/emacs/20250723083048-emacs--announcing-v1-ollama-buddy/</link><pubDate>Wed, 23 Jul 2025 09:20:00 +0100</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250723083048-emacs--announcing-v1-ollama-buddy/</guid><description>&lt;p>After months of development and refinement, I&amp;rsquo;m excited to announce &lt;strong>Ollama Buddy v1.0&lt;/strong> - an Emacs package that simply interfaces mainly to ollama, for local LLM usage, but can be integrated to the major online players. This project initially started as a simple integration with Ollama and since then has somewhat evolved into a more fully fully-featured AI Emacs assistant. The main focus with this package is a front facing simplicity but hiding (hopefully) all the features you would expect from an AI chatbot - wait I hate that term, I mean, assistant :). There is also the ability to craft a customizable menu system for different roles.&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;p>I had a blast developing this package and next up is RAG!. I saw recently that a package called &lt;code>vecdb&lt;/code> was introduced into the package ecosystem to help with the storage of vector embeddings, so as ollama can return embedding vectors for semantic search I thought I would combine my package, vecdb, also probably initially a PostgreSQL database with a pgvector extension and ollama into something that could ingest files directly from Emacs. I think I have figured this out now, I just need to do it (when the baby is asleep, probably!)&lt;/p>
&lt;h2 id="why-choose-ollama-buddy">Why Choose Ollama Buddy?&lt;/h2>
&lt;p>I designed Ollama Buddy to be as simple as possible to set up, no backend configuration or complex setup required. This was achievable initially because I focused solely on Ollama integration, where models are automatically discoverable.&lt;/p>
&lt;p>Since then, I&amp;rsquo;ve expanded support to major online AI providers while maintaining that same simplicity through a modular architecture. The system now handles multiple providers without adding complexity to the user experience.&lt;/p>
&lt;p>Another key feature is the customizable menu system, which integrates with role-based switching. You can create specialized AI menus for different contexts, like a coding-focused setup or a writing-optimized configuration and switch between them instantly. Everything is fully configurable to match your workflow.&lt;/p>
&lt;h2 id="links">Links&lt;/h2>
&lt;p>Here are some links:&lt;/p>
&lt;p>&lt;a href="https://github.com/captainflasmr/ollama-buddy">https://github.com/captainflasmr/ollama-buddy&lt;/a>
&lt;a href="https://melpa.org/#/ollama-buddy">https://melpa.org/#/ollama-buddy&lt;/a>&lt;/p>
&lt;p>I will outline the major features below, but I do have a manual available!&lt;/p>
&lt;p>&lt;a href="https://github.com/captainflasmr/ollama-buddy/blob/main/docs/ollama-buddy.org">https://github.com/captainflasmr/ollama-buddy/blob/main/docs/ollama-buddy.org&lt;/a>&lt;/p>
&lt;h2 id="key-features">Key Features&lt;/h2>
&lt;h3 id="multiple-ai-providers">Multiple AI Providers&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Local Models&lt;/strong>: Full support for Ollama with automatic model management&lt;/li>
&lt;li>&lt;strong>Cloud Services&lt;/strong>: Integrated support for OpenAI (ChatGPT), Anthropic Claude, Google Gemini, and Grok&lt;/li>
&lt;li>&lt;strong>Seamless Switching&lt;/strong>: Change between local and cloud models with a single command&lt;/li>
&lt;li>&lt;strong>Unified Interface&lt;/strong>: Same commands work across all providers&lt;/li>
&lt;/ul>
&lt;h3 id="role-based-workflows-build-your-own-ai-menu">Role-Based Workflows - build your own AI menu&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Preset Roles&lt;/strong>: Switch between different AI personalities (developer, writer, analyst, etc.)&lt;/li>
&lt;li>&lt;strong>Custom Roles&lt;/strong>: Create specialized workflows with specific models and parameters&lt;/li>
&lt;li>&lt;strong>Menu Customization&lt;/strong>: Each role can have its own set of commands and shortcuts&lt;/li>
&lt;/ul>
&lt;h3 id="chat-interface">Chat Interface&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Org-mode Integration&lt;/strong>: Conversations rendered in structured org-mode format&lt;/li>
&lt;li>&lt;strong>Real-time Streaming&lt;/strong>: Watch responses appear token by token&lt;/li>
&lt;li>&lt;strong>Context Management&lt;/strong>: Visual context window monitoring with usage warnings&lt;/li>
&lt;li>&lt;strong>History Tracking&lt;/strong>: Full conversation history with model-specific storage&lt;/li>
&lt;/ul>
&lt;h3 id="file-handling">File Handling&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>File Attachments&lt;/strong>: Attach documents directly to conversations for context-aware analysis&lt;/li>
&lt;li>&lt;strong>Vision Support&lt;/strong>: Upload and analyse images with vision-capable models&lt;/li>
&lt;li>&lt;strong>Dired Integration&lt;/strong>: Bulk attach files directly from Emacs file manager&lt;/li>
&lt;/ul>
&lt;h3 id="prompt-management">Prompt Management&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>System Prompts&lt;/strong>: Create and manage reusable system prompts for different use cases&lt;/li>
&lt;li>&lt;strong>Fabric Integration&lt;/strong>: Auto-sync with Fabric patterns (200+ professional prompts)&lt;/li>
&lt;li>&lt;strong>Awesome ChatGPT Prompts&lt;/strong>: Built-in access to the popular prompt collection&lt;/li>
&lt;li>&lt;strong>User Prompts&lt;/strong>: Create and organize your own custom prompt library (which of course is org based)&lt;/li>
&lt;/ul>
&lt;h3 id="session-management">Session Management&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Save &amp;amp; Restore&lt;/strong>: Full session persistence including history, attachments, and settings&lt;/li>
&lt;li>&lt;strong>Session Browser&lt;/strong>: Visual interface to manage multiple conversation sessions&lt;/li>
&lt;li>&lt;strong>Auto-naming&lt;/strong>: Intelligent session naming based on conversation content&lt;/li>
&lt;/ul>
&lt;h3 id="flexible-interface-options">Flexible Interface Options&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Two Interface Levels&lt;/strong>: Basic mode for beginners, advanced for power users&lt;/li>
&lt;li>&lt;strong>Transient Menus&lt;/strong>: Magit-style discoverable command interface&lt;/li>
&lt;li>&lt;strong>Custom Menus&lt;/strong>: Traditional text-based menu system&lt;/li>
&lt;li>&lt;strong>Keyboard Shortcuts&lt;/strong>: Comprehensive keybinding system for efficiency, I&amp;rsquo;m not sure there are any keys left!!&lt;/li>
&lt;/ul>
&lt;h2 id="what-s-next">What&amp;rsquo;s Next?&lt;/h2>
&lt;p>Version 1.0 represents a stable, foundation, Ollama Buddy has been out there now for a few months with only a single github issue but development continues with:&lt;/p>
&lt;ul>
&lt;li>RAG integration using perhaps the new &lt;code>vecdb&lt;/code> package, as mentioned above&lt;/li>
&lt;li>Additional AI provider integrations (Perplexity maybe?, any suggestions?)&lt;/li>
&lt;li>Auto-completion (not sure how doable this is with ollama, but I do have a prototype)&lt;/li>
&lt;/ul></description></item><item><title>Ollama Buddy 0.12.0: User Prompt Library, File Attachments, Vision and Context Tracking</title><link>https://www.emacs.dyerdwelling.family/emacs/20250523135757-emacs--ollama-buddy-0-12-0-user-prompt-library-file-attachments-vision-context-tracking/</link><pubDate>Fri, 23 May 2025 14:10:00 +0100</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250523135757-emacs--ollama-buddy-0-12-0-user-prompt-library-file-attachments-vision-context-tracking/</guid><description>&lt;p>There have been quite a few updates recently. The main highlights include support for attachments, so you can push a file to the chat directly from &lt;code>dired&lt;/code> for potential inclusion in your next query.&lt;/p>
&lt;p>Vision support has been added for models that can handle it. If you supply the path to an image file in the chat, it will be processed. This means you can now, for example, extract text from images using models like &lt;code>o:gemma3:4b&lt;/code>.&lt;/p>
&lt;p>I&amp;rsquo;ve also introduced the ability to save user system prompts. If you have a favorite prompt, or have crafted one that works especially well for you, you can now save it by category and title in a simple Org format for later recall. Prompt recall now works the same way as Fabric patterns and Awesome ChatGPT prompts. This makes it much easier to display the currently used system prompt concisely in the status bar, as it will be based on the prompt title (and thus likely the role).&lt;/p>
&lt;p>What else? Oh yes, I received a request for better context tracking. Now, when context is nearing full capacity, or has exceeded it, it will be indicated in the status bar!&lt;/p>
&lt;p>That’s probably it for the major changes. There was also some refactoring, but you probably don&amp;rsquo;t care about that. Anyway, here is the full list of changes:&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;h2 id="0-dot-12-dot-0">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-22 Thu&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.12.0&lt;/strong>&lt;/h2>
&lt;p>Full system prompt in the status bar replaced with a more meaningful simple role title&lt;/p>
&lt;ul>
&lt;li>Added system prompt metadata tracking with title, source, and timestamp registry&lt;/li>
&lt;li>Implemented automatic title extraction and unified completing-read interface&lt;/li>
&lt;li>Enhanced fabric/awesome prompt integration with proper metadata handling&lt;/li>
&lt;li>Improved transient menu organization and org-mode formatting with folding&lt;/li>
&lt;li>Added system prompt history display and better error handling for empty files&lt;/li>
&lt;li>Transient menu has been simplified and reorganised&lt;/li>
&lt;/ul>
&lt;p>Previously, the header status bar would show truncated system prompt text like &lt;code>[You are a helpful assistant wh...]&lt;/code>, making it difficult to quickly identify which prompt was active. Now, the display shows meaningful role titles with source indicators:&lt;/p>
&lt;ul>
&lt;li>&lt;code>[F:Code Reviewer]&lt;/code> - Fabric pattern&lt;/li>
&lt;li>&lt;code>[A:Linux Terminal]&lt;/code> - Awesome ChatGPT prompt&lt;/li>
&lt;li>&lt;code>[U:Writing Assistant]&lt;/code> - User-defined prompt&lt;/li>
&lt;/ul>
&lt;p>The system now intelligently extracts titles from prompt content by recognizing common patterns like &amp;ldquo;You are a&amp;hellip;&amp;rdquo;, &amp;ldquo;Act as&amp;hellip;&amp;rdquo;, or &amp;ldquo;I want you to act as&amp;hellip;&amp;rdquo;. When these patterns aren&amp;rsquo;t found, it generates a concise title from the first few words.&lt;/p>
&lt;p>Behind the scenes, Ollama Buddy now maintains a registry of all system prompts with their titles, sources, and timestamps. This enables new features like system prompt history viewing and better organization across Fabric patterns, Awesome ChatGPT prompts, and user-defined prompts.&lt;/p>
&lt;p>The result is a cleaner interface that makes it immediately clear which role your AI assistant is currently embodying, without cluttering the status bar with long, truncated text.&lt;/p>
&lt;h2 id="0-dot-11-dot-1">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-21 Wed&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.11.1&lt;/strong>&lt;/h2>
&lt;p>Quite a bit of refactoring to generally make this project more maintainable and I have added a starter kit of user prompts.&lt;/p>
&lt;ul>
&lt;li>
&lt;p>Color System Reworking&lt;/p>
&lt;ul>
&lt;li>Removed all model color-related functions and variables&lt;/li>
&lt;li>Removed dependency on &lt;code>color.el&lt;/code>&lt;/li>
&lt;li>Replaced with &lt;code>highlight-regexp&lt;/code> and hashing to &lt;code>^font-lock&lt;/code> faces, so now using a more native built-in solutions for model colouring rather than shoe-horning in overlays.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>UI Improvements&lt;/p>
&lt;ul>
&lt;li>Simplified the display system by leveraging Org mode&lt;/li>
&lt;li>Added org-mode styling for output buffers&lt;/li>
&lt;li>Added &lt;code>org-hide-emphasis-markers&lt;/code> and &lt;code>org-hide-leading-stars&lt;/code> settings&lt;/li>
&lt;li>Changed formatting to use Org markup instead of text properties&lt;/li>
&lt;li>Converted plain text headers to proper Org headings&lt;/li>
&lt;li>Replaced color properties with Org emphasis (bold)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>History Management Updates&lt;/p>
&lt;ul>
&lt;li>Streamlined history editing functionality&lt;/li>
&lt;li>Improved model-specific history editing&lt;/li>
&lt;li>Refactored history display and navigation&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>System Prompts&lt;/p>
&lt;ul>
&lt;li>Added library of system prompts in these categories:
&lt;ul>
&lt;li>analysis (3 prompts)&lt;/li>
&lt;li>coding (5 prompts)&lt;/li>
&lt;li>creative (3 prompts)&lt;/li>
&lt;li>documentation (3 prompts)&lt;/li>
&lt;li>emacs (10 prompts)&lt;/li>
&lt;li>general (3 prompts)&lt;/li>
&lt;li>technical (3 prompts)&lt;/li>
&lt;li>writing (3 prompts)&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h2 id="0-dot-11-dot-0">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-19 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.11.0&lt;/strong>&lt;/h2>
&lt;p>Added user system prompts management&lt;/p>
&lt;ul>
&lt;li>You can now save, load and manage system prompts&lt;/li>
&lt;li>Created new transient menu for user system prompts (C-c s)&lt;/li>
&lt;li>Organized prompts by categories with org-mode format storage&lt;/li>
&lt;li>Supported prompt editing, listing, creation and deletion&lt;/li>
&lt;li>Updated key bindings to integrate with existing functionality&lt;/li>
&lt;li>Added prompts directory customization with defaults&lt;/li>
&lt;/ul>
&lt;p>This feature makes it easier to save, organize, and reuse your favorite system prompts when working with Ollama language models.&lt;/p>
&lt;p>System prompts are special instructions that guide the behavior of language models. By setting effective system prompts, you can:&lt;/p>
&lt;ul>
&lt;li>Define the AI&amp;rsquo;s role (e.g., &amp;ldquo;You are a helpful programming assistant who explains code clearly&amp;rdquo;)&lt;/li>
&lt;li>Establish response formats&lt;/li>
&lt;li>Set the tone and style of responses&lt;/li>
&lt;li>Provide background knowledge for specific domains&lt;/li>
&lt;/ul>
&lt;p>The new &lt;code>ollama-buddy-user-prompts&lt;/code> module organizes your system prompts in a clean, category-based system:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Save your prompts&lt;/strong> - Store effective system prompts you&amp;rsquo;ve crafted for future use&lt;/li>
&lt;li>&lt;strong>Categorize&lt;/strong> - Prompts are organized by domains like &amp;ldquo;coding,&amp;rdquo; &amp;ldquo;writing,&amp;rdquo; &amp;ldquo;technical,&amp;rdquo; etc.&lt;/li>
&lt;li>&lt;strong>Quick access&lt;/strong> - Browse and load your prompt library with completion-based selection&lt;/li>
&lt;li>&lt;strong>Edit in org-mode&lt;/strong> - All prompts are stored as org files with proper metadata&lt;/li>
&lt;li>&lt;strong>Manage with ease&lt;/strong> - Create, edit, list, and delete prompts through a dedicated transient menu&lt;/li>
&lt;/ul>
&lt;p>The new functionality is accessible through the updated key binding &lt;code>C-c s&lt;/code>, which opens a dedicated transient menu with these options:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Save current (S)&lt;/strong> - Save your active system prompt&lt;/li>
&lt;li>&lt;strong>Load prompt (L)&lt;/strong> - Choose a previously saved prompt&lt;/li>
&lt;li>&lt;strong>Create new (N)&lt;/strong> - Start fresh with a new prompt&lt;/li>
&lt;li>&lt;strong>List all Prompts (l)&lt;/strong> - View your entire prompt library&lt;/li>
&lt;li>&lt;strong>Edit prompt (e)&lt;/strong> - Modify an existing prompt&lt;/li>
&lt;li>&lt;strong>Delete prompt (d)&lt;/strong> - Remove prompts you no longer need&lt;/li>
&lt;/ul>
&lt;p>If you work frequently with Ollama models, you&amp;rsquo;ve likely discovered the power of well-crafted system prompts. They can dramatically improve the quality and consistency of responses. With this new management system, you can:&lt;/p>
&lt;ul>
&lt;li>Build a personal library of effective prompts&lt;/li>
&lt;li>Maintain context continuity across sessions&lt;/li>
&lt;li>Share prompts with teammates&lt;/li>
&lt;li>Refine your prompts over time&lt;/li>
&lt;/ul>
&lt;h2 id="0-dot-10-dot-0">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-14 Wed&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.10.0&lt;/strong>&lt;/h2>
&lt;p>Added file attachment system for including documents in conversations&lt;/p>
&lt;ul>
&lt;li>Added file attachment support with configurable file size limits (10MB default) and supported file types&lt;/li>
&lt;li>Implemented session persistence for attachments in save/load functionality&lt;/li>
&lt;li>Added attachment context inclusion in prompts with proper token counting&lt;/li>
&lt;li>Created comprehensive attachment management commands:
&lt;ul>
&lt;li>Attach files to conversations&lt;/li>
&lt;li>Show current attachments in dedicated buffer&lt;/li>
&lt;li>Detach specific files&lt;/li>
&lt;li>Clear all attachments&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Added Dired integration for bulk file attachment&lt;/li>
&lt;li>Included attachment menu in transient interface (C-c 1)&lt;/li>
&lt;li>Updated help text to document new attachment keybindings&lt;/li>
&lt;li>Enhanced context calculation to include attachment token usage&lt;/li>
&lt;/ul>
&lt;p>You can now seamlessly include text files, code, documentation, and more directly in your conversations with local AI models!&lt;/p>
&lt;p>Simply use &lt;code>C-c C-a&lt;/code> from the chat buffer to attach any file to your current conversation.&lt;/p>
&lt;p>The attached files become part of your conversation context, allowing the AI to reference, analyze, or work with their contents directly.&lt;/p>
&lt;p>The transient menu has also been updated with a new &lt;strong>Attachment Menu&lt;/strong>&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">*File Attachments*
a Attach file
w Show attachments
d Detach file
0 Clear all attachments
&lt;/code>&lt;/pre>&lt;p>Your attachments aren&amp;rsquo;t just dumped into the conversation - they&amp;rsquo;re intelligently integrated:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Token counting&lt;/strong> now includes attachment content, so you always know how much context you&amp;rsquo;re using&lt;/li>
&lt;li>&lt;strong>Session persistence&lt;/strong> means your attachments are saved and restored when you save/load conversations&lt;/li>
&lt;li>&lt;strong>File size limits&lt;/strong> (configurable, 10MB default) prevent accidentally overwhelming your context window&lt;/li>
&lt;/ul>
&lt;p>Managing attached files is intuitive with dedicated commands:&lt;/p>
&lt;ul>
&lt;li>&lt;code>C-c C-w&lt;/code> - View all current attachments in a nicely formatted org mode buffer, folded to each file&lt;/li>
&lt;li>&lt;code>C-c C-d&lt;/code> - Detach specific files when you no longer need them&lt;/li>
&lt;li>&lt;code>C-c 0&lt;/code> - Clear all attachments at once&lt;/li>
&lt;li>&lt;code>C-c 1&lt;/code> - Access the full attachment menu via a transient interface&lt;/li>
&lt;/ul>
&lt;p>Working in Dired? No problem! You can attach files directly from your file browser:&lt;/p>
&lt;ul>
&lt;li>Mark multiple files and attach them all at once&lt;/li>
&lt;li>Attach the file at point with a single command&lt;/li>
&lt;/ul>
&lt;p>Use the configuration as follows:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(eval-after-load &lt;span style="color:#e6db74">&amp;#39;dired&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">&amp;#39;&lt;/span>(progn
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#a6e22e">define-key&lt;/span> dired-mode-map (kbd &lt;span style="color:#e6db74">&amp;#34;C-c C-a&amp;#34;&lt;/span>) &lt;span style="color:#a6e22e">#&amp;#39;&lt;/span>ollama-buddy-dired-attach-marked-files)))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="0-dot-9-dot-50">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-12 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.50&lt;/strong>&lt;/h2>
&lt;p>Added context size management and monitoring&lt;/p>
&lt;ul>
&lt;li>Added configurable context sizes for popular models (llama3.2, mistral, qwen, etc.)&lt;/li>
&lt;li>Implemented real-time context usage display in status bar&lt;/li>
&lt;li>Can display in text or bar display types&lt;/li>
&lt;li>Added context size thresholds with visual warnings&lt;/li>
&lt;li>Added interactive commands for context management:
&lt;ul>
&lt;li>&lt;code>ollama-buddy-show-context-info&lt;/code>: View all model context sizes&lt;/li>
&lt;li>&lt;code>ollama-buddy-set-model-context-size&lt;/code>: Manually configure model context&lt;/li>
&lt;li>&lt;code>ollama-buddy-toggle-context-percentage&lt;/code>: Toggle context display&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Implemented context size validation before sending prompts&lt;/li>
&lt;li>Added token estimation and breakdown (history/system/current prompt)&lt;/li>
&lt;li>Added keybindings: C-c $ (set context), C-c % (toggle display), C-c C (show info)&lt;/li>
&lt;li>Updated status bar to show current/max context with fontification&lt;/li>
&lt;/ul>
&lt;p>I&amp;rsquo;ve added context window management and monitoring capabilities to Ollama Buddy!&lt;/p>
&lt;p>This update helps you better understand and manage your model&amp;rsquo;s context usage, preventing errors and optimizing your conversations.&lt;/p>
&lt;p>Enable it with the following:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-show-context-percentage &lt;span style="color:#66d9ef">t&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="usage">Usage&lt;/h3>
&lt;p>After implementing these changes:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Text mode&lt;/strong>: Shows &lt;code>1024/4096&lt;/code> style display&lt;/li>
&lt;li>&lt;strong>Bar mode&lt;/strong> (default): Shows &lt;code>███████░░░░ 2048&lt;/code> style display&lt;/li>
&lt;li>Use &lt;code>C-c 8&lt;/code> to toggle between modes&lt;/li>
&lt;li>The &lt;strong>Text mode&lt;/strong> will change fontification based on your thresholds:
&lt;ul>
&lt;li>Normal: regular fontification&lt;/li>
&lt;li>(85%+): underlined and bold&lt;/li>
&lt;li>(100%+): inverse video and bold&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>The &lt;strong>Bar mode&lt;/strong> will just fill up as normal&lt;/li>
&lt;/ol>
&lt;p>The progress bar will visually represent how much of the context window you&amp;rsquo;re using, making it easier to see at a glance when you&amp;rsquo;re approaching the limit.&lt;/p>
&lt;h3 id="implementation-details">Implementation Details&lt;/h3>
&lt;h4 id="context-size-detection">Context Size Detection&lt;/h4>
&lt;p>Determining a model&amp;rsquo;s context size proved more complex than expected. While experimenting with parsing model info JSON, I discovered that context size information can be scattered across different fields. Rather than implementing a complex JSON parser (which may come later), I chose a pragmatic approach:&lt;/p>
&lt;p>I created a new &lt;code>defcustom&lt;/code> variable &lt;code>ollama-buddy-fallback-context-sizes&lt;/code> that includes hard-coded values for popular Ollama models. The fallback mechanism is deliberately simple: substring matching followed by a sensible default of 4096 tokens.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(defcustom ollama-buddy-fallback-context-sizes
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f92672">&amp;#39;&lt;/span>((&lt;span style="color:#e6db74">&amp;#34;llama3.2:1b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">2048&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;llama3:8b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">4096&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;tinyllama&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">2048&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;phi3:3.8b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">4096&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;gemma3:1b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">4096&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;gemma3:4b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;llama3.2:3b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;llama3.2:8b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;llama3.2:70b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;starcoder2:3b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;starcoder2:7b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;starcoder2:15b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;mistral:7b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;mistral:8x7b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">32768&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;codellama:7b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;codellama:13b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;codellama:34b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;qwen2.5-coder:7b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;qwen2.5-coder:3b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;qwen3:0.6b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">4096&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;qwen3:1.7b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;qwen3:4b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;qwen3:8b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;deepseek-r1:7b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">8192&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;deepseek-r1:1.5b&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">4096&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;Mapping of model names to their default context sizes.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74">Used as a fallback when context size can&amp;#39;t be determined from the API.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :type &lt;span style="color:#f92672">&amp;#39;&lt;/span>(alist :key-type &lt;span style="color:#a6e22e">string&lt;/span> :value-type integer)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :group &lt;span style="color:#e6db74">&amp;#39;ollama-buddy&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This approach may not be perfectly accurate for all models, but it&amp;rsquo;s sufficient for getting the core functionality working. More importantly, as a &lt;code>defcustom&lt;/code>, users can easily customize these values for complete accuracy with their specific models. Users can also set context values within the chat buffer through &lt;code>C-c C&lt;/code> (Show Context Information) for each individual model if desired.&lt;/p>
&lt;p>This design choice allowed me to focus on the essential features without getting stuck on complex context retrieval logic.&lt;/p>
&lt;p>One final thing!, if the &lt;code>num_ctx: Context window size in tokens&lt;/code> is set, then that number will also be taken into consideration. An assumption will be made that the model is honouring the context size requested and will incorporated into the context calculations accordingly.&lt;/p>
&lt;h4 id="token-estimation">Token Estimation&lt;/h4>
&lt;p>For token counting, I&amp;rsquo;ve implemented a simple heuristic: each word (using string-split) is multiplied by 1.3. This follows commonly recommended approximations and works well enough in practice. While this isn&amp;rsquo;t currently configurable, I may add it as a customization option in the future.&lt;/p>
&lt;h3 id="how-to-use-context-management-in-practice">How to Use Context Management in Practice&lt;/h3>
&lt;p>The &lt;code>C-c C&lt;/code> (Show Context Information) command is central to this feature. Rather than continuously monitoring context size while you type (which would be computationally expensive and potentially distracting), I&amp;rsquo;ve designed the system to calculate context on-demand when you choose.&lt;/p>
&lt;h4 id="typical-workflows">Typical Workflows&lt;/h4>
&lt;p>&lt;strong>Scenario 1: Paste-and-Send Approach&lt;/strong>&lt;/p>
&lt;p>Let&amp;rsquo;s say you want to paste a large block of text into the chat buffer. You can simply:&lt;/p>
&lt;ol>
&lt;li>Paste your content&lt;/li>
&lt;li>Press the send keybinding&lt;/li>
&lt;li>If the context limit is exceeded, you&amp;rsquo;ll get a warning dialog asking whether to proceed anyway&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>Scenario 2: Preemptive Checking&lt;/strong>&lt;/p>
&lt;p>For more control, you can check context usage before sending:&lt;/p>
&lt;ol>
&lt;li>Paste your content&lt;/li>
&lt;li>Run &lt;code>C-c C&lt;/code> to see the current context breakdown&lt;/li>
&lt;li>If the context looks too high, you have several options:
&lt;ul>
&lt;li>Trim your current prompt&lt;/li>
&lt;li>Remove or simplify your system prompt&lt;/li>
&lt;li>Edit conversation history using Ollama Buddy&amp;rsquo;s history modification features&lt;/li>
&lt;li>Switch to a model with a larger context window&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>Scenario 3: Manage the Max History Length&lt;/strong>&lt;/p>
&lt;p>Want tight control over context size without constantly monitoring the real-time display? Since conversation history is part of the context, you can simply limit &lt;code>ollama-buddy-max-history-length&lt;/code> to control the total context size.&lt;/p>
&lt;p>For example, when working with small context windows, set &lt;code>ollama-buddy-max-history-length&lt;/code> to 1. This keeps only the last exchange (your prompt + model response), ensuring your context remains small and predictable, perfect for maintaining control without manual monitoring.&lt;/p>
&lt;p>&lt;strong>Scenario 4: Parameter num_ctx: Context window size in tokens&lt;/strong>&lt;/p>
&lt;p>Simply set this parameter and off you go!&lt;/p>
&lt;h3 id="current-status-experimental">Current Status: Experimental&lt;/h3>
&lt;p>Given the potentially limiting nature of context management, I&amp;rsquo;ve set this feature to &lt;strong>disabled by default&lt;/strong>.&lt;/p>
&lt;p>But to enable set the following :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-show-context-percentage &lt;span style="color:#66d9ef">t&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This means:&lt;/p>
&lt;ul>
&lt;li>Context checks won&amp;rsquo;t prevent sending prompts&lt;/li>
&lt;li>Context usage won&amp;rsquo;t appear in the status line&lt;/li>
&lt;li>However, calculations still run in the background, so &lt;code>C-c C&lt;/code> (Show Context Information) remains functional&lt;/li>
&lt;/ul>
&lt;p>As the feature matures and proves its value, I may enable it by default. For now, consider it an experimental addition that users can opt into.&lt;/p>
&lt;h3 id="more-details">More Details&lt;/h3>
&lt;p>The status bar now displays your current context usage in real-time. You&amp;rsquo;ll see a fraction showing used tokens versus the model&amp;rsquo;s maximum context size (e.g., &amp;ldquo;2048/8192&amp;rdquo;). The display automatically updates as your conversation grows.&lt;/p>
&lt;p>Context usage changes fontification to help you stay within limits:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Normal font&lt;/strong>: Normal usage (under 85%)&lt;/li>
&lt;li>&lt;strong>Bold and Underlined&lt;/strong>: Approaching limit (85-100%)&lt;/li>
&lt;li>&lt;strong>Inversed&lt;/strong>: At or exceeding limit (100%+)&lt;/li>
&lt;/ul>
&lt;p>Before sending prompts that exceed the context limit, Ollama Buddy now warns you and asks for confirmation. This prevents unexpected errors and helps you manage long conversations more effectively.&lt;/p>
&lt;p>There are now three new interactive commands:&lt;/p>
&lt;p>&lt;code>C-c $&lt;/code> - Set Model Context Size. Manually configure context sizes for custom or fine-tuned models.&lt;/p>
&lt;p>&lt;code>C-c %&lt;/code> - Toggle Context Display. Show or hide the context percentage in the status bar.&lt;/p>
&lt;p>&lt;code>C-c C&lt;/code> - Show Context Information. View a detailed breakdown of:&lt;/p>
&lt;ul>
&lt;li>All model context sizes&lt;/li>
&lt;li>Current token usage by category (history, system prompt, current prompt)&lt;/li>
&lt;li>Percentage usage&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>The system estimates token counts for:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Conversation history&lt;/strong>: All previous messages&lt;/li>
&lt;li>&lt;strong>System prompts&lt;/strong>: Your custom instructions&lt;/li>
&lt;li>&lt;strong>Current input&lt;/strong>: The message you&amp;rsquo;re about to send&lt;/li>
&lt;/ul>
&lt;p>This gives you a complete picture of your context usage before hitting send.&lt;/p>
&lt;p>The context monitoring is not enabled by default.&lt;/p>
&lt;h2 id="0-dot-9-dot-44">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-05 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.44&lt;/strong>&lt;/h2>
&lt;ul>
&lt;li>Sorted model names alphabetically in intro message&lt;/li>
&lt;li>Removed multishot writing to register name letters&lt;/li>
&lt;/ul>
&lt;p>For some reason, when I moved the .ollama folder to an external disk, the models returned with api/tags were inconsistent, which meant it broke consistent letter assignment. I&amp;rsquo;m not sure why this happened, but it is probably sensible to sort the models alphabetically anyway, as this has the benefit of naturally grouping together model families.&lt;/p>
&lt;p>I also removed the multishot feature of writing to the associated model letter. Now that I have to accommodate more than 26 models, incorporating them into the single-letter Emacs register system is all but impossible. I suspect this feature was not much used, and if you think about it, it wouldn&amp;rsquo;t have worked anyway with multiple model shots, as the register letter associated with the model would just show the most recent response. Due to these factors, I think I should remove this feature. If someone wants it back, I will probably have to design a bespoke version fully incorporated into the ollama-buddy system, as I can&amp;rsquo;t think of any other Emacs mechanism that could accommodate this.&lt;/p>
&lt;h2 id="0-dot-9-dot-43">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-05 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.43&lt;/strong>&lt;/h2>
&lt;p>Fix model reference error exceeding 26 models #15&lt;/p>
&lt;p>Update &lt;code>ollama-buddy&lt;/code> to handle more than 26 models by using prefixed combinations for model references beyond &amp;lsquo;z&amp;rsquo;. This prevents errors in &lt;code>create-intro-message&lt;/code> when the local server hosts a large number of models.&lt;/p>
&lt;h2 id="0-dot-9-dot-42">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-03 Sat&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.42&lt;/strong>&lt;/h2>
&lt;p>Added the following to recommended models:&lt;/p>
&lt;ul>
&lt;li>qwen3:0.6b&lt;/li>
&lt;li>qwen3:1.7b&lt;/li>
&lt;li>qwen3:4b&lt;/li>
&lt;li>qwen3:8b&lt;/li>
&lt;/ul>
&lt;p>and fixed pull model&lt;/p>
&lt;h2 id="0-dot-9-dot-41">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-02 Fri&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.41&lt;/strong>&lt;/h2>
&lt;p>Refactored model prefixing again so that when using only ollama models no prefix is applied and is only applied when online LLMs are selected (for example claude, chatGPT e.t.c)&lt;/p>
&lt;p>I think this makes more sense and is cleaner for I suspect the majority who may use this package are probably more interested in just using ollama models and the prefix will probably be a bit confusing.&lt;/p>
&lt;p>This could be a bit of a breaking change once again I&amp;rsquo;m afraid for those ollama users that have switched and are now familiar with prefixing &amp;ldquo;o:&amp;rdquo;, sorry!&lt;/p>
&lt;h2 id="0-dot-9-dot-40">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-05-02 Fri&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.40&lt;/strong>&lt;/h2>
&lt;p>Added vision support for those ollama models that can support it!&lt;/p>
&lt;p>Image files are now detected within a prompt and then processed if a model can support vision processing. Here&amp;rsquo;s a quick overview of how it works:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Configuration&lt;/strong>: Users can configure the application to enable vision support and specify which models and image formats are supported. Vision support is enabled by default.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Image Detection&lt;/strong>: When a prompt is submitted, the system automatically detects any image files referenced in the prompt.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Vision Processing&lt;/strong>: If the model supports vision, the detected images are processed in relation to the defined prompt. Note that the detection of a model being vision capable is defined in &lt;code>ollama-buddy-vision-models&lt;/code> and can be adjusted as required.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>In addition, a menu item has been added to the custom ollama buddy menu :&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil"> [I] Analyze an Image
&lt;/code>&lt;/pre>&lt;/li>
&lt;/ol>
&lt;p>When selected, it will allow you to describe a chosen image. At some stage, I may allow integration into &lt;code>dired&lt;/code>, which would be pretty neat. :)&lt;/p></description></item><item><title>Ollama-Buddy 0.9.38: Unload Models, Hide AI Reasoning, and Clearly View Modified Parameters on each request</title><link>https://www.emacs.dyerdwelling.family/emacs/20250501133351-emacs--ollama-buddy-0-9-38-unload-models-hide-ai-reasoning-and-clearly-view-modified-parameters-on-each-request/</link><pubDate>Thu, 01 May 2025 13:33:00 +0100</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250501133351-emacs--ollama-buddy-0-9-38-unload-models-hide-ai-reasoning-and-clearly-view-modified-parameters-on-each-request/</guid><description>&lt;p>More improvements to &lt;code>ollama-buddy&lt;/code> &lt;a href="https://github.com/captainflasmr/ollama-buddy">https://github.com/captainflasmr/ollama-buddy&lt;/a>&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;h2 id="0-dot-9-dot-38">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-29 Tue&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.38&lt;/strong>&lt;/h2>
&lt;p>Added model unloading functionality to free system resources&lt;/p>
&lt;ul>
&lt;li>Add unload capability for individual models via the model management UI&lt;/li>
&lt;li>Create keyboard shortcut (C-c C-u) for quick unloading of all models&lt;/li>
&lt;li>Display running model count and unload buttons in model management buffer&lt;/li>
&lt;/ul>
&lt;p>Large language models consume significant RAM and GPU memory while loaded. Until now, there wasn&amp;rsquo;t an easy way to reclaim these resources without restarting the Ollama server entirely. This new functionality allows you to:&lt;/p>
&lt;ul>
&lt;li>Free up GPU memory when you&amp;rsquo;re done with your LLM sessions&lt;/li>
&lt;li>Switch between resource-intensive tasks more fluidly&lt;/li>
&lt;li>Manage multiple models more efficiently on machines with limited resources&lt;/li>
&lt;li>Avoid having to restart the Ollama server just to clear memory&lt;/li>
&lt;/ul>
&lt;p>There are several ways to unload models with the new functionality:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Unload All Models&lt;/strong>: Press &lt;code>C-c C-u&lt;/code> to unload all running models at once (with confirmation)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Model Management Interface&lt;/strong>: Access the model management interface with &lt;code>C-c W&lt;/code> where you&amp;rsquo;ll find:&lt;/p>
&lt;ul>
&lt;li>A counter showing how many models are currently running&lt;/li>
&lt;li>An &amp;ldquo;Unload All&amp;rdquo; button to free all models at once&lt;/li>
&lt;li>Individual &amp;ldquo;Unload&amp;rdquo; buttons next to each running model&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Quick Access in Management Buffer&lt;/strong>: When in the model management buffer, simply press &lt;code>u&lt;/code> to unload all models&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>The unloading happens asynchronously in the background, with clear status indicators so you can see when the operation completes.&lt;/p>
&lt;h2 id="0-dot-9-dot-37">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-25 Fri&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.37&lt;/strong>&lt;/h2>
&lt;ul>
&lt;li>Display modified parameters in token stats&lt;/li>
&lt;/ul>
&lt;p>Enhanced the token statistics section to include any modified parameters, providing a clearer insight into the active configurations. This update helps in debugging and understanding the runtime environment.&lt;/p>
&lt;h2 id="0-dot-9-dot-36">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-25 Fri&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.36&lt;/strong>&lt;/h2>
&lt;p>Added Reasoning/Thinking section visibility toggle functionality&lt;/p>
&lt;ul>
&lt;li>Introduced the ability to hide reasoning/thinking sections during AI responses, making the chat output cleaner and more focused on final results&lt;/li>
&lt;li>Added a new customizable variable &lt;code>ollama-buddy-hide-reasoning&lt;/code> (default: nil) which controls visibility of reasoning sections&lt;/li>
&lt;li>Added &lt;code>ollama-buddy-reasoning-markers&lt;/code> to configure marker pairs that encapsulate reasoning sections (supports multiple formats like &amp;lt;think&amp;gt;&amp;lt;/think&amp;gt; or &amp;mdash;-)&lt;/li>
&lt;li>Added &lt;code>ollama-buddy-toggle-reasoning-visibility&lt;/code> interactive command to switch visibility on/off&lt;/li>
&lt;li>Added keybinding &lt;code>C-c V&lt;/code> for toggling reasoning visibility in chat buffer&lt;/li>
&lt;li>Added transient menu option &amp;ldquo;V&amp;rdquo; for toggling reasoning visibility&lt;/li>
&lt;li>When reasoning is hidden, a status message shows which section is being processed (e.g., &amp;ldquo;Think&amp;hellip;&amp;rdquo; or custom marker names)&lt;/li>
&lt;li>Reasoning sections are automatically detected during streaming responses&lt;/li>
&lt;li>Header line now indicates when reasoning is hidden with &amp;ldquo;REASONING HIDDEN&amp;rdquo; text&lt;/li>
&lt;li>All changes preserve streaming response functionality while providing cleaner output&lt;/li>
&lt;/ul>
&lt;p>This feature is particularly useful when working with AI models that output their &amp;ldquo;chain of thought&amp;rdquo; or reasoning process before providing the final answer, allowing users to focus on the end results while still having the option to see the full reasoning when needed.&lt;/p></description></item><item><title>Ollama-Buddy 0.9.35: Grok, Gemini Integration and Enhanced Sessions</title><link>https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--ollama-buddy-0-9-35-grok-gemini-integration-enhanced-sessions/</link><pubDate>Thu, 24 Apr 2025 09:20:00 +0100</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--ollama-buddy-0-9-35-grok-gemini-integration-enhanced-sessions/</guid><description>&lt;p>Several improvements in the latest Ollama Buddy updates (versions 0.9.21 through 0.9.35):&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250424085731-emacs--Ollama-Buddy-0-9-35-Grok-Gemini-Integration-Enhanced-Sessions.jpg" width="100%">
&lt;/figure>
&lt;h2 id="new-ai-integrations-with-grok-and-gemini">🎉 New AI Integrations with Grok and Gemini&lt;/h2>
&lt;ul>
&lt;li>Google&amp;rsquo;s Gemini is now complementing existing support for Claude, ChatGPT (OpenAI), and Ollama models. Setting up is straightforward and consistent with other integrations.&lt;/li>
&lt;li>Just like the existing integrations, Grok can now be easily configured with your API key.&lt;/li>
&lt;/ul>
&lt;!--more-->
&lt;h2 id="improved-remote-llm-architecture">🔗 Improved Remote LLM Architecture&lt;/h2>
&lt;p>LLM internal decoupling, making Ollama Buddy&amp;rsquo;s core logic independent from any specific remote LLM. Each LLM integration now functions as a self-contained extension, significantly simplifying future additions and maintenance.&lt;/p>
&lt;h2 id="standardized-model-prefixing">🎯 Standardized Model Prefixing&lt;/h2>
&lt;p>Now there are more remote LLMs into the mix I thought it was probably time to more clearly distinguish between model collections, so I have defined the following prefixes:&lt;/p>
&lt;ul>
&lt;li>Ollama: &lt;code>o:&lt;/code>&lt;/li>
&lt;li>ChatGPT: &lt;code>a:&lt;/code>&lt;/li>
&lt;li>Claude: &lt;code>c:&lt;/code>&lt;/li>
&lt;li>Gemini: &lt;code>g:&lt;/code>&lt;/li>
&lt;li>Grok: &lt;code>k:&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>This change helps ensure clarity, especially when recalling previous sessions. Note: existing session files will need the Ollama prefix (&lt;code>o:&lt;/code>) added manually if you encounter issues recalling older sessions.&lt;/p>
&lt;h2 id="enhanced-session-management">💾 Enhanced Session Management&lt;/h2>
&lt;p>Saving session now makes a little more sense and is more consistent:&lt;/p>
&lt;ul>
&lt;li>Automatic timestamped session names (you can still set your own).&lt;/li>
&lt;li>Sessions now also save as &lt;code>org&lt;/code> files alongside the original &lt;code>elisp&lt;/code> files, allowing for richer recall and easy inspection later.&lt;/li>
&lt;li>The current session name appears dynamically in your modeline, offering quick context.&lt;/li>
&lt;/ul>
&lt;h2 id="️-additional-improvements">🛠️ Additional Improvements&lt;/h2>
&lt;ul>
&lt;li>UTF-8 encoding fixes for remote LLM stream responses.&lt;/li>
&lt;li>Refactored history and model management so all the latest models are available for selection. This is currently most relevant for remote LLMs which often change their model selection.&lt;/li>
&lt;li>History view/edit functionality merged into one keybinding&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>and here is the change history&lt;/p>
&lt;h2 id="0-dot-9-dot-35">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-21 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.35&lt;/strong>&lt;/h2>
&lt;p>Added Grok support&lt;/p>
&lt;p>Integration is very similar to other remote AIs:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(use-package ollama-buddy
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :bind
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c o&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-menu)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c O&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-transient-menu-wrapper)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :custom
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-grok-api-key
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (auth-source-pick-first-password :host &lt;span style="color:#e6db74">&amp;#34;ollama-buddy-grok&amp;#34;&lt;/span> :user &lt;span style="color:#e6db74">&amp;#34;apikey&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :config
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (require &lt;span style="color:#e6db74">&amp;#39;ollama-buddy-grok&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> &lt;span style="color:#66d9ef">t&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="0-dot-9-dot-33">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-20 Sun&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.33&lt;/strong>&lt;/h2>
&lt;p>Fixed utf-8 encoding stream response issues from remote LLMs.&lt;/p>
&lt;h2 id="0-dot-9-dot-32">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-19 Sat&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.32&lt;/strong>&lt;/h2>
&lt;p>Finished the remote LLM decoupling process, meaning that the core &lt;code>ollama-buddy&lt;/code> logic is now not dependent on any remote LLM, and each remote LLM package is self-contained and functions as a unique extension.&lt;/p>
&lt;h2 id="0-dot-9-dot-31">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-18 Fri&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.31&lt;/strong>&lt;/h2>
&lt;p>Refactored model prefixing logic and cleaned up&lt;/p>
&lt;ul>
&lt;li>Standardized model prefixing by introducing distinct prefixes for Ollama (&lt;code>o:&lt;/code>), OpenAI (&lt;code>a:&lt;/code>), Claude (&lt;code>c:&lt;/code>), and Gemini (&lt;code>g:&lt;/code>) models.&lt;/li>
&lt;li>Centralized functions to get full model names with prefixes across different model types.&lt;/li>
&lt;li>Removed redundant and unused variables related to model management.&lt;/li>
&lt;/ul>
&lt;p>Note that there may be some breaking changes here especially regarding session recall as all models will now have a prefix to uniquely identify their type. For &lt;code>ollama&lt;/code> recall, just edit the session files to prepend the ollama prefix of &amp;ldquo;o:&amp;rdquo;&lt;/p>
&lt;h2 id="0-dot-9-dot-30">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-17 Thu&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.30&lt;/strong>&lt;/h2>
&lt;p>Added Gemini integration!&lt;/p>
&lt;p>As with the Claude and ChatGPT integration, you will need to add something similar to them in your configuration. I currently have the following set up to enable access to the remote LLMs:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(use-package ollama-buddy
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :bind
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c o&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-menu)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c O&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-transient-menu-wrapper)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :custom
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-openai-api-key
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (auth-source-pick-first-password :host &lt;span style="color:#e6db74">&amp;#34;ollama-buddy-openai&amp;#34;&lt;/span> :user &lt;span style="color:#e6db74">&amp;#34;apikey&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-claude-api-key
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (auth-source-pick-first-password :host &lt;span style="color:#e6db74">&amp;#34;ollama-buddy-claude&amp;#34;&lt;/span> :user &lt;span style="color:#e6db74">&amp;#34;apikey&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-gemini-api-key
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (auth-source-pick-first-password :host &lt;span style="color:#e6db74">&amp;#34;ollama-buddy-gemini&amp;#34;&lt;/span> :user &lt;span style="color:#e6db74">&amp;#34;apikey&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :config
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (require &lt;span style="color:#e6db74">&amp;#39;ollama-buddy-openai&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> &lt;span style="color:#66d9ef">t&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (require &lt;span style="color:#e6db74">&amp;#39;ollama-buddy-claude&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> &lt;span style="color:#66d9ef">t&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (require &lt;span style="color:#e6db74">&amp;#39;ollama-buddy-gemini&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> &lt;span style="color:#66d9ef">t&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Also with the previous update all the latest model names will be pulled, so there should be a full comprehensive list for each of the main remote AI LLMs!&lt;/p>
&lt;h2 id="0-dot-9-dot-23">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-16 Wed&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.23&lt;/strong>&lt;/h2>
&lt;p>Refactored history and model management for remote LLMs&lt;/p>
&lt;ul>
&lt;li>Now pulling in latest model list for remote LLMs (so now ChatGPT 4.1 is available!)&lt;/li>
&lt;li>Removed redundant history and model management functions from &lt;code>ollama-buddy-claude.el&lt;/code> and &lt;code>ollama-buddy-openai.el&lt;/code>. Replaced them with shared implementations to streamline code and reduce duplication&lt;/li>
&lt;/ul>
&lt;h2 id="0-dot-9-dot-22">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-15 Tue&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.22&lt;/strong>&lt;/h2>
&lt;p>Enhanced session management&lt;/p>
&lt;ul>
&lt;li>Refactored &lt;code>ollama-buddy-sessions-save&lt;/code> to autogenerate session names using timestamp and model.&lt;/li>
&lt;li>Improved session saving/loading by integrating org file handling.&lt;/li>
&lt;li>Updated mode line to display current session name dynamically.&lt;/li>
&lt;/ul>
&lt;p>Several improvements to session management, making it more intuitive and efficient for users. Here&amp;rsquo;s a breakdown of the new functionality:&lt;/p>
&lt;p>When saving a session, Ollama Buddy now creates a default name using the current timestamp and model name, users can still provide a custom name if desired.&lt;/p>
&lt;p>An org file is now saved alongside the original elisp session file. This allows for better session recall as all interactions will be pulled back with the underlying session parameters still restored as before. There is an additional benefit in not only recalling precisely the session and any additional org interactions but also quickly saving to an org file for potential later inspection. Along with the improved autogenerated session name, this means it is much faster and more intuitive to save a snapshot of the current chat interaction.&lt;/p>
&lt;p>The modeline now displays the current session name!&lt;/p>
&lt;h2 id="0-dot-9-dot-21">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-04-11 Fri&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.21&lt;/strong>&lt;/h2>
&lt;p>Add history edit/view toggle features, so effectively merging the former history display into the history edit functionality.&lt;/p></description></item><item><title>Ollama-Buddy 0.9.20: Curated AI Prompting with Awesome ChatGPT Prompts</title><link>https://www.emacs.dyerdwelling.family/emacs/20250409134339-emacs--ollama-buddy-0-9-20-curated-ai-prompting-with-awesome-chatgpt-prompts/</link><pubDate>Wed, 09 Apr 2025 13:43:00 +0100</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250409134339-emacs--ollama-buddy-0-9-20-curated-ai-prompting-with-awesome-chatgpt-prompts/</guid><description>&lt;ul>
&lt;li>Added &lt;code>ollama-buddy-awesome.el&lt;/code> to integrate Awesome ChatGPT Prompts.&lt;/li>
&lt;/ul>
&lt;p>&lt;code>ollama-buddy-awesome&lt;/code> is an &lt;code>ollama-buddy&lt;/code> extension that integrates the popular &lt;a href="https://github.com/f/awesome-chatgpt-prompts">Awesome ChatGPT Prompts&lt;/a> repository, allowing you to leverage hundreds of curated prompts for various tasks and roles right within your Emacs environment, I thought that since I have integrated the &lt;code>fabric&lt;/code> set of curated prompts, so then why not these!&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250325093201-emacs--Ollama-Buddy-0-9-11-Experimental-ChatGPT-Integration-Customizable-AI-Streaming-and-Texinfo-documentation.jpg" width="100%">
&lt;/figure>
&lt;p>There is a video demonstration here : &lt;a href="https://www.youtube.com/watch?v=5A4bTvjmPeo">https://www.youtube.com/watch?v=5A4bTvjmPeo&lt;/a>&lt;/p>
&lt;h2 id="key-features">Key Features&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Seamless Sync&lt;/strong>: Automatically fetch the latest prompts from the GitHub repository, ensuring you always have access to the most up-to-date collection.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Smart Categorization&lt;/strong>: Prompts are intelligently categorized based on their content, making it easy to find the perfect prompt for your task.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Interactive Selection&lt;/strong>: Choose prompts through Emacs&amp;rsquo; familiar completion interface, with category and title information for quick identification.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Effortless Application&lt;/strong>: Apply selected prompts as system prompts in ollama-buddy with a single command, streamlining your AI-assisted workflow.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Prompt Management&lt;/strong>: List available prompts, preview their content, and display full prompt details on demand.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h2 id="getting-started">Getting Started&lt;/h2>
&lt;p>To access the Awesome ChatGPT prompts, just select the transient menu as normal and select &amp;ldquo;[a] Awesome ChatGPT Prompts&amp;rdquo;, this will fetch the prompts and prepare everything for your first use and give you a transient menu as follows:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-text" data-lang="text">&lt;span style="display:flex;">&lt;span>Actions
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>[s] Send with Prompt
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>[p] Set as System Prompt
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>[l] List All Prompts
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>[c] Category Browser
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>[S] Sync Latest Prompts
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>[q] Back to Main Menu
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now available are a vast array of role-based and task-specific prompts, enhancing your &lt;code>ollama-buddy&lt;/code> interactions in Emacs!&lt;/p></description></item><item><title>Ollama-Buddy 0.9.11: Experimental ChatGPT Integration, Customizable Streaming and Texinfo documentation</title><link>https://www.emacs.dyerdwelling.family/emacs/20250325093201-emacs--ollama-buddy-0-9-11-experimental-chatgpt-integration-customizable-ai-streaming-and-texinfo-documentation/</link><pubDate>Tue, 25 Mar 2025 10:00:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250325093201-emacs--ollama-buddy-0-9-11-experimental-chatgpt-integration-customizable-ai-streaming-and-texinfo-documentation/</guid><description>&lt;p>This week in &lt;a href="https://github.com/captainflasmr/ollama-buddy">ollama-buddy&lt;/a> updates, I have mostly been experimenting with ChatGPT integration! Yes, it is not a local LLM, so not ollama, hence entirely subverting the whole notion and fundamental principles of this package! This I know, and I don&amp;rsquo;t care; I&amp;rsquo;m having fun. I use ChatGPT and would rather use it in Emacs through the now-familiar &lt;code>ollama-buddy&lt;/code> framework, so why not? I&amp;rsquo;m also working on Claude integration too.&lt;/p>
&lt;p>My original principles of a no-config Emacs ollama integration still hold true, as by default, you will only see ollama models available. But with a little tweak to the configuration, with a require here and an API key there, you can now enable communication with an online AI. At the moment, I use Claude and ChatGPT, but if I can get Claude working, I might think about just adding in a basic template framework to easily slot in others. At the moment, there is a little too much internal ollama-buddy faffing to incorporate these external AIs into the main package, but I&amp;rsquo;m sure I can figure out a way to accommodate separate elisp external AIs.&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250325093201-emacs--Ollama-Buddy-0-9-11-Experimental-ChatGPT-Integration-Customizable-AI-Streaming-and-Texinfo-documentation.jpg" width="100%">
&lt;/figure>
&lt;p>In other &lt;code>ollama-buddy&lt;/code> news, I have now added support for the &lt;code>stream&lt;/code> variable in the ollama API. By default, I had streaming on, and I guess why wouldn&amp;rsquo;t you? It is a chat, and you would want to see &amp;ldquo;typing&amp;rdquo; or tokens arriving as they come in?. But to support more of the API, you can toggle it on and off, so if you want, you can sit there and wait for the response to arrive in one go and maybe it can be less distracting (and possibly more efficient?).&lt;/p>
&lt;p>Just a note back on the topic of online AI offerings: to simplify those integrations, I just disabled streaming for the response to arrive in one shot. Mainly, I just couldn&amp;rsquo;t figure out the ChatGPT streaming, and for an external offering, I wasn&amp;rsquo;t quite willing to spend more time on it, and due to the speed of these online behemoths, do you really need to see each token come in as it arrives?&lt;/p>
&lt;p>Oh, there is something else too, something I have been itching to do for a while now, and that is to write a Texinfo document so a manual can be viewed in Emacs. Of course, this being an AI-based package, I fed in my &lt;code>ollama-buddy&lt;/code> files and got Claude to generate one for me (I have a baby and haven&amp;rsquo;t the time!). Reading through it, I think it turned out pretty well :) It hasn&amp;rsquo;t been made automatically available on MELPA yet, as I need to tweak the recipe, but you can install it for yourself.&lt;/p>
&lt;p>Anyways, see below for the changelog gubbins:&lt;/p>
&lt;h2 id="0-dot-9-dot-11">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-24 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.11&lt;/strong>&lt;/h2>
&lt;p>Added the ability to toggle streaming on and off&lt;/p>
&lt;ul>
&lt;li>Added customization option to enable/disable streaming mode&lt;/li>
&lt;li>Implemented toggle function with keybindings (C-c x) and transient menu option&lt;/li>
&lt;li>Added streaming status indicator in the modeline&lt;/li>
&lt;/ul>
&lt;p>The latest update introduces the ability to toggle between two response modes:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Streaming mode (default)&lt;/strong>: Responses appear token by token in real-time, giving you immediate feedback as the AI generates content.&lt;/li>
&lt;li>&lt;strong>Non-streaming mode&lt;/strong>: Responses only appear after they&amp;rsquo;re fully generated, showing a &amp;ldquo;Loading response&amp;hellip;&amp;rdquo; placeholder in the meantime.&lt;/li>
&lt;/ul>
&lt;p>While watching AI responses stream in real-time is often helpful, there are situations where you might prefer to see the complete response at once:&lt;/p>
&lt;ul>
&lt;li>When working on large displays where the cursor jumping around during streaming is distracting&lt;/li>
&lt;li>When you want to focus on your work without the distraction of incoming tokens until the full response is ready&lt;/li>
&lt;/ul>
&lt;p>The streaming toggle can be accessed in several ways:&lt;/p>
&lt;ol>
&lt;li>Use the keyboard shortcut &lt;code>C-c x&lt;/code>&lt;/li>
&lt;li>Press &lt;code>x&lt;/code> in the transient menu&lt;/li>
&lt;li>Set the default behaviour through customization:
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span> (setq ollama-buddy-streaming-enabled &lt;span style="color:#66d9ef">nil&lt;/span>) &lt;span style="color:#75715e">;; Disable streaming by default&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;/li>
&lt;/ol>
&lt;p>The current streaming status is visible in the modeline indicator, where an &amp;ldquo;X&amp;rdquo; appears when streaming is disabled.&lt;/p>
&lt;h2 id="0-dot-9-dot-10">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-22 Sat&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.10&lt;/strong>&lt;/h2>
&lt;p>Added experimental OpenAI support!&lt;/p>
&lt;p>Yes, that&amp;rsquo;s right, I said I never would do it, and of course, this package is still very much &lt;code>ollama&lt;/code>-centric, but I thought I would just sneak in some rudimentary ChatGPT support, just for fun!&lt;/p>
&lt;p>It is a very simple implementation, I haven&amp;rsquo;t managed to get streaming working, so Emacs will just show &amp;ldquo;Loading Response&amp;hellip;&amp;rdquo; as it waits for the response to arrive. It is asynchronous, however, so you can go off on your Emacs day while it loads (although being ChatGPT, you would think the response would be quite fast!)&lt;/p>
&lt;p>By default, OpenAI/ChatGPT will not be enabled, so anyone wanting to use just a local LLM through &lt;code>ollama&lt;/code> can continue as before. However, you can now sneak in some experimental ChatGPT support by adding the following to your Emacs config as part of the &lt;code>ollama-buddy&lt;/code> set up.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(require &lt;span style="color:#e6db74">&amp;#39;ollama-buddy-openai&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> &lt;span style="color:#66d9ef">t&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-openai-api-key &lt;span style="color:#e6db74">&amp;#34;&amp;lt;big long key&amp;gt;&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>and you can set the default model to ChatGPT too!&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(setq ollama-buddy-default-model &lt;span style="color:#e6db74">&amp;#34;GPT gpt-4o&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>With this enabled, chat will present a list of ChatGPT models to choose from. The custom menu should also now work with chat, so from anywhere in Emacs, you can push predefined prompts to the &lt;code>ollama&lt;/code> buddy chat buffer now supporting ChatGPT.&lt;/p>
&lt;p>There is more integration required to fully incorporate ChatGPT into the &lt;code>ollama&lt;/code> buddy system, like token rates and history, etc. But not bad for a first effort, methinks!&lt;/p>
&lt;p>Here is my current config, now mixing ChatGPT with &lt;code>ollama&lt;/code> models:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(use-package ollama-buddy
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :bind
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c o&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-menu)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c O&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-transient-menu-wrapper)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :custom
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-openai-api-key &lt;span style="color:#e6db74">&amp;#34;&amp;lt;very long key&amp;gt;&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-default-model &lt;span style="color:#e6db74">&amp;#34;GPT gpt-4o&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :config
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (require &lt;span style="color:#e6db74">&amp;#39;ollama-buddy-openai&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> &lt;span style="color:#66d9ef">t&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;refactor-code&lt;/span> :model &lt;span style="color:#e6db74">&amp;#34;qwen2.5-coder:7b&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;git-commit&lt;/span> :model &lt;span style="color:#e6db74">&amp;#34;qwen2.5-coder:3b&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;describe-code&lt;/span> :model &lt;span style="color:#e6db74">&amp;#34;qwen2.5-coder:3b&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;dictionary-lookup&lt;/span> :model &lt;span style="color:#e6db74">&amp;#34;llama3.2:3b&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;synonym&lt;/span> :model &lt;span style="color:#e6db74">&amp;#34;llama3.2:3b&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;proofread&lt;/span> :model &lt;span style="color:#e6db74">&amp;#34;GPT gpt-4o&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;custom-prompt&lt;/span> :model &lt;span style="color:#e6db74">&amp;#34;deepseek-r1:7b&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="0-dot-9-dot-9">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-22 Sat&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.9&lt;/strong>&lt;/h2>
&lt;p>Added texinfo documentation for future automatic installation through MELPA and created an Emacs manual.&lt;/p>
&lt;p>If you want to see what the manual would look like, just download the docs directory from github, cd into it, and run:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo make install-docs
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Then calling up &lt;code>info&lt;/code> &lt;code>C-h i&lt;/code> and ollama buddy will be present in the Emacs menu, or just select &lt;code>m&lt;/code> and search for &lt;code>Ollama Buddy&lt;/code>&lt;/p>
&lt;p>For those interested in the manual, I have converted it into html format, which is accessible here:&lt;/p>
&lt;p>&lt;a href="https://www.emacs.dyerdwelling.family/tags/ollama-buddy/">/tags/ollama-buddy/&lt;/a>&lt;/p>
&lt;p>It has been converted using the following command:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>makeinfo --html --no-split ollama-buddy.texi -o ollama-buddy.html
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pandoc -f html -t org -o ollama-buddy.org ollama-buddy.html
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="0-dot-9-dot-9">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-20 Thu&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.9&lt;/strong>&lt;/h2>
&lt;p>Intro message with model management options (select, pull, delete) and option for recommended models to pull&lt;/p>
&lt;ul>
&lt;li>Enhance model management and selection features&lt;/li>
&lt;li>Display models available for download but not yet pulled&lt;/li>
&lt;/ul></description></item><item><title>Ollama-Buddy 0.9.8: Transient Menu, Model Managing, GGUF Import, fabric Prompts and History Editing</title><link>https://www.emacs.dyerdwelling.family/emacs/20250319145359-emacs--ollama-buddy-0-9-8-transient-menu-model-managing-gguf-import-fabric-prompts/</link><pubDate>Wed, 19 Mar 2025 16:08:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250319145359-emacs--ollama-buddy-0-9-8-transient-menu-model-managing-gguf-import-fabric-prompts/</guid><description>&lt;p>This week in &lt;a href="https://github.com/captainflasmr/ollama-buddy">ollama-buddy&lt;/a> updates, I have been continuing on the busy bee side of things.&lt;/p>
&lt;p>The headlines are :&lt;/p>
&lt;ul>
&lt;li>Transient menu - yes, I know I said I would never do it, but, well I did and as it turns out I kinda quite like it and works especially well when setting parameters.&lt;/li>
&lt;li>Support for &lt;code>fabric&lt;/code> prompts presets - mainly as I thought generally user curated prompts was a pretty cool idea, and now I have system prompts implemented it seemed like a perfect fit. All I needed to do was to pull the patterns directory and then parse accordingly, of course Emacs is good at this.&lt;/li>
&lt;li>GGUF import - I don&amp;rsquo;t always pull from ollama&amp;rsquo;s command line, sometimes I download a GGUF file, it is a bit of a process to import to ollama, create a model file, run a command, e.t.c, but now you can import from within &lt;code>dired&lt;/code>!&lt;/li>
&lt;li>More support for the &lt;code>ollama&lt;/code> API - includes model management, so pulling, stopping, deleting and more!&lt;/li>
&lt;li>Conversation history editing - as I store the history in a hash table, I can easily just display an alist, and editing can leverage the &lt;code>sexp&lt;/code> usual keybindings and then load back in to the variable.&lt;/li>
&lt;li>Parameter profiles - When implementing the transient menu I thought it might be fun to try parameter profiles where a set of parameters can be applied in a block for each preset.&lt;/li>
&lt;/ul>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250319145359-emacs--Ollama-Buddy-0-9-8-Transient-Menu-Model-managing-GGUF-import-fabric-prompts.jpg" width="100%">
&lt;/figure>
&lt;p>And now for the detail, version by version&amp;hellip;&lt;/p>
&lt;h2 id="0-dot-9-dot-8">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-19 Wed&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.8&lt;/strong>&lt;/h2>
&lt;p>Added model management interface to pull and delete models&lt;/p>
&lt;ul>
&lt;li>Introduced `ollama-buddy-manage-models` to list and manage models.&lt;/li>
&lt;li>Added actions for selecting, pulling, stopping, and deleting models.&lt;/li>
&lt;/ul>
&lt;p>You can now manage your Ollama models directly within Emacs with &lt;code>ollama-buddy&lt;/code>&lt;/p>
&lt;p>With this update, you can now:&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Browse Available Models&lt;/strong> – See all installed models at a glance.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Select Models Easily&lt;/strong> – Set your active AI model with a single click.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Pull Models from Ollama Hub&lt;/strong> – Download new models or update existing ones.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Stop Running Models&lt;/strong> – Halt background processes when necessary.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Delete Unused Models&lt;/strong> – Clean up your workspace with ease.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Open the Model Management Interface&lt;/strong>
Press &lt;strong>&lt;code>C-c W&lt;/code>&lt;/strong> to launch the new &lt;strong>Model Management&lt;/strong> buffer or through the transient menu.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Manage Your Models&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Click on a model to &lt;strong>select&lt;/strong> it.&lt;/li>
&lt;li>Use &lt;strong>&amp;ldquo;Pull&amp;rdquo;&lt;/strong> to fetch models from the Ollama Hub.&lt;/li>
&lt;li>Click &lt;strong>&amp;ldquo;Stop&amp;rdquo;&lt;/strong> to halt active models.&lt;/li>
&lt;li>Use &lt;strong>&amp;ldquo;Delete&amp;rdquo;&lt;/strong> to remove unwanted models.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Perform Quick Actions&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&lt;code>g&lt;/code>&lt;/strong> → Refresh the model list.&lt;/li>
&lt;li>&lt;strong>&lt;code>i&lt;/code>&lt;/strong> → Import a &lt;strong>GGUF model file&lt;/strong>.&lt;/li>
&lt;li>&lt;strong>&lt;code>p&lt;/code>&lt;/strong> → Pull a new model from the &lt;strong>Ollama Hub&lt;/strong>.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;p>When you open the management interface, you get a structured list like this:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">Ollama Models Management
=======================
Current Model: mistral:7b
Default Model: mistral:7b
Available Models:
[ ] llama3.2:1b Info Pull Delete
[ ] starcoder2:3b Info Pull Delete
[ ] codellama:7b Info Pull Delete
[ ] phi3:3.8b Info Pull Delete
[x] llama3.2:3b Info Pull Delete Stop
Actions:
[Import GGUF File] [Refresh List] [Pull Model from Hub]
&lt;/code>&lt;/pre>&lt;p>Previously, managing Ollama models required manually running shell commands. With this update, you can now &lt;strong>do it all from Emacs&lt;/strong>, keeping your workflow smooth and efficient!&lt;/p>
&lt;h2 id="0-dot-9-dot-7">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-19 Wed&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.7&lt;/strong>&lt;/h2>
&lt;ul>
&lt;li>Added GGUF file import and Dired integration&lt;/li>
&lt;/ul>
&lt;p>Import GGUF Models into Ollama from &lt;code>dired&lt;/code> with the new &lt;code>ollama-buddy-import-gguf-file&lt;/code> function. In &lt;code>dired&lt;/code> just navigate to your file and press &lt;code>C-c i&lt;/code> or &lt;code>M-x ollama-buddy-import-gguf-file&lt;/code> to start the import process. This eliminates the need to manually input file paths, making the workflow smoother and faster.&lt;/p>
&lt;p>The model will then be immediately available in the &lt;code>ollama-buddy&lt;/code> chat interface.&lt;/p>
&lt;h2 id="0-dot-9-dot-6">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-18 Tue&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.6&lt;/strong>&lt;/h2>
&lt;ul>
&lt;li>Added a transient menu containing all commands currently presented in the chat buffer&lt;/li>
&lt;li>Added fabric prompting support, see &lt;a href="https://github.com/danielmiessler/fabric">https://github.com/danielmiessler/fabric&lt;/a>&lt;/li>
&lt;li>Moved the presets to the top level so they will be present in the package folder&lt;/li>
&lt;/ul>
&lt;p>Ollama Buddy now includes a transient-based menu system to improve usability and streamline interactions. Yes, I originally stated that I would never do it, but I think it compliments my crafted simple textual menu and the fact that I have now defaulted the main chat interface to a simple menu.&lt;/p>
&lt;p>This can give the user more options for configuration, they can use the chat in advanced mode where the keybindings are presented in situ, or a more minimal basic setup where the transient menu can be activated. For my use-package definition I current have the following set up, with the two styles of menus sitting alongside each other :&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span> :bind
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c o&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-menu)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (&lt;span style="color:#e6db74">&amp;#34;C-c O&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-transient-menu)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The new menu provides an organized interface for accessing the assistant’s core functions, including chat, model management, roles, and Fabric patterns. This post provides an overview of the features available in the Ollama Buddy transient menus.&lt;/p>
&lt;p>Yes that&amp;rsquo;s right also &lt;code>fabric&lt;/code> patterns!, I have decided to add in auto syncing of the patterns directory in &lt;a href="https://github.com/danielmiessler/fabric">https://github.com/danielmiessler/fabric&lt;/a>&lt;/p>
&lt;p>Simply I pull the patterns directory which contain prompt guidance for a range of different topics and then push them through a completing read to set the &lt;code>ollama-buddy&lt;/code> system prompt, so a special set of curated prompts can now be applied right in the &lt;code>ollama-buddy&lt;/code> chat!&lt;/p>
&lt;p>Anyways, here is a description of the transient menu system.&lt;/p>
&lt;h3 id="what-is-the-transient-menu">What is the Transient Menu?&lt;/h3>
&lt;p>The transient menu in Ollama Buddy leverages Emacs&amp;rsquo; &lt;code>transient.el&lt;/code> package (the same technology behind Magit&amp;rsquo;s popular interface) to create a hierarchical, discoverable menu system. This approach transforms the user experience from memorizing numerous keybindings to navigating through logical groups of commands with clear descriptions.&lt;/p>
&lt;h3 id="accessing-the-menu">Accessing the Menu&lt;/h3>
&lt;p>The main transient menu can be accessed with the keybinding &lt;code>C-c O&lt;/code> when in an Ollama Buddy chat buffer. You can also call it via &lt;code>M-x ollama-buddy-transient-menu&lt;/code> from anywhere in Emacs.&lt;/p>
&lt;h3 id="what-the-menu-looks-like">What the Menu Looks Like&lt;/h3>
&lt;p>When called, the main transient menu appears at the bottom of your Emacs frame, organized into logical sections with descriptive prefixes. Here&amp;rsquo;s what you&amp;rsquo;ll see:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">|o(Y)o| Ollama Buddy
[Chat] [Prompts] [Model] [Roles &amp;amp; Patterns]
o Open Chat l Send Region m Switch Model R Switch Roles
O Commands s Set System Prompt v View Model Status E Create New Role
RET Send Prompt C-s Show System i Show Model Info D Open Roles Directory
h Help/Menu r Reset System M Multishot f Fabric Patterns
k Kill/Cancel b Ollama Buddy Menu
[Display Options] [History] [Sessions] [Parameters]
A Toggle Interface Level H Toggle History N New Session P Edit Parameter
B Toggle Debug Mode X Clear History L Load Session G Display Parameters
T Toggle Token Display V Display History S Save Session I Parameter Help
U Display Token Stats J Edit History Q List Sessions K Reset Parameters
C-o Toggle Markdown-&amp;gt;Org Z Delete Session F Toggle Params in Header
c Toggle Model Colors p Parameter Profiles
g Token Usage Graph
&lt;/code>&lt;/pre>&lt;p>This visual layout makes it easy to discover and access the full range of Ollama Buddy&amp;rsquo;s functionality. Let&amp;rsquo;s explore each section in detail.&lt;/p>
&lt;h3 id="menu-sections-explained">Menu Sections Explained&lt;/h3>
&lt;h4 id="chat-section">Chat Section&lt;/h4>
&lt;p>This section contains the core interaction commands:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Open Chat (o)&lt;/strong>: Opens the Ollama Buddy chat buffer&lt;/li>
&lt;li>&lt;strong>Commands (O)&lt;/strong>: Opens a submenu with specialized commands&lt;/li>
&lt;li>&lt;strong>Send Prompt (RET)&lt;/strong>: Sends the current prompt to the model&lt;/li>
&lt;li>&lt;strong>Help/Menu (h)&lt;/strong>: Displays the help assistant with usage tips&lt;/li>
&lt;li>&lt;strong>Kill/Cancel Request (k)&lt;/strong>: Cancels the current ongoing request&lt;/li>
&lt;/ul>
&lt;h4 id="prompts-section">Prompts Section&lt;/h4>
&lt;p>These commands help you manage and send prompts:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Send Region (l)&lt;/strong>: Sends the selected region as a prompt&lt;/li>
&lt;li>&lt;strong>Set System Prompt (s)&lt;/strong>: Sets the current prompt as a system prompt&lt;/li>
&lt;li>&lt;strong>Show System Prompt (C-s)&lt;/strong>: Displays the current system prompt&lt;/li>
&lt;li>&lt;strong>Reset System Prompt (r)&lt;/strong>: Resets the system prompt to default&lt;/li>
&lt;li>&lt;strong>Ollama Buddy Menu (b)&lt;/strong>: Opens the classic menu interface&lt;/li>
&lt;/ul>
&lt;h4 id="model-section">Model Section&lt;/h4>
&lt;p>Commands for model management:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Switch Model (m)&lt;/strong>: Changes the active LLM&lt;/li>
&lt;li>&lt;strong>View Model Status (v)&lt;/strong>: Shows status of all available models&lt;/li>
&lt;li>&lt;strong>Show Model Info (i)&lt;/strong>: Displays detailed information about the current model&lt;/li>
&lt;li>&lt;strong>Multishot (M)&lt;/strong>: Sends the same prompt to multiple models&lt;/li>
&lt;/ul>
&lt;h4 id="roles-and-patterns-section">Roles &amp;amp; Patterns Section&lt;/h4>
&lt;p>These commands help manage roles and use fabric patterns:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Switch Roles (R)&lt;/strong>: Switch to a different predefined role&lt;/li>
&lt;li>&lt;strong>Create New Role (E)&lt;/strong>: Create a new role interactively&lt;/li>
&lt;li>&lt;strong>Open Roles Directory (D)&lt;/strong>: Open the directory containing role definitions&lt;/li>
&lt;li>&lt;strong>Fabric Patterns (f)&lt;/strong>: Opens the submenu for Fabric patterns&lt;/li>
&lt;/ul>
&lt;p>When you select the Fabric Patterns option, you&amp;rsquo;ll see a submenu like this:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">Fabric Patterns (42 available, last synced: 2025-03-18 14:30)
[Actions] [Sync] [Categories] [Navigation]
s Send with Pattern S Sync Latest u Universal Patterns q Back to Main Menu
p Set as System P Populate Cache c Code Patterns
l List All Patterns I Initial Setup w Writing Patterns
v View Pattern Details a Analysis Patterns
&lt;/code>&lt;/pre>&lt;h4 id="display-options-section">Display Options Section&lt;/h4>
&lt;p>Commands to customize the display:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Toggle Interface Level (A)&lt;/strong>: Switch between basic and advanced interfaces&lt;/li>
&lt;li>&lt;strong>Toggle Debug Mode (B)&lt;/strong>: Enable/disable JSON debug information&lt;/li>
&lt;li>&lt;strong>Toggle Token Display (T)&lt;/strong>: Show/hide token usage statistics&lt;/li>
&lt;li>&lt;strong>Display Token Stats (U)&lt;/strong>: Show detailed token usage information&lt;/li>
&lt;li>&lt;strong>Toggle Markdown-&amp;gt;Org (C-o)&lt;/strong>: Enable/disable conversion to Org format&lt;/li>
&lt;li>&lt;strong>Toggle Model Colors (c)&lt;/strong>: Enable/disable model-specific colors&lt;/li>
&lt;li>&lt;strong>Token Usage Graph (g)&lt;/strong>: Display a visual graph of token usage&lt;/li>
&lt;/ul>
&lt;h4 id="history-section">History Section&lt;/h4>
&lt;p>Commands for managing conversation history:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Toggle History (H)&lt;/strong>: Enable/disable conversation history&lt;/li>
&lt;li>&lt;strong>Clear History (X)&lt;/strong>: Clear the current history&lt;/li>
&lt;li>&lt;strong>Display History (V)&lt;/strong>: Show the conversation history&lt;/li>
&lt;li>&lt;strong>Edit History (J)&lt;/strong>: Edit the history in a buffer&lt;/li>
&lt;/ul>
&lt;h4 id="sessions-section">Sessions Section&lt;/h4>
&lt;p>Commands for session management:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>New Session (N)&lt;/strong>: Start a new session&lt;/li>
&lt;li>&lt;strong>Load Session (L)&lt;/strong>: Load a saved session&lt;/li>
&lt;li>&lt;strong>Save Session (S)&lt;/strong>: Save the current session&lt;/li>
&lt;li>&lt;strong>List Sessions (Q)&lt;/strong>: List all available sessions&lt;/li>
&lt;li>&lt;strong>Delete Session (Z)&lt;/strong>: Delete a saved session&lt;/li>
&lt;/ul>
&lt;h4 id="parameters-section">Parameters Section&lt;/h4>
&lt;p>Commands for managing model parameters:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Edit Parameter (P)&lt;/strong>: Opens a submenu to edit specific parameters&lt;/li>
&lt;li>&lt;strong>Display Parameters (G)&lt;/strong>: Show current parameter settings&lt;/li>
&lt;li>&lt;strong>Parameter Help (I)&lt;/strong>: Display help information about parameters&lt;/li>
&lt;li>&lt;strong>Reset Parameters (K)&lt;/strong>: Reset parameters to defaults&lt;/li>
&lt;li>&lt;strong>Toggle Params in Header (F)&lt;/strong>: Show/hide parameters in header&lt;/li>
&lt;li>&lt;strong>Parameter Profiles (p)&lt;/strong>: Opens the parameter profiles submenu&lt;/li>
&lt;/ul>
&lt;p>When you select the Edit Parameter option, you&amp;rsquo;ll see a comprehensive submenu of all available parameters:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">Parameters
[Generation] [More Generation] [Mirostat]
t Temperature f Frequency Penalty M Mirostat Mode
k Top K s Presence Penalty T Mirostat Tau
p Top P n Repeat Last N E Mirostat Eta
m Min P x Stop Sequences
y Typical P l Penalize Newline
r Repeat Penalty
[Resource] [More Resource] [Memory]
c Num Ctx P Num Predict m Use MMAP
b Num Batch S Seed L Use MLOCK
g Num GPU N NUMA C Num Thread
G Main GPU V Low VRAM
K Num Keep o Vocab Only
[Profiles] [Actions]
d Default Profile D Display All
a Creative Profile R Reset All
e Precise Profile H Help
A All Profiles F Toggle Display in Header
q Back to Main Menu
&lt;/code>&lt;/pre>&lt;h3 id="parameter-profiles">Parameter Profiles&lt;/h3>
&lt;p>Ollama Buddy includes predefined parameter profiles that can be applied with a single command. When you select &amp;ldquo;Parameter Profiles&amp;rdquo; from the main menu, you&amp;rsquo;ll see:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">Parameter Profiles
Current modified parameters: temperature, top_k, top_p
[Available Profiles]
d Default
c Creative
p Precise
[Actions]
q Back to Main Menu
&lt;/code>&lt;/pre>&lt;h3 id="commands-submenu">Commands Submenu&lt;/h3>
&lt;p>The Commands submenu provides quick access to specialized operations:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">Ollama Buddy Commands
[Code Operations] [Language Operations] [Pattern-based] [Custom]
r Refactor Code l Dictionary Lookup f Fabric Patterns C Custom Prompt
d Describe Code s Synonym Lookup u Universal Patterns m Minibuffer Prompt
g Git Commit Message p Proofread Text c Code Patterns
[Actions]
q Back to Main Menu
&lt;/code>&lt;/pre>&lt;h3 id="direct-keybindings">Direct Keybindings&lt;/h3>
&lt;p>For experienced users who prefer direct keybindings, all transient menu functions can also be accessed through keybindings with the prefix of your choice (or &lt;code>C-c O&lt;/code> when in the chat minibuffer) followed by the key shown in the menu. For example:&lt;/p>
&lt;ul>
&lt;li>&lt;code>C-c O s&lt;/code> - Set system prompt&lt;/li>
&lt;li>&lt;code>C-c O m&lt;/code> - Switch model&lt;/li>
&lt;li>&lt;code>C-c O P&lt;/code> - Open parameter menu&lt;/li>
&lt;/ul>
&lt;h3 id="customization">Customization&lt;/h3>
&lt;p>The transient menu can be customized by modifying the &lt;code>transient-define-prefix&lt;/code> definitions in the package. You can add, remove, or rearrange commands to suit your workflow.&lt;/p>
&lt;h2 id="0-dot-9-dot-5">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-17 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.5&lt;/strong>&lt;/h2>
&lt;p>Added conversation history editing&lt;/p>
&lt;ul>
&lt;li>Added functions to edit conversation history (&lt;code>ollama-buddy-history-edit&lt;/code>, &lt;code>ollama-buddy-history-save&lt;/code>, etc.).&lt;/li>
&lt;li>Updated &lt;code>ollama-buddy-display-history&lt;/code> to support history editing.&lt;/li>
&lt;li>Added keybinding &lt;code>C-c E&lt;/code> for history editing.&lt;/li>
&lt;/ul>
&lt;p>Introducing conversation history editing!!&lt;/p>
&lt;p>&lt;strong>Key Features&lt;/strong>&lt;/p>
&lt;p>Now, you can directly modify past interactions, making it easier to refine and manage your &lt;code>ollama-buddy&lt;/code> chat history.&lt;/p>
&lt;p>Previously, conversation history was static, you could view it but not change it. With this update, you can now:&lt;/p>
&lt;ul>
&lt;li>Edit conversation history directly in a buffer.&lt;/li>
&lt;li>Modify past interactions for accuracy or clarity.&lt;/li>
&lt;li>Save or discard changes with intuitive keybindings (&lt;code>C-c C-c&lt;/code> to save, &lt;code>C-c C-k&lt;/code> to cancel).&lt;/li>
&lt;li>Edit the history of all models or a specific one.&lt;/li>
&lt;/ul>
&lt;p>Simply use the new command &lt;strong>&lt;code>C-c E&lt;/code>&lt;/strong> to open the conversation history editor. This will display your past interactions in an editable format (alist). Once you’ve made your changes, press &lt;code>C-c C-c&lt;/code> to save them back into Ollama Buddy’s memory.&lt;/p>
&lt;p>and with a universal argument you can leverage &lt;code>C-c E&lt;/code> to edit an individual model.&lt;/p>
&lt;h2 id="0-dot-9-dot-1">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-17 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.1&lt;/strong>&lt;/h2>
&lt;p>New simple basic interface is available.&lt;/p>
&lt;p>As this package becomes more advanced, I&amp;rsquo;ve been adding more to the intro message, making it increasingly cluttered. This could be off-putting for users who just want a simple interface to a local LLM via Ollama.&lt;/p>
&lt;p>Therefore I have decided to add a customization option to simplify the menu.&lt;/p>
&lt;p>Note: all functionality will still be available through keybindings, so just like Emacs then! :)&lt;/p>
&lt;p>Note: some could see this initially as a breaking change as the intro message will look different, but rest assured all the functionality is still there (just to re-emphasize), so if you have been using it before and want the original functionality/intro message, just set :&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">(setq ollama-buddy-interface-level &amp;#39;advanced)
&lt;/code>&lt;/pre>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(defcustom ollama-buddy-interface-level &lt;span style="color:#e6db74">&amp;#39;basic&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;Level of interface complexity to display.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74">&amp;#39;basic shows minimal commands for new users.
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#e6db74">&amp;#39;advanced shows all available commands and features.&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :type &lt;span style="color:#f92672">&amp;#39;&lt;/span>(choice (const :tag &lt;span style="color:#e6db74">&amp;#34;Basic (for beginners)&amp;#34;&lt;/span> basic)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (const :tag &lt;span style="color:#e6db74">&amp;#34;Advanced (full features)&amp;#34;&lt;/span> advanced))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :group &lt;span style="color:#e6db74">&amp;#39;ollama-buddy&lt;/span>)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>By default the menu will be set to Basic, unless obviously set explictly in an init file. Here is an example of the basic menu:&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">*** Welcome to OLLAMA BUDDY
#+begin_example
___ _ _ n _ n ___ _ _ _ _
| | | |__._|o(Y)o|__._| . |_ _ _| |_| | | |
| | | | | . | | . | . | | | . | . |__ |
|___|_|_|__/_|_|_|_|__/_|___|___|___|___|___|
#+end_example
**** Available Models
(a) another:latest (d) jamesio:latest
(b) funnyname2:latest (e) tinyllama:latest
(c) funnyname:latest (f) llama:latest
**** Quick Tips
- Ask me anything! C-c C-c
- Change model C-c m
- Cancel request C-c k
- Browse prompt history M-p/M-n
- Advanced interface (show all tips) C-c A
&lt;/code>&lt;/pre>&lt;p>and of the more advanced version&lt;/p>
&lt;pre tabindex="0">&lt;code class="language-nil" data-lang="nil">*** Welcome to OLLAMA BUDDY
#+begin_example
___ _ _ n _ n ___ _ _ _ _
| | | |__._|o(Y)o|__._| . |_ _ _| |_| | | |
| | | | | . | | . | . | | | . | . |__ |
|___|_|_|__/_|_|_|_|__/_|___|___|___|___|___|
#+end_example
**** Available Models
(a) another:latest (d) jamesio:latest
(b) funnyname2:latest (e) tinyllama:latest
(c) funnyname:latest (f) llama:latest
**** Quick Tips
- Ask me anything! C-c C-c
- Show Help/Token-usage/System-prompt C-c h/U/C-s
- Model Change/Info/Cancel C-c m/i/k
- Prompt history M-p/M-n
- Session New/Load/Save/List/Delete C-c N/L/S/Y/W
- History Toggle/Clear/Show C-c H/X/V
- Prompt to multiple models C-c l
- Parameter Edit/Show/Help/Reset C-c P/G/I/K
- System Prompt/Clear C-u/+C-u +C-u C-c C-c
- Toggle JSON/Token/Params/Format C-c D/T/Z/C-o
- Basic interface (simpler display) C-c A
- In another buffer? M-x ollama-buddy-menu
&lt;/code>&lt;/pre>&lt;h2 id="0-dot-9-dot-0">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-17 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.9.0&lt;/strong>&lt;/h2>
&lt;p>Added command-specific parameter customization&lt;/p>
&lt;ul>
&lt;li>Added :parameters property to command definitions for granular control&lt;/li>
&lt;li>Implemented functions to apply and restore parameter settings&lt;/li>
&lt;li>Added example configuration to refactor-code command&lt;/li>
&lt;/ul>
&lt;p>With the latest update, you can now define specific parameter sets for each command in the menu, enabling you to optimize each AI interaction for its particular use case.&lt;/p>
&lt;p>Different AI tasks benefit from different parameter settings. When refactoring code, you might want a more deterministic, precise response (lower temperature, higher repetition penalty), but when generating creative content, you might prefer more variation and randomness (higher temperature, lower repetition penalty). Previously, you had to manually adjust these parameters each time you switched between different types of tasks.&lt;/p>
&lt;p>The new command-specific parameters feature lets you pre-configure the optimal settings for each use case. Here&amp;rsquo;s how it works:&lt;/p>
&lt;h3 id="key-features">Key Features&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Per-Command Parameter Sets&lt;/strong>: Define custom parameter values for each command in your menu&lt;/li>
&lt;li>&lt;strong>Automatic Application&lt;/strong>: Parameters are applied when running a command and restored afterward&lt;/li>
&lt;li>&lt;strong>Non-Destructive&lt;/strong>: Your global parameter settings remain untouched&lt;/li>
&lt;li>&lt;strong>Easy Configuration&lt;/strong>: Simple interface for adding or updating parameters&lt;/li>
&lt;/ul>
&lt;h3 id="example-configuration">Example Configuration&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">;; Define a command with specific parameters&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>(refactor-code
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :key &lt;span style="color:#e6db74">?r&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :description &lt;span style="color:#e6db74">&amp;#34;Refactor code&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :prompt &lt;span style="color:#e6db74">&amp;#34;refactor the following code:&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :system &lt;span style="color:#e6db74">&amp;#34;You are an expert software engineer...&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :parameters ((temperature &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">0.2&lt;/span>) (top_p &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">0.7&lt;/span>) (repeat_penalty &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">1.3&lt;/span>))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :action (lambda () (ollama-buddy--send-with-command &lt;span style="color:#e6db74">&amp;#39;refactor-code&lt;/span>)))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">;; Add parameters to an existing command&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>(ollama-buddy-add-parameters-to-command &lt;span style="color:#e6db74">&amp;#39;git-commit&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :temperature &lt;span style="color:#ae81ff">0.4&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :top_p &lt;span style="color:#ae81ff">0.9&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :repeat_penalty &lt;span style="color:#ae81ff">1.1&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">;; Update properties and parameters at once&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>(ollama-buddy-update-command-with-params &lt;span style="color:#e6db74">&amp;#39;describe-code&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :model &lt;span style="color:#e6db74">&amp;#34;codellama:latest&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :parameters &lt;span style="color:#f92672">&amp;#39;&lt;/span>((temperature &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">0.3&lt;/span>) (top_p &lt;span style="color:#f92672">.&lt;/span> &lt;span style="color:#ae81ff">0.8&lt;/span>)))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This feature is particularly useful for:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Code-related tasks&lt;/strong>: Lower temperature for more deterministic code generation&lt;/li>
&lt;li>&lt;strong>Creative writing&lt;/strong>: Higher temperature for more varied and creative outputs&lt;/li>
&lt;li>&lt;strong>Technical explanations&lt;/strong>: Balanced settings for clear, accurate explanations&lt;/li>
&lt;li>&lt;strong>Summarization tasks&lt;/strong>: Custom parameters to control verbosity and focus&lt;/li>
&lt;/ol>
&lt;h2 id="0-dot-8-dot-5">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-16 Sun&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.8.5&lt;/strong>&lt;/h2>
&lt;p>Added system prompt support for commands&lt;/p>
&lt;ul>
&lt;li>Introduced `:system` field to command definitions.&lt;/li>
&lt;li>Added `ollama-buddy-show-system-prompt` to view active system prompt.&lt;/li>
&lt;li>Updated UI elements to reflect system prompt status.&lt;/li>
&lt;/ul>
&lt;p>Previously, individual menu commands in &lt;code>ollama-buddy&lt;/code> only included a user prompt. Now, each command can define a &lt;strong>system prompt&lt;/strong>, which provides background context to guide the AI&amp;rsquo;s responses. This makes interactions more precise and tailored.&lt;/p>
&lt;p>&lt;strong>Key Features&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>System prompts per command&lt;/strong>: Specify background instructions for each AI-powered command using the new &lt;code>:system&lt;/code> field.&lt;/li>
&lt;li>&lt;strong>View active system prompt&lt;/strong>: Use &lt;code>C-c C-s&lt;/code> to display the current system prompt in a dedicated buffer.&lt;/li>
&lt;li>&lt;strong>Updated UI elements&lt;/strong>: The status line now indicates whether a system prompt is active.&lt;/li>
&lt;/ul>
&lt;p>A helper function has also been added to update the default menu, for example, you might want to tweak a couple of things:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(use-package ollama-buddy
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :bind (&lt;span style="color:#e6db74">&amp;#34;C-c o&amp;#34;&lt;/span> &lt;span style="color:#f92672">.&lt;/span> ollama-buddy-menu)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :custom
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-default-model &lt;span style="color:#e6db74">&amp;#34;llama3.2:3b&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :config
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;refactor-code&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :model &lt;span style="color:#e6db74">&amp;#34;qwen2.5-coder:7b&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :system &lt;span style="color:#e6db74">&amp;#34;You are an expert software engineer who improves code and only mainly using the principles exhibited by Ada&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-update-menu-entry
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#39;git-commit&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :model &lt;span style="color:#e6db74">&amp;#34;qwen2.5-coder:3b&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> :system &lt;span style="color:#e6db74">&amp;#34;You are a version control expert and mainly using subversion&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Ollama-Buddy 0.8.0 - Added System Prompts, Model Info and simpler menu model assignment</title><link>https://www.emacs.dyerdwelling.family/emacs/20250314132104-emacs--ollama-buddy-0-8-0-added-system-prompts-model-info-and-simpler-menu-model-assignment/</link><pubDate>Fri, 14 Mar 2025 13:21:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250314132104-emacs--ollama-buddy-0-8-0-added-system-prompts-model-info-and-simpler-menu-model-assignment/</guid><description>&lt;p>More improvements to &lt;code>ollama-buddy&lt;/code> &lt;a href="https://github.com/captainflasmr/ollama-buddy">https://github.com/captainflasmr/ollama-buddy&lt;/a>&lt;/p>
&lt;p>The main addition is that of system prompts, which allows setting the general tone and guidance of the overall chat. Currently the system prompt can be set at any time and turned on and off but I think to enhance my model/command for each menu item concept, I could also add a :system property to the menu alist definition to allow even tighter control of a menu action to prompt response.&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250314132104-emacs--Ollama-Buddy-0-8-0-Added-System-Prompts-Model-Info-and-simpler-menu-model-assignment.jpg" width="100%">
&lt;/figure>
&lt;p>Also now I have parameter functionality working for fine grained control, I could add these individual parameters for each menu command, for example the &lt;code>temperature&lt;/code> could be very useful in this case to play around with the randomness/casualness of the response.&lt;/p>
&lt;p>The next improvement will likely involve adding support for interacting more directly with Ollama to create and pull models. However, I&amp;rsquo;m still unsure whether performing this within Emacs is the best approach, I could assume that all models are already set up in Ollama.&lt;/p>
&lt;p>That said, importing a GGUF file might be a useful feature, possibly from within &lt;code>dired&lt;/code>. Currently, this process requires multiple steps: creating a simple model file that points to the GGUF file on disk, then running the &lt;code>ollama create&lt;/code> command to import it. Streamlining this workflow could enhance usability.&lt;/p>
&lt;p>Then maybe on to embeddings, of which I currently have no idea, haven&amp;rsquo;t read up on it, nuffin, but that is something to look forward to! :)&lt;/p>
&lt;p>Anyways, here is the latest set of updates to Ollama Buddy:&lt;/p>
&lt;h2 id="0-dot-8-dot-0">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-14 Fri&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.8.0&lt;/strong>&lt;/h2>
&lt;p>Added system prompt support&lt;/p>
&lt;ul>
&lt;li>Added &lt;code>ollama-buddy--current-system-prompt&lt;/code> variable to track system prompts&lt;/li>
&lt;li>Updated prompt area rendering to distinguish system prompts&lt;/li>
&lt;li>Modified request payload to include system prompt when set&lt;/li>
&lt;li>Enhanced status bar to display system prompt indicator&lt;/li>
&lt;li>Improved help menu with system prompt keybindings&lt;/li>
&lt;/ul>
&lt;p>So this is system prompt support in Ollama Buddy!, allowing you to set and manage system-level instructions for your AI interactions. This feature enables you to define a &lt;strong>persistent system prompt&lt;/strong> that remains active across user queries, providing better control over conversation context.&lt;/p>
&lt;p>&lt;strong>Key Features&lt;/strong>&lt;/p>
&lt;p>You can now designate any user prompt as a system prompt, ensuring that the AI considers it as a guiding instruction for future interactions. To set the system prompt, use:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>C-u C-c C-c
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>Example:&lt;/strong>&lt;/p>
&lt;ol>
&lt;li>Type:&lt;/li>
&lt;/ol>
&lt;!--listend-->
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>Always respond in a formal tone.
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ol>
&lt;li>Press &lt;code>C-u C-c C-c&lt;/code> This prompt is now set as the &lt;strong>system prompt&lt;/strong> and any further chat ollama responses will adhere to the overarching guidelines defined in the prompt.&lt;/li>
&lt;/ol>
&lt;p>If you need to clear the system prompt and revert to normal interactions, use:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>C-u C-u C-c C-c
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>How It Works&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>The active &lt;strong>system prompt&lt;/strong> is stored and sent with each user prompt.&lt;/li>
&lt;li>A &amp;ldquo;S&amp;rdquo; indicator appears in the status bar when a system prompt is active.&lt;/li>
&lt;li>The request payload now includes the system role, allowing AI to recognize persistent instructions.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Demo&lt;/strong>&lt;/p>
&lt;p>Set the system message to:&lt;/p>
&lt;p>You must always respond in a single sentence.&lt;/p>
&lt;p>Now ask the following:&lt;/p>
&lt;p>Tell me why Emacs is so great!&lt;/p>
&lt;p>Tell me about black holes&lt;/p>
&lt;p>clear the system message and ask again, the responses should now be more verbose!!&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/ollama-buddy-screen-recording_015.gif" width="100%">
&lt;/figure>
&lt;h2 id="0-dot-7-dot-4">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-13 Thu&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.7.4&lt;/strong>&lt;/h2>
&lt;p>Added model info command, update keybindings&lt;/p>
&lt;ul>
&lt;li>Added `ollama-buddy-show-raw-model-info` to fetch and display raw JSON details
of the current model in the chat buffer.&lt;/li>
&lt;li>Updated keybindings:
&lt;ul>
&lt;li>`C-c i` now triggers model info display.&lt;/li>
&lt;li>`C-c h` mapped to help assistant.&lt;/li>
&lt;li>Improved shortcut descriptions in quick tips section.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Removed unused help assistant entry from menu.&lt;/li>
&lt;li>Changed minibuffer-prompt key from `?i` to `?b`.&lt;/li>
&lt;/ul>
&lt;h2 id="0-dot-7-dot-3">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-12 Wed&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.7.3&lt;/strong>&lt;/h2>
&lt;p>Added function to associate models with menu commands&lt;/p>
&lt;ul>
&lt;li>Added &lt;code>ollama-buddy-add-model-to-menu-entry&lt;/code> autoload function&lt;/li>
&lt;li>Enabled dynamic modification of command-model associations&lt;/li>
&lt;/ul>
&lt;p>This is a helper function that allows you to associate specific models with individual menu commands.&lt;/p>
&lt;p>Configuration to apply a model to a menu entry is now straightforward, in your Emacs init file, add something like:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-elisp" data-lang="elisp">&lt;span style="display:flex;">&lt;span>(with-eval-after-load &lt;span style="color:#e6db74">&amp;#39;ollama-buddy&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-add-model-to-menu-entry &lt;span style="color:#e6db74">&amp;#39;dictionary-lookup&lt;/span> &lt;span style="color:#e6db74">&amp;#34;tinyllama:latest&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> (ollama-buddy-add-model-to-menu-entry &lt;span style="color:#e6db74">&amp;#39;synonym&lt;/span> &lt;span style="color:#e6db74">&amp;#34;tinyllama:latest&amp;#34;&lt;/span>))
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This configures simpler tasks like dictionary lookups and synonym searches to use the more efficient TinyLlama model, while your default model will still be used for more complex operations.&lt;/p>
&lt;h2 id="0-dot-7-dot-2">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-12 Wed&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.7.2&lt;/strong>&lt;/h2>
&lt;p>Added menu model colours back in and removed some redundant code&lt;/p></description></item><item><title>Ollama-Buddy 0.7.1 - Org-mode Chat, Parameter Control and JSON Debugging</title><link>https://www.emacs.dyerdwelling.family/emacs/20250311180746-emacs--ollama-buddy-0-7-1-org-mode-chat-parameter-control-and-json-debugging/</link><pubDate>Tue, 11 Mar 2025 18:07:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250311180746-emacs--ollama-buddy-0-7-1-org-mode-chat-parameter-control-and-json-debugging/</guid><description>&lt;p>Continuing the development of my local &lt;code>ollama&lt;/code> LLM client called &lt;code>ollama-buddy&lt;/code>&amp;hellip;&lt;/p>
&lt;p>&lt;a href="https://github.com/captainflasmr/ollama-buddy">https://github.com/captainflasmr/ollama-buddy&lt;/a>&lt;/p>
&lt;p>The basic functionality, I think, is now there (and now literally zero configuration required). If a default model isn&amp;rsquo;t set I just pick the first one, so LLM chat can take place immediately.&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/20250311180746-emacs--Ollama-Buddy-0-7-1-Org-mode-Chat-Parameter-Control-and-JSON-Debugging.jpg" width="100%">
&lt;/figure>
&lt;p>Now I&amp;rsquo;m getting more into this chat client malarkey, my original idea of a very minimal chat client to interface to &lt;code>ollama&lt;/code> is starting to skew into supporting as much of the &lt;code>ollama&lt;/code> RESTful API as possible. Hence in this update a more advanced approach is creeping in, including setting up various subtle model parameters and providing a debugging window to monitor incoming raw JSON (pretty printed of course). Hopefully, these features will remain tucked away for advanced users, I’ve done my best to keep them unobtrusive (but not &lt;strong>too&lt;/strong> hidden). The tool is still designed to be a helpful companion to interface to &lt;code>ollama&lt;/code> through Emacs, just now with more powerful options under the hood.&lt;/p>
&lt;p>Also a note about converting the chat buffer into org-mode. My original intention was to keep the chat buffer as a very simple almost &amp;ldquo;no mode&amp;rdquo; buffer, with just text and nothing else. However, with more consideration, I felt that converting this buffer into org-mode actually held quite a few benefits:&lt;/p>
&lt;ul>
&lt;li>Each prompt could be a heading, hence outlining and folding can be activated!&lt;/li>
&lt;li>Navigation between prompts now comes for free (especially if you are using &lt;code>org-use-speed-commands&lt;/code>)&lt;/li>
&lt;li>The org ox export backend now allows us to export to formats of many different kinds&lt;/li>
&lt;/ul>
&lt;p>I&amp;rsquo;m sure there are more as this list isn&amp;rsquo;t quite the &amp;ldquo;quite a few benefits&amp;rdquo; I was hoping for :(&lt;/p>
&lt;p>I have a local keymap defined with some ollama-buddy specific keybindings, and as of yet I haven’t encountered any conflicts with commonly used &lt;code>org-mode&lt;/code> bindings but we shall see how it goes. I think for this package it is important to have a quick chatting mechanism, and what is faster than a good keybind?&lt;/p>
&lt;p>Finally, just a note on the pain of implementing a good prompt mechanism. I had a few goes at it and I think I now have an acceptable robust solution. I kept running into little annoying edge cases and I ended up having to refactor quite a bit. My original idea for this package involved a simple “mark region and send” as at the time I had a feeling that the implementation of a good prompt mechanism would be tough - how right I was!. Things got even trickier with the move to &lt;code>org-mode&lt;/code>, since each prompt heading should contain meaningful content for clean exports and I had to implement a mechanism to replace prompts intelligently. For example, if the model is swapped and the previous prompt is blank, it gets replaced, though, of course, even this has its own edge cases - gives a new meaning to prompt engineering! :)&lt;/p>
&lt;p>Anyways, listed below are my latest changes, with a little deeper dive into more &amp;ldquo;interesting&amp;rdquo; implementations, my next ideas are a little more advanced and are kanban&amp;rsquo;d into my github README at &lt;a href="https://github.com/captainflasmr/ollama-buddy">https://github.com/captainflasmr/ollama-buddy&lt;/a> for those that are interested.&lt;/p>
&lt;h2 id="0-dot-7-dot-1">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-11 Tue&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.7.1&lt;/strong>&lt;/h2>
&lt;p>Added debug mode to display raw JSON messages in a debug buffer&lt;/p>
&lt;ul>
&lt;li>Created new debug buffer to show raw JSON messages from Ollama API&lt;/li>
&lt;li>Added toggle function to enable/disable debug mode (ollama-buddy-toggle-debug-mode)&lt;/li>
&lt;li>Modified stream filter to log and pretty-print incoming JSON messages&lt;/li>
&lt;li>Added keybinding C-c D to toggle debug mode&lt;/li>
&lt;li>Updated documentation in welcome message&lt;/li>
&lt;/ul>
&lt;h2 id="0-dot-7-dot-0">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-11 Tue&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.7.0&lt;/strong>&lt;/h2>
&lt;p>Added comprehensive Ollama parameter management&lt;/p>
&lt;ul>
&lt;li>Added customization for all Ollama option API parameters with defaults&lt;/li>
&lt;li>Only send modified parameters to preserve Ollama defaults&lt;/li>
&lt;li>Display active parameters with visual indicators for modified values&lt;/li>
&lt;li>Add keybindings and help system for parameter management&lt;/li>
&lt;li>Remove redundant temperature controls in favor of unified parameters&lt;/li>
&lt;/ul>
&lt;p>Introduced parameter management capabilities that give you complete control over your Ollama model&amp;rsquo;s behavior through the options in the ollamas API.&lt;/p>
&lt;p>Ollama&amp;rsquo;s API supports a rich set of parameters for fine-tuning text generation, from controlling creativity with &lt;code>temperature&lt;/code> to managing token selection with &lt;code>top_p&lt;/code> and &lt;code>top_k&lt;/code>. Until now, Ollama Buddy only exposed the &lt;code>temperature&lt;/code> parameter, but this update unlocks the full potential of Ollama&amp;rsquo;s parameter system!&lt;/p>
&lt;h3 id="key-features">Key Features:&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>All Parameters&lt;/strong> - set all custom options for the ollama LLM at runtime&lt;/li>
&lt;li>&lt;strong>Smart Parameter Management&lt;/strong>: Only modified parameters are sent to Ollama, preserving the model&amp;rsquo;s built-in defaults for optimal performance&lt;/li>
&lt;li>&lt;strong>Visual Parameter Interface&lt;/strong>: Clear display showing which parameters are active with highlighting for modified values&lt;/li>
&lt;/ul>
&lt;h2 id="keyboard-shortcuts">Keyboard Shortcuts&lt;/h2>
&lt;p>Parameter management is accessible through simple keyboard shortcuts from the chat buffer:&lt;/p>
&lt;ul>
&lt;li>&lt;code>C-c P&lt;/code> - Edit a parameter&lt;/li>
&lt;li>&lt;code>C-c G&lt;/code> - Display current parameters&lt;/li>
&lt;li>&lt;code>C-c I&lt;/code> - Show parameter help&lt;/li>
&lt;li>&lt;code>C-c K&lt;/code> - Reset parameters to defaults&lt;/li>
&lt;/ul>
&lt;h2 id="0-dot-6-dot-1">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-10 Mon&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.6.1&lt;/strong>&lt;/h2>
&lt;p>Refactored prompt handling so each org header line should now always have a prompt for better export&lt;/p>
&lt;ul>
&lt;li>Added functionality to properly handle prompt text when showing/replacing prompts&lt;/li>
&lt;li>Extracted inline lambdas in menu actions into named functions&lt;/li>
&lt;li>Added fallback for when no default model is set&lt;/li>
&lt;/ul>
&lt;h2 id="0-dot-6-dot-0">&lt;span class="timestamp-wrapper">&lt;span class="timestamp">&amp;lt;2025-03-08 Sat&amp;gt; &lt;/span>&lt;/span> &lt;strong>0.6.0&lt;/strong>&lt;/h2>
&lt;p>Chat buffer now in org-mode&lt;/p>
&lt;ul>
&lt;li>Enabled &lt;code>org-mode&lt;/code> in chat buffer for better text structure&lt;/li>
&lt;li>Implemented &lt;code>ollama-buddy--md-to-org-convert-region&lt;/code> for Markdown to Org conversion&lt;/li>
&lt;li>Turn org conversion on and off&lt;/li>
&lt;li>Updated keybindings &lt;code>C-c C-o&lt;/code> to toggle Markdown to Org conversion&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Key Features&lt;/strong>&lt;/p>
&lt;ol>
&lt;li>
&lt;p>The chat buffer is now in &lt;code>org-mode&lt;/code> which gives the buffer enhanced readability and structure. Now, conversations automatically format user prompts and AI responses with &lt;strong>org-mode headings&lt;/strong>, making them easier to navigate.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Of course with org-mode you will now get the additional benefits for free, such as:&lt;/p>
&lt;ul>
&lt;li>outlining&lt;/li>
&lt;li>org export&lt;/li>
&lt;li>heading navigation&lt;/li>
&lt;li>source code fontification&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>
&lt;p>Previously, responses in &lt;strong>Ollama Buddy&lt;/strong> were displayed in markdown formatting, which wasn’t always ideal for &lt;strong>org-mode users&lt;/strong>. Now, you can automatically convert Markdown elements, such as bold/italic text, code blocks, and lists, into proper org-mode formatting. This gives you the flexibility to work with markdown or org-mode as needed.&lt;/p>
&lt;/li>
&lt;/ol></description></item><item><title>Ollama Buddy Version 0.2.1 - Same prompt to multiple LLMs and choose best answer!</title><link>https://www.emacs.dyerdwelling.family/emacs/20250302093517-emacs--ollama-buddy-version-0-2-1/</link><pubDate>Sun, 02 Mar 2025 09:35:00 +0000</pubDate><author>James Dyer</author><guid>https://www.emacs.dyerdwelling.family/emacs/20250302093517-emacs--ollama-buddy-version-0-2-1/</guid><description>&lt;p>Some improvements to my ollama LLM package&amp;hellip;&lt;/p>
&lt;p>With the new &lt;strong>multishot mode&lt;/strong>, you can now send a prompt to multiple models in sequence, and compare their responses, the results are also available in named registers.&lt;/p>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/ollama-buddy-banner.jpg" width="100%">
&lt;/figure>
&lt;p>&lt;strong>Letter-Based Model Shortcuts&lt;/strong>&lt;/p>
&lt;p>Instead of manually selecting models, each available model is now assigned a &lt;strong>letter&lt;/strong> (e.g., &lt;code>(a) mistral&lt;/code>, &lt;code>(b) gemini&lt;/code>). This allows for quick model selection when sending prompts or initiating a &lt;strong>multishot sequence&lt;/strong>.&lt;/p>
&lt;p>&lt;strong>Multishot Execution (&lt;code>C-c C-l&lt;/code>)&lt;/strong>&lt;/p>
&lt;p>Ever wondered how different models would answer the same question? With &lt;strong>Multishot Mode&lt;/strong>, you can:&lt;/p>
&lt;ul>
&lt;li>Send your prompt to a sequence of models in one shot.&lt;/li>
&lt;li>Track progress as responses come in.&lt;/li>
&lt;li>Store each model’s response in a &lt;strong>register&lt;/strong>, making it easy to reference later, each assigned model letter corresponds to the named register.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Status Updates&lt;/strong>&lt;/p>
&lt;p>When running a multishot execution, the status now updates dynamically:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>&amp;ldquo;Multi Start&amp;rdquo;&lt;/strong> when the sequence begins.&lt;/li>
&lt;li>&lt;strong>&amp;ldquo;Processing&amp;hellip;&amp;rdquo;&lt;/strong> during responses.&lt;/li>
&lt;li>&lt;strong>&amp;ldquo;Multi Finished&amp;rdquo;&lt;/strong> when all models have responded.&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>How It Works&lt;/strong>&lt;/p>
&lt;ol>
&lt;li>&lt;strong>&lt;code>C-c C-l&lt;/code>&lt;/strong> to start a multishot session in the chat buffer.&lt;/li>
&lt;li>Type a sequence of model letters (e.g., &lt;code>abc&lt;/code> to use models &lt;code>mistral&lt;/code>, &lt;code>gemini&lt;/code>, and &lt;code>llama&lt;/code>).&lt;/li>
&lt;li>The selected models will process the prompt &lt;strong>one by one&lt;/strong>.&lt;/li>
&lt;li>The responses will be saved to registers of the same named letter for recalling later.&lt;/li>
&lt;/ol>
&lt;figure>&lt;img src="https://www.emacs.dyerdwelling.family/emacs/ollama-buddy-screen-recording_007.gif" width="100%">
&lt;/figure></description></item></channel></rss>