Local models
Books on your own machine
Book bank and card lines to a client's accounts with a model that runs on your computer, so their transactions never leave it.
What it does
bonfyre books puts each bank or card line in one of the client's accounts. It first learns from lines the client has already categorised, which settles most of a month in a fraction of a second. Lines it is unsure of go to your local model, which is shown how the client booked the most similar earlier lines. Anything still unclear is held for review, not booked.
Start the local model
The three commands on these pages ask a model that runs on your own computer. Start it once and leave it running; it loads a model only when a question arrives, and only if there is memory for it.
bonfyre-moe serve --port 7000
bonfyre model local
bonfyre model local lists the models in ~/BonfyreModels, how much memory each needs and which one would answer now. The server picks the strongest model that fits, and moves to a stronger one between jobs when memory frees. Every answer records the exact model file that gave it.
Learn from earlier months
Give a file of lines that are already categorised. Any export with a description column and an Account or Category column will do.
bonfyre books learn --history examples/history.csv --out learned.json
The examples are 6,000 lines of DoDataThings/us-bank-transaction-categories-v2, a public synthetic set of US bank statement lines in 17 categories, published under the MIT licence. They are nobody's real accounts.
Book a month
bonfyre books --transactions examples/september.csv \
--learned learned.json --out booked.csv
booked.csv has the date, description, amount, account, the suggestion, its confidence, what decided it and whether it is held for review. If the file you book already has an Account or Category column, the summary says how many lines agree with it.
How well it works
The next 1,500 lines of the same public set, which the learning step never saw:
| Lines | |
|---|---|
| Booked from what the history taught | 1,447 |
| Booked by the local model | 29 |
| Held for review | 24 |
| Booked lines that match the set's own category | 1,460 of 1,476 |
The run took about four and a half minutes on this computer, nearly all of it the 53 lines that went to the local model. Without any history, every line goes to the local model and all of them are held for review: on 40 hand-written small business lines against the IRS Schedule C expense lines, a 7 billion parameter model suggested the right account for 31 and the 3 billion parameter models for 17 to 24.
Where the data goes
Transactions are marked private and stay on this computer; nothing in this command can send them to a hosted model. Each line keeps a receipt naming the learned file and the model that answered. The client or their bookkeeper still owns the books, and a line held for review is not booked.