gptel Atom Feed

Description
Interact with ChatGPT or other LLMs
Latest
gptel-0.9.9.5.0.20260610.37.tar (.sig), 2026-Jun-10, 930 KiB
Maintainer
Karthik Chikmagalur <karthik.chikmagalur@gmail.com>
Website
https://github.com/karthink/gptel
Browse ELPA's repository
CGit or Gitweb
All Dependencies
transient (.tar), compat (.tar)
Badge

To install this package from Emacs, use package-install or list-packages.

Full description

gptel is a simple Large Language Model chat client, with support for multiple
models and backends.

It works in the spirit of Emacs, available at any time and in any buffer.

gptel supports:

- The services ChatGPT, Azure, Gemini, Anthropic AI, Together.ai, Perplexity,
  AI/ML API, Anyscale, OpenRouter, Groq, PrivateGPT, DeepSeek, Cerebras, Github Models,
  GitHub Copilot chat, AWS Bedrock, Novita AI, xAI, Sambanova, Mistral Le
  Chat and Kagi (FastGPT & Summarizer).
- Local models via Ollama, Llama.cpp, Llamafiles or GPT4All

Additionally, any LLM service (local or remote) that provides an
OpenAI-compatible API is supported.

Features:

- Interact with LLMs from anywhere in Emacs (any buffer, shell, minibuffer,
  wherever).
- LLM responses are in Markdown or Org markup.
- Supports conversations and multiple independent sessions.
- Supports tool-use to equip LLMs with agentic capabilities.
- Supports Model Context Protocol (MCP) integration using the mcp.el package.
- Supports multi-modal models (send images, documents).
- Supports "reasoning" content in LLM responses.
- Save chats as regular Markdown/Org/Text files and resume them later.
- You can go back and edit your previous prompts or LLM responses when
  continuing a conversation.  These will be fed back to the model.
- Redirect prompts and responses easily
- Rewrite, refactor or fill in regions in buffers.
- Write your own commands for custom tasks with a simple API.

Requirements for ChatGPT, Azure, Gemini or Kagi:

- You need an appropriate API key.  Set the variable `gptel-api-key' to the
  key or to a function of no arguments that returns the key.  (It tries to
  use `auth-source' by default)

ChatGPT is configured out of the box.  For the other sources:

- For Azure: define a gptel-backend with `gptel-make-azure'.
- For Gemini: define a gptel-backend with `gptel-make-gemini'.
- For Anthropic (Claude): define a gptel-backend with `gptel-make-anthropic'.
- For AI/ML API, Together.ai, Anyscale, Groq, OpenRouter, DeepSeek, Cerebras
  or Github Models: define a gptel-backend with `gptel-make-openai'.
- For PrivateGPT: define a backend with `gptel-make-privategpt'.
- For Perplexity: define a backend with `gptel-make-perplexity'.
- For Deepseek: define a backend with `gptel-make-deepseek'.
- For Kagi: define a gptel-backend with `gptel-make-kagi'.

For local models using Ollama, Llama.cpp or GPT4All:

- The model has to be running on an accessible address (or localhost)
- Define a gptel-backend with `gptel-make-ollama' or `gptel-make-gpt4all'.
- Llama.cpp or Llamafiles: Define a gptel-backend with `gptel-make-openai'.

Consult the package README for examples and more help with configuring
backends.

Usage:

gptel can be used in any buffer or in a dedicated chat buffer.  The
interaction model is simple: Type in a query and the response will be
inserted below.  You can continue the conversation by typing below the
response.

To use this in any buffer:

- Call `gptel-send' to send the buffer's text up to the cursor.  Select a
  region to send only the region.

- You can select previous prompts and responses to continue the conversation.

- Call `gptel-send' with a prefix argument to access a menu where you can set
  your backend, model and other parameters, or to redirect the
  prompt/response.

To use this in a dedicated buffer:

- M-x gptel: Start a chat session.

- In the chat session: Press `C-c RET' (`gptel-send') to send your prompt.
  Use a prefix argument (`C-u C-c RET') to access a menu.  In this menu you
  can set chat parameters like the system directives, active backend or
  model, or choose to redirect the input or output elsewhere (such as to the
  kill ring or the echo area).

- You can save this buffer to a file.  When opening this file, turn on
  `gptel-mode' before editing it to restore the conversation state and
  continue chatting.

- To include media files with your request, you can add them to the context
  (described next), or include them as links in Org or Markdown mode chat
  buffers.  Sending media is disabled by default, you can turn it on globally
  via `gptel-track-media', or locally in a chat buffer via the header line.

Include more context with requests:

If you want to provide the LLM with more context, you can add arbitrary
regions, buffers, files or directories to the query with `gptel-add'.  To add
text or media files, call `gptel-add' in Dired or use the dedicated
`gptel-add-file'.

You can also add context from gptel's menu instead (`gptel-send' with a
prefix arg), as well as examine or modify context.

When context is available, gptel will include it with each LLM query.

LLM Tool use:

gptel supports "tool calling" behavior, where LLMs can specify arguments with
which to call provided "tools" (elisp functions).  The results of running the
tools are fed back to the LLM, giving it capabilities and knowledge beyond
what is available out of the box.  For example, tools can perform web
searches or API lookups, modify files and directories, and so on.

Tools can be specified via `gptel-make-tool', or obtained from other
repositories, or from Model Context Protocol (MCP) servers using the mcp.el
package.  See the README for details.

Tools can be included with LLM queries using gptel's menu, or from
`gptel-tools'.

Rewrite interface

In any buffer: with a region selected, you can rewrite prose, refactor code
or fill in the region.  This is accessible via `gptel-rewrite', and also from
the `gptel-send' menu.

Presets

Define a bundle of configuration (model, backend, system message, tools etc)
as a "preset" that can be applied together, making it easy to switch between
tasks in gptel.  Presets can be saved and applied from gptel's transient
menu.  You can also include a cookie of the form "@preset-name" in the prompt
to send a request with a preset applied.  This feature works everywhere, but
preset cookies are also fontified in chat buffers.

gptel in Org mode:

gptel offers a few extra conveniences in Org mode:

- You can limit the conversation context to an Org heading with
  `gptel-org-set-topic'.
  
- You can have branching conversations in Org mode, where each hierarchical
  outline path through the document is a separate conversation branch.
  See the variable `gptel-org-branching-context'.
  
- You can declare the gptel model, backend, temperature, system message and
  other parameters as Org properties with the command
  `gptel-org-set-properties'.  gptel queries under the corresponding heading
  will always use these settings, allowing you to create mostly reproducible
  LLM chat notebooks.

Finally, gptel offers a general purpose API for writing LLM ineractions that
suit your workflow.  See `gptel-request', and `gptel-fsm' for more advanced
usage.

Old versions

gptel-0.9.9.5.0.20260608.36.tar.lz2026-Jun-08 167 KiB
gptel-0.9.9.5.0.20260608.35.tar.lz2026-Jun-08 167 KiB
gptel-0.9.9.5.0.20260606.33.tar.lz2026-Jun-07 167 KiB
gptel-0.9.9.5.0.20260604.30.tar.lz2026-Jun-05 167 KiB
gptel-0.9.9.5.0.20260530.28.tar.lz2026-May-30 167 KiB
gptel-0.9.9.5.0.20260519.2556.tar.lz2026-May-19 166 KiB
gptel-0.9.9.4.0.20260503.114603.tar.lz2026-May-03 163 KiB
gptel-0.9.9.4.0.20260427.233404.tar.lz2026-Apr-28 163 KiB
gptel-0.9.8.5.0.20250901.153006.tar.lz2025-Sep-02 133 KiB
gptel-0.8.6.0.20240623.113847.tar.lz2024-Jun-2357.2 KiB

News

# -*- mode: org; -*-

* 0.9.9.6-pre

** Breaking changes

- The models =claude-3-7-sonnet-20250219=, =claude-3-5-sonnet-20241022=,
  =claude-3-5-sonnet-20240620=, =claude-3-5-haiku-20241022=,
  =claude-3-opus-20240229= and =claude-3-haiku-20240307= have been
  removed from the default list of Anthropic models.  These models are
  either deprecated or no longer available.

- The models =gemini-3.1-flash-lite-preview= and =gemini-3-pro-preview=
  have been removed from the default list of Gemini models.  These
  models are no longer available.

- The minimum required version of the =transient= package is now 0.7.8.

- ~gptel-temperaure~ now defaults to nil, meaning the API's default
  value will be used.  This is because some backends don't support
  providing the temperature, those that do don't agree on the scale and
  what a temperature of 1 means.

- Due to the introduction of ~gptel-system-prompt~ (see below), opening
  a text/markdown gptel chat file before loading gptel can cause an
  error.  To fix this, please ensure that gptel is loaded before opening
  any saved text/markdown chat files.  This only needs to be done once.

** New models and backends

- Bedrock backend: Add support for =claude-opus-4-7= and
  =claude-opus-4-8=.

- Anthropic backend: Add support for =claude-opus-4-8= and
  =claude-fable-5=.

- GitHub Copilot backend: Add support for =gemini-3.5-flash=.

- Gemini backend: Add support for =gemini-3.5-flash=,
  =gemini-3.1-flash-lite= and deprecate the preview version.

** New features and UI changes

- You can now set gptel's system prompt directly via
  ~gptel-system-prompt~.  Previously this required setting an internal
  gptel variable (~gptel--system-message~, now obsolete), or defining a
  mapping in ~gptel-directives~ and picking from the list interactively.

- OpenAI subscription support: gptel now supports authentication with
  OpenAI ChatGPT Plus/Pro accounts.  This allows using the ChatGPT Codex
  endpoint without an API key.  See =gptel-make-openai-oauth= and the
  README for details.

- When running ~gptel-rewrite~, reasoning text was previously always
  completely omitted from the response.  This was required to avoid
  mixing with the final, rewritten text, but it meant there was no way
  to examine the reasoning stream.

  Now reasoning text is retained and redirected to another buffer if --
  and only if -- ~gptel-include-reasoning~ is a string denoting a buffer
  name.

** Notable bug fixes

- Improved error messages: Curl request failures now include more
  diagnostic information.

- Fix bounds issues when using the gptel transient menu with =evil-mode=
  visual selections.

- Fix org-mode parsing issues involving =tab-width= when sending
  queries.

* 0.9.9.5 2026-05-03

** Breaking changes

- gptel's default ChatGPT backend has been removed. ~gptel-backend~ and
  ~gptel-model~ now default to =nil=, and there are no registered
  backends out of the box.  However gptel remains usable without
  configuration: if ~gptel-send~ is called without a backend set, the
  ChatGPT backend is created on the fly and used.

- ~gptel-track-media~ affects gptel's link handling in all Org and
  Markdown buffers, not just chat buffers that have ~gptel-mode~ turned
  on.  When calling ~gptel-send~ with ~gptel-track-media~ turned on, and
  the buffer is in Org or Markdown mode, links to supported file types
  will be followed by gptel and included with the request.  Previously
  this behavior applied only in dedicated chat buffers.

  (This is actually how gptel has worked since v0.9.9.3, but this change
  in behavior was undocumented.)

- ~gptel-include-reasoning~ now defaults to =ignore=, meaning that
  reasoning text in LLM responses will be included in buffers but
  ignored by ~gptel-send~ on subsequent conversation turns.  The reason
  for this change is that including the reasoning text as the LLM's
  response on new conversation turns is not recommeded by LLM APIs.
  Reasoning text can also fill up the context window.
...
...