BelegLotse
Extracts invoices/dunning letters into structure, validates them (validation flags) and exports to DATEV — optionally 100 % local. Live.
Problem & context
Typing in receipts is slow and error-prone
Every receipt must be captured, checked and exported to DATEV. An extractor that recognises fields, validates against §14 UStG and exports cleanly — optionally cloud-free — speeds up bookkeeping.
Solution
OCR + LLM + validation instead of typing
PDF/image via OCR or text, structured extraction (typed fields + confidence) and — the core — deterministic validation OVER the AI output: VAT arithmetic, § 14 UStG, default § 288 BGB, IBAN/VAT-ID → visible validation flags. Export to DATEV (EXTF), CSV, JSON.
Architecture
Clean Architecture, four layers
Receipt, ValidationFlag + LLM/OCR port
BelegExtractor + validation rules (UStG/BGB)
pypdf, Tesseract OCR, Mistral/Ollama, DATEV/CSV/JSON
FastAPI: upload + /extract (SSE) + /export
Process history
From plan to deploy — six phases
- 01
Setup & architecture
DONEClean-arch skeleton, Docker, CI (ruff + mypy --strict + pytest). Amber accent.
- 02
OCR & extraction
DONEPDF (pypdf) / image (Tesseract) / text; LLM structured output → receipt + confidence.
- 03
Validation
DONEDeterministic rules over the AI: VAT, § 14 UStG, § 288 BGB, IBAN (mod-97), VAT-ID → flags.
- 04
Eval harness
DONE10 receipts: field accuracy, exact-match, validation-catch-rate (detects VAT errors).
- 05
Export & extractor (SSE)
DONEDATEV (EXTF)/CSV/JSON, upload dropzone, live steps, field table + flags. BFSG/TDDDG.
- 06
Deploy & docs
DONELive on own VPS via Traefik (image with Tesseract). Project docs + design public.
Results
Made measurable
Measured against a golden set (26 cases). Details in the project documentation.
Stack & compliance
Receipts contain personal & tax-relevant data → optionally 100 % local (Ollama + Tesseract), no storage (data minimisation). Disclaimer: no tax advice (StBerG).