HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
karthink
gptel
Emacs Lisp2023–2026
karthink / gptel

gptel

A simple, extensible LLM client for Emacs

39Distinct people
43Mentions
1Explicit recommenders
3.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A simple, extensible LLM client for Emacs

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

gptel in emacs does this. You can run the same prompt against different models in separate emacs windows (local or via api w/ keys) at the same time to compare outputs. I…

peterb used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year43 dated mentions

Observed mentions: 2023-03-22 04:09:50 UTC to 2026-08-05 06:52:46 UTC.

0510152023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 15 mentions; 1 submissions, 14 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 15 mentions; 0 submissions, 15 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC817
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC15114
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC15015
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC505

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
gptel: A simple LLM client for Emacs gptel is a simple Large Language Model chat client for Emacs, with support for multiple models and backends. It works in the spirit of Emacs, available at any time and uniformly in any buffer. General usage: (YouTube Demo, 18 min) Advanced usage: (YouTube Demo, 28 min) intro-demo.mp4 intro-demo-2.mp4 In-place usage gptel-rewrite-demo-1.mp4 Tool use gptel-tool-use-filesystem-confirm-demo-2.mp4 gptel-tool-use-feed-search-demo.mp4 See also this youtube demo (2 minutes) by Armin Darvish. Interact with LLMs from anywhere in Emacs (any buffer, shell, minibuffer, wherever). LLM responses are in Markdown or Org markup. Supports multiple independent conversations, one-off ad hoc interactions and anything in between. Supports tool-use to equip LLMs with agentic capabilities. Supports Model Context Protocol (MCP) integration using mcp.el. Supports multi-modal input (include images, documents). Supports “reasoning” content in LLM responses. Save chats as regular Markdown/Org/Text files and resume them later. Edit your previous prompts or LLM responses when continuing a conversation. These will be fed back to the model. Supports introspection, so you can see exactly what will be sent. Inspect and modify queries before sending them. Pause multi-stage requests at an intermediate stage and resume them later. Don’t like gptel’s workflow? Use it to create your own for any supported model/backend with a simple API. gptel uses Curl if available, but falls back to the built-in url-retrieve to work without external dependencies. Contents Installation Straight Manual Doom Emacs Spacemacs Setup OpenAI Other LLM backends (Optional) Securing API keys with =authinfo= (Optional) Reading API keys from environment variables OpenAI (ChatGPT plus/pro subscription) Azure GPT4All Ollama Open WebUI Gemini Llama.cpp or Llamafile Kagi (FastGPT & Summarizer) together.ai Anyscale Perplexity Anthropic (Claude) Groq Mistral Le Chat OpenRouter PrivateGPT DeepSeek Sambanova (Deepseek) Cerebras Novita AI xAI AI/ML API GitHub CopilotChat AWS Bedrock Moonshot (Kimi) Usage In any buffer: In a dedicated chat buffer: Including media (images, documents or plain-text files) with requests Save and restore your chat sessions Setting options (backend, model, request parameters, system prompts and more) Include more context with requests Handle “reasoning” content Tool use Defining gptel tools Selecting tools LLM tool collections Model Context Protocol (MCP) integration Rewrite, refactor or fill in a region Extra Org mode conveniences Introspection (examine, debug or modify requests) FAQ Chat buffer UI I want the window to scroll automatically as the response is inserted I want the cursor to move to the next prompt after the response is inserted I want to change the formatting of the prompt and LLM response How does gptel distinguish between user prompts and LLM responses? Transient menu behavior I want to set gptel options but only for this buffer I want the transient menu options to be saved so I only need to set them once Using the transient menu leaves behind extra windows Can I change the transient menu key bindings? (Doom Emacs) Sending a query from the gptel menu fails because of a key conflict with Org mode Miscellaneous I want to use gptel in a way that’s not supported by gptel-send or the options menu (ChatGPT) I get the error “(HTTP/2 429) You exceeded your current quota” Why another LLM client? Additional Configuration Option presets Applying presets to requests automatically Alternatives Packages using gptel Acknowledgments Installation Note: gptel requires Transient 0.7.8 or higher. Transient is a built-in package and Emacs does not update it by default. Ensure that package-install-upgrade-built-in is true, or update Transient manually. Release version: M-x package-install ⏎ gptel in Emacs. Development snapshot: Add MELPA or NonGNU-devel ELPA to your list of package sources, then install with M-x package-install ⏎ gptel. Optional: Install markdown-mode. Straight (straight-use-package 'gptel) Manual Note: gptel requires Transient 0.7.8 or higher. Transient is a built-in package and Emacs does not update it by default. Ensure that package-install-upgrade-built-in is true, or update Transient manually. Clone or download this repository and run M-x package-install-file⏎ on the repository directory. Doom Emacs In packages.el (package! gptel :recipe (:nonrecursive t)) In config.el (use-package! gptel :config (setq! gptel-api-key "your key")) “your key” can be the API key itself, or (safer) a function that returns the key. Setting gptel-api-key is optional, you will be asked for a key if it’s not found. Alternatively, Doom Emacs provides a built-in :tools llm module powered by gptel. Enable it in your init.el in the doom! block: (doom! :tools llm) This installs gptel with preconfigured keybindings (<leader> o l), m
Read the full README on GitHub

What Hacker News says

43 sources
Interesting. Tnx. In case anyone else wondered about using gptel to edit thinking (eg vis Qwen3.6's `preserve thinking`), [1] explains: > In a multi-turn request, from the time you run `gptel-send`, everything the LLM sends is passed back to it [...during tool calls...] includes multiple reasoning blocks. [...But...] subsequent gptel-send calls read their input from the buffer contents (or active region, etc), so the reasoning blocks in the buffer will not [] be sent as "reasoning_content". But in org mode, those are apparently `#+being_reasoning` blocks (`gptel-include-reasoning`?), so editable thought might be an easy addition? A caution, fwiw, that any llms which respond with interleaved content and reasoning blocks, currently only work when not streaming, and fixing that is non-trivial.[also 1] [1] https://github.com/karthink/gptel/is
Read the rest
In I have officially retired from Emacs
I use KVM/QEMU on Linux. I have a set of scripts that I use to create a new directory with a VM project and that also installs a debian image for the VM. I have an ./pull_from_vm and ./push_to_vm that I use to pull and push the git code to and from the vm. As well as a ./claude to start claude on the vm and a ./emacs to initialize and start emacs on the vm after syncing my local .spacemacs directory to the vm (I like this because of customized emacs muscle memory and because I worry that emacs can execute arbitrary code if I use it to ssh to the VM client from my host). I try not to run LLM's directly on my own host. The only exception I have is that I do use https://github.com/karthink/gptel on my own machine, because it is just too damn useful. I hope I don't self own myself with that someday.
In Let's discuss sandbox isolation
I've been looking for this too. It seems to me as though all the ide's are trying to sell the llms as a service or trying to lock you in by downloading llms through their ide. I have been downloading llm's from huggingface as gguf files and would like to use those downloads (and running them through https://github.com/oobabooga/text-generation-webui). It is possible to run those llms as a local api using something like llama-cpp-python (https://pypi.org/project/llama-cpp-python/) and would prefer to use something like that method. Zed (https://zed.dev/), which is now available on windows might be able to do it, but i'd rather use something (foss) that doesn't have a pricing model (the development focus will always be upon those who pay). tbh i'm getting a bit sick of changing ide's, as their support changes, and really would prefer not to
Read the rest
use (microsoft) visual studio code which seems to be cornering the market. Starting to think i'm going to try to learn emacs, with https://github.com/karthink/gptel looking as if it would meet my needs.
In Is there an IDE that can use the local open-source model?
The beauty of Emacs though is that it puts the user in full control. There is nothing in the world stopping anyone from modifying anything in Emacs (at least on the Elisp layer), hence packages like this. VS Code on the other hand is designed to fracture [1]. MS can and has given proprietary API access to their blessed tools, forcing others to go through their much less capable extension API, hence the plethora of vscode forks. Even if you had the most motivated, excited group of people wanting to work on the latest and greatest LLM interactions with VS code, they would most likely be forced to fork. On the other hand, it just takes one motivated Elisp dev to implement whatever they want and make any external package they want integrate with it. Also, I think the derision from the Emacs community may be a bit overblown. I'm constantly see
Read the rest
ing AI/LLM related plugins appearing for Emacs and they tend to get decent traction (e.g. https://github.com/karthink/gptel). [1] https://ghuntley.com/fracture/
In Claude Code IDE integration for Emacs
Install the latest emacs release and you will be able to do `M-x eglot` – this by default knows about language servers for many programming languages, so if you e.g. do this while in a C++ file in some project, it will start clang or ccls (whatever's in PATH); the language server will then be active for all files in that project and you can use `M-.` (xref-find-definitions), `M-,` (xref-go-back), `M-?` (xref-find-references). Try also `M-x eglot-code-actions` on a symbol to see all available actions (renaming, add imports, refactoring etc.; what you get here depends on the language server). I also use this plugin https://github.com/minad/consult which has the command `consult-ripgrep`, very useful for e.g. looking up all occurrences of the symbol at point (and text navigation across multiple files). For "AI", start with https://github.com
Read the rest
/karthink/gptel/ (its README lists alternative packages, as you can see there is no lack of llm support in emacs, both chat, "agents" and more specific use-cases)
In Show HN: A 'Choose Your Own Adventure' written in Emacs Org Mode
I've recently started using gptel and really like it, but the main feature I've wanted that it's missing is inline code completion (like GitHub Copilot). I saw that this was previously being [worked on](https://github.com/karthink/gptel/discussions/206) in the gptel repo but was paused, so I decided to give it a shot and made `gptel-autocomplete` (disclosure: most of it was written by Claude Sonnet 4). It took some experimenting to get decent code completion results from a chat API that isn't built for standalone code completion responses, but I found some techniques that worked well (details in the README).
In Gptel-autocomplete: Inline code completion in Emacs using gptel

Showing the 15 most recent of 43 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.