Opengram

Auto-Rename

Automatically generate descriptive chat titles using an LLM after the first agent reply.

Opengram can automatically generate descriptive titles for chats using an LLM. When an agent completes a reply in a chat that still has the default title, the auto-rename feature calls the configured LLM to produce a short, relevant title based on the conversation content.

Supported Providers

ProviderConfig valueEnvironment variable
AnthropicanthropicANTHROPIC_API_KEY
OpenAIopenaiOPENAI_API_KEY
GooglegoogleGEMINI_API_KEY or GOOGLE_API_KEY
xAIxaiXAI_API_KEY
OpenRouteropenrouterOPENROUTER_API_KEY

Setup

There are three ways to configure auto-rename:

  1. Init wizard — run opengram init and follow the prompts to select a provider, enter an API key, and choose a model.
  2. Web UI — open the Settings page in the Opengram web interface (/settings) and configure auto-rename from the browser.
  3. Config file — edit opengram.config.json directly:
{
  "autoRename": {
    "enabled": true,
    "provider": "anthropic",
    "modelId": "claude-haiku-4-5",
    "apiKey": "sk-ant-..."
  }
}

API Key Resolution

The API key can be provided in two ways:

  1. In the config file -- set the apiKey field in the autoRename section
  2. Via environment variable -- set the provider's environment variable (see table above)

If both are set, the config file value takes precedence.

How it works

  1. An agent completes a reply in a chat that still has the default title (e.g. "New Chat").
  2. Opengram checks that user messages total at least 30 characters of content.
  3. Opengram sends up to the first 6 messages (each truncated to 300 characters) to the configured LLM.
  4. The LLM returns a short title (3--7 words), trimmed to 48 characters.
  5. The chat title is updated and marked as auto-renamed.

Auto-rename only triggers once per chat -- when the title source is still default. If a user or agent has already set a custom title, auto-rename is skipped.

Configuration Options

OptionTypeDescription
enabledbooleanWhether auto-rename is active
providerstringOne of anthropic, openai, google, xai, openrouter
modelIdstringThe model ID to use (e.g. claude-haiku-4-5, gpt-5-mini)
apiKeystringAPI key for the provider (optional if set via environment variable)

On this page