gptel  by karthink

Emacs client for LLM chat, available uniformly in any buffer

created 2 years ago
2,734 stars

Top 17.8% 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

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
24
Issues (30d)
28
Star History
352 stars in the last 90 days

Explore Similar Projects

Starred by Peter Norvig Peter Norvig(Author of Artificial Intelligence: A Modern Approach; Research Director at Google), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
2 more.

aisuite by andrewyng

0.2%
12k
Unified interface for multiple generative AI providers
created 1 year ago
updated 3 days ago
Feedback? Help us improve.