Repolode
karthink

karthink/gptel

A simple, extensible LLM chat client for Emacs that works across multiple model providers and backends from any buffer.

Open-source alternative to:ChatGPT

Stars
3,561
Forks
452
Open issues
205
Last commit
2 days ago

What is it?

gptel is a Large Language Model chat client that runs inside Emacs. It can be invoked from any buffer, shell or minibuffer, and responses are rendered as Markdown or Org markup. Conversations can be saved as plain Markdown, Org or text files and resumed later, and multiple independent chats can run side by side.

The client supports a wide range of providers, including OpenAI, Anthropic Claude, Gemini, Azure, Mistral, DeepSeek and OpenRouter, as well as local servers such as Ollama, Llama.cpp, GPT4All and Open WebUI. Backends are registered with simple functions, and many OpenAI-compatible endpoints can be added through the same interface. Requests use Curl when available and fall back to the built-in url-retrieve otherwise.

Beyond chat, gptel supports tool use, Model Context Protocol integration via mcp.el, multi-modal input such as images and documents, and reasoning content in responses. Users can inspect and edit the exact request before it is sent, and build custom commands on its API.

Key features

  • 01Chat with LLMs from any Emacs buffer, with Markdown or Org responses.
  • 02Supports many providers, including OpenAI, Claude, Gemini, Ollama and Llama.cpp.
  • 03Saves chats as plain files and lets you resume or edit earlier turns.
  • 04Supports tool use and Model Context Protocol integration.
  • 05Lets you inspect and modify the exact request before sending.
  • 06Accepts images and documents as multi-modal input.

Use cases

  • Asking questions or refactoring code without leaving the editor.
  • Running local models through Ollama or Llama.cpp while keeping data on your machine.
  • Building custom LLM workflows in Elisp on top of a single client API.

Quick start

  1. 1

    Install gptel in Emacs with the package manager

  2. 2

    Make sure Transient 0.7.8 or higher is available (enable package-install-upgrade-built-in or update it manually)

  3. 3

    Set your OpenAI API key in gptel-api-key, or leave the default authinfo lookup in place

Things to know

  • Most cloud backends need an API key, subscription, or cloud credentials.
  • Requires Transient 0.7.8 or higher, which Emacs does not upgrade by default.
  • Local backends such as Ollama or Llama.cpp require you to run a server yourself.

In collections

Topics

FAQ

What is gptel?
A simple, extensible LLM chat client for Emacs that works across multiple model providers and backends from any buffer. gptel is a Large Language Model chat client that runs inside Emacs. It can be invoked from any buffer, shell or minibuffer, and responses are rendered as Markdown or Org markup. Conversations can be saved as plain Markdown, Org or text files and resumed later, and multiple independent chats can run side by side.
Is gptel free to use? What license does it have?
gptel is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
Is gptel still maintained?
Actively maintained. The last commit to gptel was on Nov 5, 2026.
What can I use gptel for?
Asking questions or refactoring code without leaving the editor. Running local models through Ollama or Llama.cpp while keeping data on your machine. Building custom LLM workflows in Elisp on top of a single client API.
How do I install gptel?
Install gptel in Emacs with the package manager Make sure Transient 0.7.8 or higher is available (enable package-install-upgrade-built-in or update it manually) Set your OpenAI API key in gptel-api-key, or leave the default authinfo lookup in place
Where can I get gptel?
The source code and installation instructions are on GitHub: https://github.com/karthink/gptel

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects