AI
Run TimeWren's AI features on a local model with Ollama, an EU provider or your own key, and control what is sent.
TimeWren has optional AI features: the timesheet autopilot, the "write what you did" fallback, task parsing from text and email, project suggestions, prioritisation and email triage. All of them go through one provider-neutral layer (Vercel AI SDK), so you choose where the model runs.
Nothing is sent without consent
Calendar titles, tasks, emails and descriptions can be personal data. The server sends no text to a model until an owner or admin of the organisation ticks AI may process the organisation's data under Settings → AI. This applies to every provider, including a personal key a member has set up and the server's own AI. Turning the box off stops all AI calls for the organisation straight away, on every server instance. Changes are written to the organisation's audit log. Upgrading does not tick the box for you: an organisation that used AI with a personal key before has to turn it on once.
Choose a provider
There are three places a model can come from, checked in this order:
- The organisation's own model (Settings → AI, "AI for the organisation"): OpenAI, Anthropic, Mistral (EU) or any local or OpenAI-compatible server. Keys are encrypted at rest.
- A member's own key (Settings → AI, provider presets).
- The server's AI, configured with environment variables. Some features only use it when
AI_SYSTEM_FOR_ALL=true.
AI with Ollama only
This keeps every AI call on your own server. The compose overlay adds an Ollama container on the internal network and points TimeWren at it.
docker compose -f docker-compose.yml -f docker-compose.ollama.yml up -d
docker compose -f docker-compose.yml -f docker-compose.ollama.yml exec ollama ollama pull qwen2.5:3bThe overlay sets these variables, which you can also set yourself if Ollama runs elsewhere:
AI_PROVIDER=openai-compatible
AI_BASE_URL=http://ollama:11434/v1
AI_MODEL=qwen2.5:3b
AI_SYSTEM_FOR_ALL=true
AI_SYSTEM_ONLY=true
AI_ALLOW_PRIVATE_URLS=trueThen log in as an organisation owner, open Settings → AI and tick the consent box. Test the connection sends a short request to the server's model, so you can check it answers.
AI_SYSTEM_ONLY=true makes the server use only its own model: keys saved earlier on the organisation or by members are ignored, so no text can reach a cloud provider, also on an instance that used cloud keys before.
Sizing: a 3B model needs about 3 GB of RAM and runs on CPU. On a 16-core server it answers a short request in a few seconds; the first request after a restart is slower while the model loads. A larger model (7B to 8B) gives better project suggestions but needs about 6 GB and is slower on CPU. See the measurements in the spike report linked below.
An EU provider
Pick Mistral (EU) as the organisation's provider and paste a key from console.mistral.ai. The default model is mistral-small-latest. Or set it for the whole server:
AI_PROVIDER=mistral
AI_API_KEY=your-mistral-key
AI_MODEL=mistral-small-latestPrivate addresses
By default a URL set in the app must be public HTTPS, so a user cannot make the server call internal services. On a self-hosted instance where the model lives on a private address, set AI_ALLOW_PRIVATE_URLS=true. Leave it off on a public instance with many customers.
Timesheet autopilot
Time → Today's suggestions proposes the day's entries from your synced calendars (Google, Outlook, iCloud, CalDAV). Each suggestion shows its source, a confidence score and a one-line reason, and you can accept, edit or dismiss it. Scoring uses your calendar rules, earlier entries with the same title, and project or client names in the title; it needs no AI. With AI allowed, Improve uncertain suggestions with AI sends only the uncertain titles and project names (under short keys, no ids, descriptions or attendees) to the model.
Only meetings that have ended are suggested, so a meeting later in the day that gets cancelled is never logged. Browser and desktop activity is not collected automatically yet. As a prototype, Add browser history in the review takes a BrowserHistory.json from Google Takeout: the file is read in your browser and not stored, only the day's blocks (domain, page title, time span) are sent with the request, and browser suggestions are never logged automatically. Integrations can send activity blocks through the API.
Automatic logging is off by default. Under Settings → AI → Timesheet autopilot a user can turn it on with a minimum confidence; suggestions above it are logged when the review opens, and every evening at 21:00 by the timesheet-autopilot cron job, also when the app is closed. When two suggestions overlap, only the more certain one is logged. A suggestion is never logged automatically if the day already has an entry without a start time on the same project or with the same text. An AI guess on its own is capped at 75 %, so a high threshold only logs suggestions backed by your own rules or history.
Fallback switch
AI_ENGINE=openai-legacy routes OpenAI-compatible providers through the older openai client instead of the AI SDK. Use it only if the new layer misbehaves with your provider.
Measurements
The model comparison behind these defaults is in the repository at docs/research/2026-11-28-ai-sdk-spike.md, with the raw numbers next to it.