Anthropic Claude

~2 min read

Anthropic Claude

The recommended default for Lettuce’s LLM-powered features (note enhancement, the answer RAG tool, and the semantic lint advisor). Note that semantic search / embeddings are separate — they always use an OpenAI-compatible embeddings endpoint (Anthropic has no embeddings API), so configure one of those too if you want semantic_search/answer retrieval.

Setting the key

Configure the provider in Settings → AI providers, or via environment variables:

export ANTHROPIC_API_KEY=sk-ant-xxx
export LETTUCE_LLM_PROVIDER=anthropic

When set through the GUI, the key is stored in the macOS Keychain. The raw value never touches disk in your vault.

Warning

Anthropic API keys grant API access to your account and bill against it. Treat them like any other credential — don’t commit them to git, don’t paste them into shared docs.

Choosing a model

Set the enhancement model with LETTUCE_ENHANCE_MODEL (or in Settings → AI providers):

export LETTUCE_ENHANCE_MODEL=claude-sonnet-4-6   # balanced default; use claude-haiku-4-5 for the cheapest pass
Model Context Good for
claude-opus-4-8 1M Highest-quality reasoning
claude-sonnet-4-6 1M Bulk operations (cheaper)
claude-haiku-4-5 200K Simple / fast tasks

The model field accepts any valid Anthropic model ID — Lettuce passes it through verbatim.

Connecting an MCP agent

Lettuce does not run agents itself. To let an external Claude agent act on your vault, run the MCP server with lettuce serve and connect your agent client to it over the configured token. The agent sees every MCP tool its token has scope for (see Agent reference/03 Authentication).

Agents pick up work from the vault through pending_directives: a > [!ai] <prompt> directive spliced into a note by a trigger or schedule. The connected agent reads the directive and does the actual editing.