AI Integration
Baan integrates AI throughout the admin panel — not as a gimmick, but as a practical tool for each step of the writing workflow. You bring your own API keys and choose which provider (and which model) handles each feature individually.
Supported Providers
Section titled “Supported Providers”| Provider | Example Models (as of 2026-04) |
|---|---|
| Claude (Anthropic) | claude-opus-4-6, claude-sonnet-4-5-20250929, claude-haiku-4-5-20251001 (default) |
| OpenAI | gpt-5, gpt-5-mini, gpt-4.1, gpt-4.1-mini (default), gpt-4.1-nano, o3, o4-mini |
| Gemini (Google) | gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash (default), gemini-2.5-flash-lite |
You can configure multiple providers simultaneously and assign different providers to different features. The exact model list is defined in lib/ai/config/ai-models.ts and can drift between releases — check Admin → Settings → AI for the current options in your installation.
What AI Can Do in Baan
Section titled “What AI Can Do in Baan”Writing Assistant
Section titled “Writing Assistant”Available in the post editor’s full-screen mode via the AI sidebar:
- Draft from title/outline — generate an initial draft based on a title or bullet points
- Edit and improve — rewrite selected text for clarity, tone, or length
- Translate — translate the current article into another supported locale
- Summarize — generate a
descriptionfor the frontmatter from the article body
Theme Generation
Section titled “Theme Generation”Go to Admin → Settings → Theme → Create new theme and enter a prompt describing your desired visual style. Baan sends the prompt to your AI provider and generates a complete theme with:
- Component files (layout, header, footer, post cards)
- CSS variables for colors, typography, and spacing
theme.jsonmetadata
Example prompts: “Minimalist dark mode with serif headings”, “Colorful magazine layout inspired by mid-century design”.
Knowledge Graph Entity Extraction
Section titled “Knowledge Graph Entity Extraction”In Admin → Knowledge Graph, select an article and click Extract Entities. The AI reads the article body and extracts named entities (people, places, organizations, concepts, events, products), then attempts to enrich them with Wikidata IDs and descriptions.
The result is structured JSON-LD embedded in your article pages, making content more interpretable by AI search engines (ChatGPT, Perplexity, Google AI Overview).
llms.txt Generation
Section titled “llms.txt Generation”In Admin → Settings → AI Optimization, Baan can generate an llms.txt file — a plain-text summary of your site intended for AI crawlers. You can write it manually, auto-generate from your content, or use AI to draft and refine it.
Per-Feature Model Configuration
Section titled “Per-Feature Model Configuration”In Admin → Settings → AI, you can assign different models to each feature:
| Feature | Why you might use a different model |
|---|---|
| Writing Assistant | Use a capable model (claude-opus-4-6, gpt-5) for quality |
| Translation | A faster/cheaper model (gemini-2.5-flash, gpt-4.1-mini) is sufficient |
| Knowledge Graph | Extraction works well with mid-tier models |
| Theme Generation | Use the most capable model for best results |
Model Behavior
Section titled “Model Behavior”The three providers behave noticeably differently. Choosing the right model per feature is the difference between a snappy admin UI and one that hangs for 30+ seconds on every meta description.
OpenAI — two families with different APIs
Section titled “OpenAI — two families with different APIs”| Family | Models | Reasoning | Latency |
|---|---|---|---|
| GPT-4.1 | gpt-4.1, gpt-4.1-mini, gpt-4.1-nano | None — direct generation | Fast (< 3 s) |
| GPT-5 / o-series | gpt-5, gpt-5-mini, o3, o4-mini | Internal “thinking” | 3–60 s |
Reasoning models reject temperature (locked to 1) and max_tokens (use
max_completion_tokens). Baan auto-detects them and sends
reasoning_effort: 'low' to keep latency reasonable on short admin tasks.
Anthropic (Claude) — three tiers
Section titled “Anthropic (Claude) — three tiers”| Model | Speed | Quality | $ / MTok (in / out) |
|---|---|---|---|
| Haiku 4.5 (default) | Fastest | Good | $1 / $5 |
| Sonnet 4.5 | Fast | High | $3 / $15 |
| Opus 4.6 | Slow | Highest | $5 / $25 |
No reasoning-effort knob — latency tracks model size.
Google (Gemini) — Flash / Pro
Section titled “Google (Gemini) — Flash / Pro”| Model | Speed | Quality | $ / MTok |
|---|---|---|---|
| 2.5 Flash Lite | Fastest | Adequate | $0.075 / $0.30 |
| 2.5 Flash (default) | Fast | High | $0.15 / $0.60 |
| 2.5 Pro | Slow | Highest | $1.25 / $5 |
| 3 Flash Preview / 3.1 Pro Preview | varies | frontier (preview) | preview |
Recommendations by Task
Section titled “Recommendations by Task”| Task | Speed-first | Balanced (default) | Quality-first |
|---|---|---|---|
| Meta description (~160 chars) | gpt-4.1-nano, gemini-2.5-flash-lite | gpt-4.1-mini, claude-haiku-4-5 | claude-sonnet-4-5 |
| FAQ generation | gpt-4.1-mini | claude-haiku-4-5, gemini-2.5-flash | claude-sonnet-4-5 |
| Outline / structure | gpt-4.1-mini | claude-sonnet-4-5 | gpt-5, claude-opus-4-6 |
| Summary | gpt-4.1-nano | gpt-4.1-mini | claude-sonnet-4-5 |
| Translation (short / medium) | gpt-4.1-mini | claude-sonnet-4-5, gemini-2.5-flash | claude-opus-4-6, gpt-5 |
| Translation (long / specialized) | — | claude-sonnet-4-5 | claude-opus-4-6, gpt-5 |
| Entity extraction (JSON) | gpt-4.1-mini | gpt-4.1, claude-haiku-4-5 | gpt-5, claude-sonnet-4-5 |
| Theme generation (code) | — | gpt-5-mini, claude-sonnet-4-5 | gpt-5, claude-opus-4-6 |
| Proofreading | gpt-4.1-mini | claude-haiku-4-5 | claude-sonnet-4-5 |
| AEO score | gpt-4.1-nano | claude-haiku-4-5 | gpt-4.1 |
| AI Assistant chat | gpt-4.1-mini | claude-sonnet-4-5 | gpt-5, claude-opus-4-6 |
Latency Expectations
Section titled “Latency Expectations”| Class | Time per request |
|---|---|
| Direct chat (gpt-4.1*, Flash, Haiku) | < 3 s |
Reasoning low (gpt-5 family with reasoning_effort=low) | 3–10 s |
| Reasoning medium (default) | 10–30 s |
| Reasoning high or large model | 30–60+ s |
Step 1 — Get API Keys
Section titled “Step 1 — Get API Keys”- Anthropic (Claude): console.anthropic.com
- OpenAI: platform.openai.com/api-keys
- Google Gemini: aistudio.google.com/app/apikey
Step 2 — Add Keys
Section titled “Step 2 — Add Keys”Self-hosted:
Set your API key(s) in .env or your process environment. The Admin UI reads masked keys from the environment and stores provider/model assignments in the database.
Serverless (Vercel): Add keys as environment variables in your Vercel project settings (they cannot be written to the file system at runtime):
ANTHROPIC_API_KEY=sk-ant-...OPENAI_API_KEY=sk-...GEMINI_API_KEY=AI...Then go to Admin → Settings → AI to select your active provider and configure per-feature model assignments.
Step 3 — Select Provider and Models
Section titled “Step 3 — Select Provider and Models”In Admin → Settings → AI:
- Choose your default provider (the fallback for any feature without a specific assignment)
- Optionally assign specific providers/models per feature
- Save
Monitoring Token Usage
Section titled “Monitoring Token Usage”The AI settings page shows cumulative token usage per provider so you can monitor costs.