Why our finance AI is not allowed to produce a single number
--- title: "Why our finance AI is not allowed to produce a single number" published: false description: "How we built OfinTech Desk so every figure traces back to its source, with deterministic math, a CPU-only classifie
---
title: "Why our finance AI is not allowed to produce a single number"
published: false
description: "How we built OfinTech Desk so every figure traces back to its source, with deterministic math, a CPU-only classifier and an LLM that only explains."
tags: opensource, ai, fintech, python
Every finance team I have worked with asks the same question about every report: where did this number come from?
When AI enters the picture, that question gets harder to answer, not easier. A language model can write a fluent month-end summary, but if it also produced the figures in it, nobody can say where they came from. In finance, a number you cannot trace is a number you cannot use.
So when we built OfinTech Desk, we started from one rule: every figure must have a source. This post explains the architecture that rule forced on us.
The rule, in practice
In OfinTech Desk you can click any number and open the chain behind it:
- The computation that produced it
- The ledger rows that fed that computation
- The source document
- The exact page in that document
If a figure cannot show that chain, it does not appear.
Three layers, three jobs
The key decision was to split the work into three layers and to be strict about what each one is allowed to do.
1. Deterministic code does the math
All arithmetic happens in plain, deterministic code: statements, month-end close, KPIs, VAT return figures. Same input, same answer, every time. There is no sampling, no temperature and no "usually right".
This also makes the system testable in the normal way. A KPI is a function, and a function has unit tests.
2. A classifier makes closed decisions
Some steps are not arithmetic but judgement, for example matching a bank line to a payment provider payout. These are closed decisions: the answer comes from a fixed set of options.
For those we use a small trained classifier we call the Ofin model. It returns a choice together with a measured probability, so the system can tell a confident match from a doubtful one, and a person can set the threshold above which matches are accepted automatically.
It learns from the team's own accept and reject decisions, so the second month is more accurate than the first.
3. The LLM only explains
The language model sits at the end of the pipeline. It reads the figures and their sources and explains them in plain language, in Arabic or English. It never invents a number.
Because the model is not trusted with the math, the choice of provider matters much less. You can use any LLM provider, a local model, or no model at all, and every figure stays the same.
No GPU required
We wanted this to run where finance data already lives, often on a modest server inside the company. So the classifier is deliberately small.
On a 2-core CPU it labels a bank line in about 0.03 ms. A 500-page bank statement takes under a second, and retraining on a team's own decisions takes about 0.3 seconds. No GPU anywhere.
Read-only by design
OfinTech Desk does not replace your accounting system. It connects read-only to QuickBooks Online, Xero, Zoho Books and Odoo, or imports a general ledger from Excel or CSV, and sits beside the system you already run.
Read-only is a feature, not a limitation. An assistant that cannot write to your books or move money is one a risk officer can actually approve. Everything runs on your own servers, so the data never leaves your network.
What I learned
- Decide what the model is not allowed to do. The most useful design decision was a restriction, not a capability.
- Measured confidence beats fluent confidence. A probability you can set a threshold on is worth more than a well-written paragraph.
- Small models go a long way. For closed decisions, a tiny CPU model was faster, cheaper and easier to audit than a large one.
Try it
The core is free and open source under Apache-2.0. There is a paid tier for payment settlement reconciliation, which is how we fund the project.
- GitHub: https://github.com/OfinTech/ofinTech-Dask
- Walkthrough video: https://youtu.be/kAX4ZPZ1NFk
- Website: https://ofintech.ai
Contributions are welcome, and I would love feedback on the provenance model, especially on where you think it breaks down.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.