Favicon of gptel

gptel

An open-source LLM client that brings local models through Ollama and llama.cpp, plus cloud services such as Claude and Gemini, into Emacs.

gptel brings LLM conversations into the Emacs buffers where you already write and work. It's for Emacs users who want AI help alongside their text or code, with a choice of local model servers and cloud providers. The client is open source under GPL-3.0.

Local backends include Ollama, llama.cpp, Llamafile and GPT4All. It also connects to self-hosted Open WebUI through its OpenAI-compatible API. The client runs inside Emacs; your chosen backend handles model inference. With a local backend, requests go to that server, while cloud connections send them to services such as OpenAI, Anthropic's Claude or Gemini. Those cloud services require credentials.

You can keep separate conversations or ask a one-off question in an existing buffer. Responses use Markdown or Org markup, and chats remain ordinary Markdown, Org or text files that you can save and resume. Earlier prompts and answers are editable, so a continued conversation can use your revised text. In-place rewriting and code refactoring are also supported.

For tasks that need more context, gptel accepts images and documents and can display a model's reasoning content. Tool use gives models agent capabilities, with MCP integration through mcp.el. You can inspect and change requests before sending them, or pause a multi-stage request and resume it later. Its Emacs Lisp API also lets you build a custom workflow around supported backends.

Similar to gptel