---
title: AI assistant
description: >-
  Connecting the optional assistant to a model of your own: what it can do, what
  reaches your provider, and where your token is kept.
sidebar:
  icon: sparkles
---
It will only discuss this app: personal finance, how to use it, and privacy.

## How do I enable it? [#how-do-i-enable-it]

Open **Settings → AI Assistant**, switch it on, paste the **API base URL** (e.g. `https://api.openai.com/v1`), the **model name** (e.g. `gpt-4o-mini`), and your **API token**. Hit *Test connection*, then *Save*.

## Which providers work? [#which-providers-work]

Anything that speaks the OpenAI Chat-Completions API: OpenAI, OpenRouter, Groq, Together, local **Ollama** (`http://host:11434/v1`), **LM Studio**, **vLLM**, **llama.cpp** server, etc.

## How is a connection's availability checked? [#how-is-a-connection-s-availability-checked]

Each connection has an **Availability check** setting. *Fast* only calls `/models` — quick, but a proxy such as **LiteLLM** answers even when the model behind it is offline. *Model listed* additionally requires your model id to appear in that list. *Real request* (default) asks the provider's `/health` for the model and otherwise sends a 1-token request, so a downed backend shows up. If the proxy answers but the model does not, the badge turns amber **Degraded**. Settings checks all connections when you open it and then quietly every 5 minutes while the tab is visible; each badge shows when it was last checked.

## What can it do? [#what-can-it-do]

Prefill the Add-Transaction form from a sentence like *"I spent 50 at Coop on groceries, paid by credit card"*; answer questions about your data (*"where did I spend most last month?"*) by calling read-only tools; read bank and credit-card statements you upload on the **Statements** screen (PDF or a photo/screenshot) and turn them into comparable rows; and explain app features and the privacy notice. It will refuse any other topic.

## Can I talk to it instead of typing? [#can-i-talk-to-it-instead-of-typing]

Yes, if one of your AI connections has a **transcription model** set (Settings → AI Assistant, e.g. `whisper-1` or a local `faster-whisper` model). A microphone button then appears in the chat: record, stop, and the text lands in the input box for you to review before sending. Audio is recorded as a 16 kHz mono WAV, sent to that provider only, and never stored — the activity log keeps only the transcript preview.

## Does it write to my data? [#does-it-write-to-my-data]

No. The chat only **prepares a draft** for the Add screen, and the classification passes (statement lines, pending transactions) only fill **suggestion fields** that you accept or ignore — you always review and save manually. All other tools are read-only.

## Five tasks, one of them unprompted [#the-five-actions]

The AI is used in five places. You can assign each one its own connection (and its own model) under **Settings → AI Assistant**:

| Task | When it runs |
|---|---|
| **Chat** | when you type in the assistant |
| **Read statement** | when you upload a statement |
| **Categorise lines** | right after reading, for lines without a match |
| **Suggestions for pending transactions** | **automatically**, as soon as a line without a category arrives |
| **Voice input** | when you press the microphone |

The fourth is the only one that starts **without you doing anything** — for instance when [FinReader](/finreader) reports a payment. If you do not want that, assign it no connection or leave it switched off.

## What is sent to my provider? [#what-is-sent-to-my-provider]

More than just your messages. Almost every request carries an **overview of your ledger**: accounts with balances, categories with budget and month-to-date figures, your tags, frequent descriptions — and the most recent transactions in full, with date, amount, description, account and category. Without this context the model can neither suggest a category nor answer a question about your money.

How much of it goes along is set per connection:

| Level | Period | Transactions |
|---|---|---|
| **Off** | — | none |
| **Compact** | 30 days | up to 400 |
| **Full** | 30 days | up to 400, more detail |
| **XL** | 180 days | up to 1,200 |

Two exceptions you should know about:

- **Suggestions for pending transactions** upgrade *Off* to *Compact*. Without a category list the pass cannot suggest anything — so *Off* does not prevent anything being sent here. The line's **original notification text** is sent along too.
- **Categorise lines** always sends the *Full* level and converts to CHF while doing so, regardless of your setting.

The complete breakdown per task is in the [privacy notice](https://cash-flow.wi-wo.ch/privacy), section 6a.

## What is in the AI log? [#the-activity-log]

Under **Settings → AI log** every request is recorded: time, model, provider host, duration, token usage — and **excerpts of the content**: the beginning of your last message, the beginning of the reply, the arguments and results of each tool call, and for voice input the beginning of the transcript. Your API token is never written down there.

**This log is not deleted automatically.** Unlike the general audit log, which is cleared out after a year, it stays until you empty it yourself — the button for that sits above the list.

## Where is my API token stored? [#where-is-my-api-token-stored]

Server-side in the `ai_endpoints` table, one per connection. It is **not** returned to the browser, but the server operator can read it — treat it like other credentials on this instance.
