This video introduces GPTel, an Emacs client for large language models (LLMs) designed for asynchronous, flexible, and unobtrusive integration into the Emacs environment. The demonstration covers installation via Melpa, basic interaction with various LLM providers (including OpenAI's ChatGPT, Google's Gemini, Mistral AI's Zephyr, and Kagi), and features like persistent chat sessions, dynamic system message (directive) customization, and input/output redirection. The video emphasizes GPTel's core design philosophy: to be a "boring," non-annoying, asynchronous, and "invisible" tool that works seamlessly across all Emacs buffers without special syntax or dedicated sessions, focusing primarily on text-based interactions while leveraging Emacs's inherent flexibility for advanced use cases.
GPTel: An Emacs Client for Large Language Models
0:00 Introduction to GPTel: GPTel is presented as an asynchronous and flexible Emacs client for large language models (LLMs). It supports persistent chats, multiple LLM providers, and offers an intuitive, uniform interface, aiming to be unobtrusive and available throughout Emacs.
0:25 Installation via Melpa: The video demonstrates installing GPTel from Melpa, requiring the Melpa package archive to be configured in Emacs. Installation is quick using M-x package-install gptel.
1:09 Basic Interaction and Keybindings: Users can send prompts from any Emacs buffer using gptel-send. An OpenAI API key may be required initially. A dedicated chat buffer can be opened with gptel, and gptel-send can be bound to a convenient key.
2:08 Multi-Provider Support & Asynchronous Operation: GPTel supports various LLM providers (e.g., OpenAI's ChatGPT, Google's Gemini, Mistral AI's Zephyr, Kagi). The asynchronous nature allows users to continue working in Emacs while LLM responses are streaming.
3:11 Persistent Chat Context: Chat conversations can be saved as regular text or markdown files, retaining metadata. Reopening a saved file and enabling gptel-mode restores the conversation context for continuation.
4:01 Customizing LLM Behavior with System Messages (Directives): The easiest way to tailor LLM behavior is by changing the system message (directive), which can be selected on-the-fly using a prefix argument with gptel-send. Examples include making the LLM act as a mathematician (using LaTeX, providing only results) or a dictionary (providing synonyms and antonyms).
7:11 "Boring" and Unobtrusive: Aims to be a background tool that requires minimal thought to use.
7:24 Non-Annoying Defaults: Does not move the cursor, auto-scroll, or add "magic behavior" by default (though configurable via hooks).
7:33 Fully Asynchronous: Designed to minimize event loop hogging, allowing Emacs to remain usable while LLM responses stream.
7:54 Seamless I/O Redirection: Simplifies sending prompts and receiving responses to/from various Emacs areas (e.g., mini-buffer, echo area, new buffer/session for tasks like code explanation).
10:51 "Invisible" and Universal Availability: Works in any Emacs buffer (e.g., Org mode documents, shell command prompts, M-x prompts) without special syntax or required sessions.
13:36 Minimal Interface and Consistency: GPTel intentionally maintains a small API (primarily gptel-send) and strives for a consistent interface across different LLM providers and all Emacs buffers, despite underlying API differences.
15:55 Focus on Text and Composability: GPTel prioritizes text-based interactions, avoiding feature bloat from new generative AI APIs (e.g., images). It encourages leveraging the flexibility of Emacs and LLMs for complex tasks rather than adding explicit, complicated features.
16:48 Configuration and API for Advanced Use: The package is highly configurable, with hooks for custom behaviors. For non-interactive or custom applications, the stable gptel-request API provides a programmatic interface to all supported LLM providers.