gptel  by karthink

Emacs client for LLM chat, available uniformly in any buffer

Created 2 years ago
2,875 stars

Top 16.6% on SourcePulse

GitHubView on GitHub
Project Summary

gptel is an Emacs client for interacting with Large Language Models (LLMs), designed for seamless integration into any Emacs buffer. It supports a wide array of LLM backends, including cloud-based services like OpenAI, Anthropic, and Gemini, as well as local models via Ollama and Llama.cpp. The client aims to provide a flexible and unobtrusive way for Emacs users to leverage LLMs for tasks ranging from simple chat to complex code generation and text manipulation.

How It Works

gptel operates asynchronously, allowing users to interact with LLMs from anywhere within Emacs without blocking the editor. Responses are streamed directly into the buffer, supporting Markdown or Org markup for readability. A key design principle is its adaptability; users can modify prompts, responses, and context on the fly, and even define custom commands or integrate with external tools via its Elisp API and the Model Context Protocol (MCP). This approach prioritizes user control and workflow integration over a rigid, predefined interaction model.

Quick Start & Requirements

  • Installation: M-x package-install RET gptel RET
  • Prerequisites: Emacs. Optional: markdown-mode. Curl >= 8.5 is required for AWS Bedrock.
  • Setup: API keys or local LLM servers are required for most backends. Configuration examples are provided for numerous providers.
  • Documentation: Official Docs

Highlighted Details

  • Supports over 20 LLM backends, including local and cloud-based models.
  • Enables tool use, allowing LLMs to execute Elisp functions for extended capabilities.
  • Allows editing of previous prompts/responses to refine conversations.
  • Supports multi-modal input (images, documents) with supported models.
  • Offers flexible context management and saving/restoring chat sessions.

Maintenance & Community

The project is actively maintained by karthink and has contributions from numerous developers. Community support and discussions are available via GitHub.

Licensing & Compatibility

The project is licensed under the GPLv3. This license may have implications for commercial use or linking with closed-source software due to its copyleft provisions.

Limitations & Caveats

The README notes a breaking change: gptel-model is now expected to be a symbol, not a string. Some features, like multi-modal input or specific tool integrations, depend on the capabilities of the chosen LLM backend. The project relies on Emacs' built-in networking or curl, with specific version requirements for certain integrations.

Health Check
Last Commit

20 hours ago

Responsiveness

1 day

Pull Requests (30d)
18
Issues (30d)
25
Star History
71 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.