AI Assistant
The admin includes optional AI features for content generation. Powered by the Vercel AI SDK — works with OpenAI and other providers.
Add to your .env:
AI_PROVIDER=openaiAI_API_KEY=sk-...AI_MODEL=gpt-4o-miniAI buttons appear automatically in the admin when these env vars are set.
Features
Section titled “Features”Alt Text Generation
Section titled “Alt Text Generation”On the asset detail page, an “Generate alt text” button sends the image to the AI model and streams back a description. Works with uploaded images only (reads from disk).
SEO Description
Section titled “SEO Description”On post/page edit forms, a “Generate” button next to the SEO description field creates a meta description from the document’s title, excerpt, and body.
Translation
Section titled “Translation”In the translation view, each translatable text and rich text field gets a “Translate from EN” button that:
- Text fields — translates plain text
- Rich text fields — translates while preserving the JSON AST structure
All AI responses are streamed — you see the text appear as it generates.
Configuration
Section titled “Configuration”| Env var | Default | Description |
|---|---|---|
AI_PROVIDER | — | Provider name (openai) |
AI_API_KEY | — | API key for the provider |
AI_MODEL | — | Model to use (e.g. gpt-4o-mini) |
Without AI_PROVIDER and AI_API_KEY, all AI buttons are hidden. No AI dependencies are loaded.