Using (local) LLMs with hledger records and reports

I’ve spent some time recently playing with LLMs and my financial records, and I want to share my findings. Most of them are trivial, but I hope that they could nevertheless be useful or provide food for thought.

I’m quite paranoid re sending my personal info to third parties, so I was not comfortable with giving commercial providers like ChatGPT or Anthropic access to my records as-is – even if they promise some degree of anonymity, like Deepinfra or Venice.ai. I’ve decided that there are two ways to go around this limitation: anonymising my data and using local inference.

On anonymising data

I found that you can go surprisingly far if you convert your quantitative facts to qualitative or comparative descriptions. Instead of saying “I earn $X, my expenses are $E, my house costs $Y, my mortgage is $Z, and my total estate is $T”, you can say, for example, something like “I am interested in estate planning. My estate is more than .” or “My earnings put me in and my mandatory expenses are X% of that, and further voluntary expenses are Y% of that”, and so on. Some of the answers or facts could be pure “yes/no” binary answers: yes, I have kids. No, I do not have Roth IRA. Etc

I found that you can almost always find a way to give a qualitative answer in a way that would move the discussion forward in a meaningful way. Your initial prompt could say, “I am not comfortable disclosing exact amounts, but I am ok giving qualitative answers. If you identified meaningful boundaries or limits, you can ask me how my figures compare to that”, to ensure that the model formulates the questions in a way that works with qualitative answers.

Depending on the questions and answers, this could still be a significant disclosure of personal circumstances, of course :slight_smile: , which brings me to the next point.

Local inference

When running local models, I found that I am getting the most value from opencode (which is a CLI tool similar to Claude Code) or open-notebooklm, rather than a simple chat-like interface.

Opencode could grep through your journals and reports, could be instructed to run "hledger” directly to extract the numbers it needs, and in general, works best when you are exploring things.

Open-notebooklm works best when you want to combine your records with other documents - for example, you can create a notebook, upload your tax code, your tax filing and your end-of-year reports from hledger, and ask the model to verify that the saved tax form lines up with your financial record (double-checking your work).

I know that hledger MCP exists, but I havent tried it yet.

Dear reader, share your stories from the trenches :slight_smile: Are you using LLMs, what for, and how?

1 Like