gptel
An open-source Emacs LLM client that connects to Ollama, llama.cpp and cloud providers, with editable chat files and MCP tool use. GPL-3.0 licensed.
Alternative to:
gptel is an Emacs LLM client for people who want model responses alongside their writing and code. It connects to local inference backends including Ollama, llama.cpp, Llamafile and GPT4All. The client runs in Emacs; cloud connections such as OpenAI, Anthropic and Gemini send requests to those providers and require their credentials.
Conversations can live in an existing buffer or a separate chat buffer, with responses in Markdown or Org format. You can keep independent conversations, ask a single question, or have a model rewrite or refactor selected text. Proposed edits can be reviewed as a diff before you apply them.
Chats remain ordinary files. gptel saves them as Markdown, Org or plain text so you can resume them later. Edits to earlier prompts and responses become part of the context when the conversation continues. Regions, other buffers and files can supply additional context, including images and documents for models that support them.
Tool use gives compatible models agent capabilities, and mcp.el provides Model Context Protocol integration. gptel also displays reasoning content when a model returns it. You can inspect and modify a request before sending it, or pause a multi-stage request and resume it later.
For self-hosted services, gptel supports Open WebUI and PrivateGPT alongside direct local inference backends. Its API lets Emacs users build custom commands around supported models. The client is open source under GPL-3.0.