AI Features
AI is entirely optional. When disabled (the default), all AI UI elements are hidden and no AI code runs. The app stands on its own as a fast task manager.
What AI Provides
- Task enrichment — Natural language parsing into structured tasks. Type "call dentist next tuesday high priority" and AI extracts: clean title, due date, priority, labels, project, and recurrence.
- Quick Take — A snappy one-liner when you add a task, with awareness of your existing tasks ("you've got 2 other Acme tasks this week").
- What's Next — Recommendations surfacing overlooked or forgotten tasks.
- Insights — Scoring and signals (stale, quick win, etc.) to help prioritize your list.
Setup
Set OPENTASK_AI_ENABLED=true and configure a provider. Add these variables to your .env file (Docker) or .env.local (bare metal). OpenTask auto-detects which provider to use based on which keys are set, or you can set OPENTASK_AI_PROVIDER explicitly.
Option 1: Anthropic API (Recommended)
OPENTASK_AI_ENABLED=true
ANTHROPIC_API_KEY=sk-ant-...
OPENTASK_AI_ENRICHMENT_MODEL=claude-haiku-4-5-20251001
OPENTASK_AI_QUICKTAKE_MODEL=claude-haiku-4-5-20251001
OPENTASK_AI_WHATS_NEXT_MODEL=claude-haiku-4-5-20251001
OPENTASK_AI_INSIGHTS_MODEL=claude-haiku-4-5-20251001Option 2: OpenAI
OPENTASK_AI_ENABLED=true
OPENAI_API_KEY=sk-...
OPENTASK_AI_ENRICHMENT_MODEL=gpt-4.1-mini
OPENTASK_AI_QUICKTAKE_MODEL=gpt-4.1-mini
OPENTASK_AI_WHATS_NEXT_MODEL=gpt-4.1-mini
OPENTASK_AI_INSIGHTS_MODEL=gpt-4.1-miniOption 3: xAI (Grok)
OPENTASK_AI_ENABLED=true
OPENAI_API_KEY=xai-...
OPENAI_BASE_URL=https://api.x.ai/v1
OPENTASK_AI_ENRICHMENT_MODEL=grok-4-1-fast-non-reasoning
OPENTASK_AI_QUICKTAKE_MODEL=grok-4-1-fast-non-reasoning
OPENTASK_AI_WHATS_NEXT_MODEL=grok-4-1-fast-non-reasoning
OPENTASK_AI_INSIGHTS_MODEL=grok-4-1-fast-non-reasoningOption 4: DeepSeek
OPENTASK_AI_ENABLED=true
OPENAI_API_KEY=sk-...
OPENAI_BASE_URL=https://api.deepseek.com
OPENTASK_AI_ENRICHMENT_MODEL=deepseek-chat
OPENTASK_AI_QUICKTAKE_MODEL=deepseek-chat
OPENTASK_AI_WHATS_NEXT_MODEL=deepseek-chat
OPENTASK_AI_INSIGHTS_MODEL=deepseek-chatOption 5: Ollama (local, free)
OPENTASK_AI_ENABLED=true
OPENAI_API_KEY=ollama
OPENAI_BASE_URL=http://localhost:11434/v1
OPENTASK_AI_ENRICHMENT_MODEL=llama3.1
OPENTASK_AI_QUICKTAKE_MODEL=llama3.1
OPENTASK_AI_WHATS_NEXT_MODEL=llama3.1
OPENTASK_AI_INSIGHTS_MODEL=llama3.1Option 6: Claude Code SDK
Uses your Claude Code authentication — no API key needed. Requires Claude Code installed on the server.
OPENTASK_AI_ENABLED=trueINFO
Options 2-5 all use the OpenAI-compatible API path. Any provider with an OpenAI-compatible endpoint works — set the base URL and per-feature model names. You can use the same model for all four features.
Model Selection
Each AI feature has its own model variable so you can tune speed vs. quality per feature:
| Variable | Feature | Optimized for |
|---|---|---|
OPENTASK_AI_ENRICHMENT_MODEL | Task enrichment | Speed (parsing is simple) |
OPENTASK_AI_QUICKTAKE_MODEL | Quick Take | Balance (needs context awareness) |
OPENTASK_AI_WHATS_NEXT_MODEL | What's Next | Speed |
OPENTASK_AI_INSIGHTS_MODEL | Insights | Quality (analysis is complex) |
For Anthropic API and OpenAI-compatible providers, all four per-feature model variables are required. Use your provider's model names (e.g., claude-haiku-4-5-20251001, gpt-4.1-mini, grok-4-1-fast-non-reasoning).
For Claude Code SDK, defaults are applied automatically — no model variables needed. Override with OPENTASK_AI_ENRICHMENT_SDK_MODEL, etc., using short names like haiku, sonnet, opus.
See Configuration for the full list of AI environment variables.
How Enrichment Works
When you create a task with just a title (no due date, priority, or labels), AI enrichment triggers automatically. It extracts:
| Field | Example Input | Extracted |
|---|---|---|
| Title | "um call dentist tomorrow" | "Call dentist" |
| Due date | "tomorrow morning", "next Tuesday at 2pm" | ISO 8601 UTC datetime |
| Priority | "high priority", "urgent", "no rush" | 0-4 integer |
| Labels | "label it as errands" | ["errands"] |
| Recurrence | "every Monday", "daily" | RFC 5545 RRULE string |
| Project | "add to family" | Matched to existing project |
| Notes | Context details the AI extracts | Supplementary information |
If you provide any structured fields (due date, priority > 0, labels, or recurrence), enrichment is skipped — the task is created exactly as specified.
