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
| Variable | Required | Default | Description |
|---|---|---|---|
| OLLAMA_ENDPOINT | optional | http://ollama:11434/api/generate | Ollama API endpoint. Use http://host.docker.internal:11434/api/generate if Ollama runs on the host. |
| LLM_MODEL | optional | qwen2.5:7b | Ollama model name. Must be pulled first. |
Pull the model before your first import:
docker exec local-ollama ollama pull qwen2.5:7bNote
OpenRouter Setup
| Variable | Required | Default | Description |
|---|---|---|---|
| OPENROUTER_API_KEY | required | - | Your OpenRouter API key. Get one at openrouter.ai. |
| OPENROUTER_MODEL | optional | qwen/qwen-2.5-7b-instruct | Model to use for import processing. |
Tuning
| Variable | Required | Default | Description |
|---|---|---|---|
| ENRICH_BATCH_SIZE | optional | 20 | Number of merchants per LLM enrichment batch. |
| ENRICH_CONCURRENCY | optional | 3 | Max parallel enrichment calls. Auto-set to 20 for OpenRouter. |
| PDF_CONCURRENCY | optional | 3 | Max 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