58 6 days ago

Turns questions about your Beancount ledger into BQL (beanquery) queries.

3b 7b
ollama run tarioch/qwen2.5-coder-bql:3b

Details

6 days ago

5426f152e516 · 1.9GB

qwen2
·
3.09B
·
Q4_K_M
{{- range .Messages }}<|im_start|>{{ .Role }} {{ .Content }}<|im_end|> {{ end }}<|im_start|>assistan
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.
{ "stop": [ "<|im_end|>" ], "temperature": 0 }

Readme

A fine-tune of Qwen2.5-Coder for the Beancount Query Language (BQL), the query language of beanquery used with Beancount v3. Ask a question about your ledger in plain English and get a BQL query back.

Which tag to use

  • :7b: more accurate, recommended if you have the resources for it.
  • :3b: smaller and faster, matches :7b closely on in-scope questions, but more likely to invent plausible-looking table or column names for questions outside BQL’s scope.
  • latest points to :3b.

Usage

ollama run tarioch/qwen2.5-coder-bql "How much did I spend on groceries in 2024?"

Send just the question. The model replies with a sql block holding the BQL query. No system prompt is needed and it works with any system prompt or none. The Modelfile sets temperature 0; clients that use Ollama’s OpenAI-compatible /v1 API should send temperature: 0 themselves.

Accounts, payees, tags and currencies you name are used exactly as written. Natural words are matched by keyword (“groceries” becomes account ~ 'Groceries'), and generic wording like “all expenses” by account root (account ~ '^Expenses').

Example questions:

  • What is the total spending on insurance?
  • Provide both the cost and the value of assets and liabilities.
  • Which expense accounts have a total above 500 CAD?
  • Show all transactions tagged trip-rome-2024.

Notes

  • Double-check the query before trusting the result. A wrong account regex or date range can return an empty or incomplete answer without an error.
  • State the currency when a query needs one, the model doesn’t know your ledger’s operating currency.

Updates

The tags above are updated in place when a new version of the model is trained. Run ollama pull tarioch/qwen2.5-coder-bql:7b (or :3b) to get the latest one. What changed in each version is listed in the GitHub releases.

More

Training data, methodology and license (GPL-2.0-only): github.com/tarioch/bql-lora