Language models

Call a model directly from the editor: chat in a buffer, ask about any text with a vim operator, review every edit, and control exactly what is sent.

TopicWhat it covers
Language modelsThe LLM layer from start to finish. Setup, chat, asking about text from any buffer, context, tools with review, MCP servers, profiles, watching and stopping requests, the privacy model, and how it differs from the agent integrations.
llmllm: configure the LLM layer. Layers, the llm.* options, profiles, project config and what a project may not set, keys.
llm-chat-modellm-chat-mode: a chat with a language model in its own buffer — a read-only transcript with an editable prompt. CR sends, C-j newlines, C-c interrupts, gb forks, gq closes; :llm-retry asks again; :llm-save / :llm-resume keep a chat, :llm-export writes it out.
llm-modellm-mode: ask a language model about any text, from any buffer, or have it rewrite text. aa{motion} asks about the motion's text; the answer opens beside you without taking the focus. ar{motion} rewrites it through a diff you accept or reject.
llm-tools-modellm-tools-mode: tools for llm chats beyond lattice's own, from MCP servers ([llm.mcp.], a stdio command or an HTTP url) and from plugins. Select them with llm.tools = ["name.*"]; :llm-tools lists each source, its state and its tools; r restarts a server, dd stops it.
llm-system-modellm-system-mode: the system prompt in an ordinary buffer. :w applies it to the session and closes the buffer, :q! discards. Nothing is written to disk.
llm-context-modellm-context-mode: llm-context, what requests from a buffer carry and where each item stands now. dd on a row removes it. Read-only; updates itself.
llm-inspect-modellm-inspect-mode: llm-inspect, a request exactly as it goes to the provider — address, headers, body, every exchange of it — with the key shown as . Read-only; updates itself.
llm-requests-modellm-requests-mode: llm-requests, every LLM request since the editor started, running first, with state, model, start time, how long it took and destination. dd on a row stops it; shows what it sent. Read-only; updates itself.