Configuration

AI Import

Configure local Ollama or cloud OpenRouter for AI-powered bank statement import.

Overview

The bank import feature uses an LLM to parse PDF and CSV bank statements into categorized transactions. You can use either a local Ollama instance or OpenRouter (cloud API). Only one provider is needed.

Providers

Ollama (Local)

Free, runs on your hardware. Requires Docker or a local install. GPU is optional but speeds up processing.

OpenRouter (Cloud)

Pay-per-token API. No local setup. Faster for large batches. Requires an API key from openrouter.ai.

Ollama Setup

VariableRequiredDefaultDescription
OLLAMA_ENDPOINToptionalhttp://ollama:11434/api/generateOllama API endpoint. Use http://host.docker.internal:11434/api/generate if Ollama runs on the host.
LLM_MODELoptionalqwen2.5:7bOllama model name. Must be pulled first.

Pull the model before your first import:

bashbash
docker exec local-ollama ollama pull qwen2.5:7b

Note

GPU is optional. Ollama runs fine on CPU for personal use. Processing is just slower.

OpenRouter Setup

VariableRequiredDefaultDescription
OPENROUTER_API_KEYrequired-Your OpenRouter API key. Get one at openrouter.ai.
OPENROUTER_MODELoptionalqwen/qwen-2.5-7b-instructModel to use for import processing.

Tuning

VariableRequiredDefaultDescription
ENRICH_BATCH_SIZEoptional20Number of merchants per LLM enrichment batch.
ENRICH_CONCURRENCYoptional3Max parallel enrichment calls. Auto-set to 20 for OpenRouter.
PDF_CONCURRENCYoptional3Max parallel PDF chunk parsing calls. Auto-set to 10 for OpenRouter.

OpenRouter defaults are higher because cloud APIs handle concurrency better than a local GPU.

Access Control

The admin controls who can use AI import. Options include a whitelist (only specified users), a blacklist (everyone except specified users), and per-user overrides. Monthly token quotas can be set to limit usage. All of this is managed from the admin panel.

Model Recommendation

The default model (qwen2.5:7b) offers a good balance of speed and accuracy for transaction parsing. Larger models may improve accuracy for unusual statement formats but require more resources.

Tip

Start with the default model. Only change it if you see consistent misparses on your specific bank's format.