The assistant
Ledgeline has an optional chat assistant. It answers questions about Ledgeline and hledger from their manuals, reads your books to answer questions about them, builds tables and charts from exact figures, and proposes changes to your journal that you approve or reject. Every approved change can be undone.
The assistant is off until you set it up. Until then nothing in the app mentions it except Settings → Assistant, which says it is off and how to turn it on. There is no button, menu item or shortcut for it.
It talks to a language model that you choose. The recommended setup is a model running on your own computer or your own network, so your books never leave your machines. Hosted services such as OpenAI, Anthropic, Google Gemini and OpenRouter work too. They start with Help access only: a third-party service can answer general questions but doesn’t see your financial details.
Turning it on
The assistant needs a profile: a model server, the model to use on it, and how much the assistant may do with it. You add profiles in Settings → Assistant, or by hand in ui-prefs.toml. Both end up in the same place, the [ai] table of your global ui-prefs.toml. Profiles are never stored in a books folder, so books you share through git or a synced folder never carry your model server’s address.
The open books use the first of these that exists:
- the profile the open books pick in their own
ledgeline.toml(see Choosing for one ledger), if it exists; - otherwise the default profile;
- otherwise the only profile, when there is just one.
With several profiles and no default, the assistant is off unless the books pick one. Settings says so.
A model on your own machine
Any server that speaks the OpenAI Chat Completions protocol works, and so does Ollama’s own protocol. These three are the common ones:
| Server | Start it | Profile kind | Address |
|---|---|---|---|
| llama.cpp | llama-server -m model.gguf --port 8080 | openai-compatible | http://127.0.0.1:8080/v1 |
| Ollama | ollama serve, after ollama pull of a model | ollama | http://127.0.0.1:11434 |
| LM Studio | Start its local server from the app | openai-compatible | http://127.0.0.1:1234/v1 |
Ollama also answers the OpenAI protocol at http://127.0.0.1:11434/v1, so the openai-compatible kind works with it as well. vLLM and other OpenAI-compatible servers work the same way.
The smallest working setup is one profile in ui-prefs.toml, in Ledgeline’s config folder:
[ai]
default = "local"
[ai.profiles.local]
name = "Qwen on this Mac"
kind = "openai-compatible"
url = "http://127.0.0.1:8080/v1"
model = "qwen3-30b"
access = "propose"
local is the profile’s id. model must be a name the server lists. A local profile with no access line gets Propose. The [ai] section of the settings files page lists every key.
In Settings
Settings → Assistant does the same without editing a file. It is the last tab. Click it, press its number key if it has one, or open Settings with ?tab=assistant. The number keys follow the tabs you can see.
- Click Add profile.
- Give it a name. The id is made from the name. It is how
ledgeline.tomlrefers to the profile, and it can’t be changed later. - Choose the kind and enter the server address. The form says “This server is on your network” for a local address, and warns when it isn’t.
- Enter the model name. Ledgeline suggests the models the server has (see Model suggestions).
- Choose what the assistant may do, and how many tool rounds one answer may take, then click Add profile.
- Click Check. Ledgeline asks the server which models it has and what the chosen one can do, and reports what it found: whether the server answered, whether your model is one of the ones it lists, and whether the model takes tool calls.
- With more than one profile, click Make default on the one to use.
When the assistant is on, the top of the tab says which profile it is using and which key opens it.
Model suggestions
You don’t have to know the model’s exact name. About half a second after you stop typing the server address, Ledgeline asks that server which models it serves. The Model field then offers them as you type, and says “Found 12 models”, say.
Asking saves nothing. The profile is only written when you click Add profile or Save. If the server doesn’t answer, the form says nothing and you type the name yourself.
A few rules decide when Ledgeline asks:
- A local server is asked as soon as its address is complete.
- An
openai-compatibleserver that isn’t local is asked only once there is an API key for it, either typed in the form or already saved with the profile. - The OpenAI, Anthropic, Google Gemini and OpenRouter kinds are never asked, since that would be a request to a third party you didn’t make. Type the service’s model id.
- A saved API key is only ever sent to the profile’s own saved server. If you change the address of a profile with a saved key, the new address is asked without it. Type the key again to get suggestions from there.
If your ui-prefs.toml is a symbolic link managed by a dotfiles tool, Ledgeline won’t write to it. Add the profile to your dotfiles by hand instead.
Local or hosted
Ledgeline decides from the address whether a server is local or hosted:
- Local:
localhostand the loopback addresses, private network ranges (10.x,172.16.xto172.31.x,192.168.x, IPv6fc00::/7), link-local addresses, the100.64.0.0/10range Tailscale uses, and names ending in.local,.lan,.home.arpa,.internalor.ts.net. - Hosted: every other address, and the OpenAI, Anthropic, Google Gemini and OpenRouter kinds.
A hosted server must use https. A plain http address that isn’t local is refused.
If you run your own model server under a public name, tick This is my own server in the profile, or add network = "local" to it. Ledgeline then treats it as local, with local defaults and no third-party warnings. Only do this for a server you run yourself. It applies to names only: a public IP address is always hosted, and so are the four hosted service kinds.
Hosted services
The OpenAI, Anthropic, Google Gemini and OpenRouter kinds always talk to the service’s own address, so a profile of one of those kinds has no url. They need an API key (see API keys).
[ai.profiles.claude]
name = "Claude"
kind = "anthropic"
model = "claude-sonnet-5-5" # the service's model id
A hosted profile starts at Help, which sends the service your question and the manual sections the assistant looks up, and nothing about your books. Raising it needs your explicit confirmation; see What the assistant may do.
On iPhone and iPad
The iOS app has its own assistant settings, separate from your Mac’s. Set a profile up in the app’s Settings › Assistant, then open the chat from the menu’s Assistant item.
A phone or iPad doesn’t run a model server, so a profile that points at localhost or 127.0.0.1 does nothing there. The app leaves such profiles out and notes this in Settings, and if that leaves none, the assistant is off. Use one of these instead:
- A model server on a computer on your network, by its network address:
http://192.168.1.20:8080/v1orhttp://my-mac.local:11434. The server has to accept connections from other machines: start llama.cpp withllama-server --host 0.0.0.0, and Ollama withOLLAMA_HOST=0.0.0.0. The first time the app connects, iOS asks whether Ledgeline may find devices on your local network. Answer Allow. If you said no, turn Local Network on for Ledgeline under Settings › Privacy & Security. - The same server over Tailscale, by its
.ts.netname or100.xaddress, which also works away from home. - A hosted service, with its API key, which the app keeps in the device’s keychain.
The app has no hledger, so a few things differ from the desktop:
- There is no
hledgertool.totalsis added up by Ledgeline itself. - Help searches Ledgeline’s pages and the accounting guide, but not the hledger manual.
- In proposed changes, the
hledger checkrows read “not run”. The other checks, and the assistant’s promises, are checked by Ledgeline (see The checks).
What the assistant may do
Each profile has an access level. Each level includes the one before it.
| Level | What the model sees and does | Default for |
|---|---|---|
| Help | Answers questions about Ledgeline and hledger. Sees the manuals and your question, not your books. | Hosted profiles |
| Read | Also reads your books to answer: transactions, payees, amounts and account names. | |
| Propose | Also reads the books’ files as written, and proposes changes to your books. Nothing is written until you approve it. | Local profiles |
Ledgeline enforces the level itself. The model is only told about the tools its level allows, and a call to any other tool is refused, so a model can’t gain access by asking for it.
At Help, the model is told nothing about your books, not even your account names. From Read up, it also gets a short summary of them: the main journal’s file name, how many transactions there are and over which dates, the commodities, and the top-level accounts. The summary has no amounts and no payees.
Raising a hosted profile above Help shows a warning first. It names the service and says that the transactions, payees, amounts and account names the assistant reads to answer you are sent to it, under its own data retention policy. You confirm with Allow read access.
Raising a hosted profile to Propose shows a second, stronger warning: a third party’s model would choose edits to your books, and it reads whatever it needs to write them. You can Allow proposals, or Use Read instead. Every change still waits for your approval either way, but for changes a model on your own machine or network is the safer choice.
Writing
access = "read"oraccess = "propose"into a hosted profile inui-prefs.tomlby hand skips these warnings. The file is yours, so Ledgeline takes it as your decision.
API keys
Hosted services need an API key, and a local server can take one too if you set it up that way. Enter it in the profile’s API key field. Ledgeline keeps it in your operating system’s keychain, the same place it keeps bank sync’s access keys, and never writes it to a file or shows it again. A profile with a saved key says “key saved”. Remove key deletes it, and deleting the profile deletes its key too.
On a system with no keychain Ledgeline can use, Settings says that API keys can’t be stored on this computer, so services that need one won’t work there. Local servers without a key still work.
Choosing for one ledger
A ledger can make one of two choices for itself, under [ai] in its own ledgeline.toml:
[ai]
# Use this profile from ui-prefs.toml for these books.
profile = "local"
[ai]
# Never offer the assistant for these books.
enabled = false
profile picks one of the profiles in your ui-prefs.toml by id, as the default for these books. If no profile has that id, the books use the default as usual. It doesn’t stop you picking another profile for a chat. enabled = false turns the assistant off for these books whatever else is set, and is the only way to keep it away from a ledger entirely.
A books folder can make only these two choices. A ledgeline.toml travels with the books, so somebody else may have written it, and it can’t add a profile, name a server or model, or change an access level. Anything else under its [ai] is ignored.
Ledgeline never writes [ai] in ledgeline.toml; edit the file by hand. Settings → Assistant shows what the open books’ file says.
Using it
When the assistant is on, a chat button appears at the right of the top bar.
- Mod+J (Cmd on macOS, Ctrl elsewhere) shows or hides the chat panel at the side of whatever screen you are on. It works from inside the chat’s own text box too, so the key that opened the panel closes it.
- g a opens the full Assistant view, with the chat on one side and its results on the other. There, Mod+J moves to the message box.
Type a question and press Send. Stop ends an answer early. The chat header shows the profile in use, whether it is local or hosted, and its access level. New chat starts over, and Changes lists the changes the assistant has made to these books (see Undo).
As the assistant works, the chat shows each step. “Used totals” lines expand to the request it made. “Sent to profile: …” lines expand to exactly what that tool returned to the model, so you can see what left Ledgeline. For a hosted profile these lines are marked “third party”. Some models also show their reasoning under Thinking.
Each tool call gets 60 seconds.
Choosing the profile for a chat
With more than one profile, the chat header has a profile list in place of the name. A chat starts on the profile the books use (see Turning it on), and you can pick any other for this chat. The pick lasts until you quit Ledgeline, so New chat keeps it, and it never changes the default in Settings. A key-based service shows in the list only once its key is saved. A ledger that says enabled = false offers none.
Picking another profile always starts a new chat. The conversation so far stays behind, so a chat that read your books through a model on your own machine is never handed to a hosted one. If the chat has messages, Ledgeline asks first. Changes it proposed that you haven’t approved are dropped, as with New chat, and attached files aren’t carried over. Your last message is put back in the box, unsent, so pressing Enter asks the other model the same question.
Tool rounds
Answering one message usually takes the assistant a few rounds of lookups: search the manual, run a report, narrow the result, then answer. Each profile sets the most rounds one answer may take, under Tool rounds. The default is 10, and it can be anything from 0 to 50.
When the rounds run out, the assistant answers with what it has found so far. Raise the limit if answers keep stopping short, or lower it to keep a slow model from working on one question for too long.
Sometimes a model’s reply arrives empty, with no text and no lookup. This usually means the model asked for a lookup in a form its server couldn’t read, and the server dropped it. The chat says so, and the model is asked to try again, at most twice per message. Each retry uses one round. If the reply is still empty, the answer stops with an error. Trying again often works; a different model may work better.
A model can also stop after announcing a lookup, such as “Now let me check the purchase:”, without making it. The usual cause is the same, a lookup the server couldn’t read. When a reply ends like that and rounds remain, the chat says so and the model is asked to make the lookup or give its answer. This happens at most once per message, and uses one round.
At 0 the assistant is a plain chat. It gets no tools at all, not even the manuals, and answers from the model’s own knowledge and what you type. It can’t see your books at any access level.
Answers are formatted text, with a few limits for safety. Images in an answer are never loaded; they show as [image: …]. Links show their full address as text and aren’t clickable.
What it can reach
The model never runs anything on your computer. There is no shell, no general file access and no network access. Everything it does goes through a fixed set of tools built into Ledgeline, each with the same checks as the rest of the app.
At Help:
- search the hledger manual and this manual, and read a section;
- show the built-in help for an hledger command (
hledger balance --help, say).
At Read, also:
- read Ledgeline’s own reports (see Reading Ledgeline reports);
- add up accounts or payees, in total or per month, quarter or year (
totals). This runshledger balance, so the numbers are hledger’s own (in the iOS app, which has no hledger, Ledgeline adds them up itself); - find individual transactions by account, description or payee, dates, amount or tag, newest, oldest or largest first (
transactions); - list the chart of accounts with each account’s type;
- run one of a fixed list of read-only hledger reports, for what the tools above don’t cover:
balance,register,aregister,print,balancesheet,balancesheetequity,incomestatement,cashflow,accounts,payees,descriptions,tags,commodities,prices,stats,activity,checkandroi; - build tables from those results and show them as tables or charts (see Tables and charts).
The assistant tries these roughly in that order: Ledgeline’s reports first, then totals and transactions, and a raw hledger report only when nothing else fits.
totals and transactions take account names loosely. “groceries” finds expenses:food:groceries, and “food” finds expenses:food and everything under it. A type such as expenses, income or assets picks every account of that type, going by the type: you declared (or, if you didn’t, the account’s name, as hledger does). Each answer starts with a line saying which accounts matched, how many transactions there were and their total, so you can check it read the question the way you meant. Dates are a period such as 2026, 2026-03, 2026q1, lastmonth or thisyear, or a from and to date. As in hledger, the to date isn’t included.
At Propose, also:
- list the files in your books folder: journals, rules files, CSVs,
ledgeline.tomland the like, with their sizes and which journals the books include; - read lines from one of those files;
- search those files with a regular expression;
- propose a change, and revise a proposal you sent back (see Proposed changes).
Reading the files themselves is for making changes, so it comes with Propose. At Read, answers come from the tools above, which read the books the way Ledgeline does.
These limits keep the tools contained:
- Only files below the main journal’s folder can be listed, read or searched. Ledgeline won’t follow symbolic links or enter dot-folders, and a path it didn’t list is refused, so
../and absolute paths go nowhere. - The model never writes an hledger command line. It fills in a request (which report, which query, which period), and Ledgeline builds the command from that. A query term can’t start with
-, so the model can’t add options of its own. - What the tools return has your folder paths taken out. The model sees
2025.journal, not the full path to it. - Ledgeline’s reports come from a fixed list too. The model names a report and fills in its options, each checked before the report runs.
- When the assistant writes a shell script for you, it shows the script and doesn’t run it. Scripts use only the
hledgerandledgelinecommands, and run outside Ledgeline’s protections when you run them.
The help tools search the hledger manual built into your own hledger program, and the pages of this manual, which are built into Ledgeline. Nothing is fetched from the internet. Without hledger, only this manual is searched. Help answers draw on the hledger manual, Ledgeline’s own pages and the Accounting basics guide, so general bookkeeping questions get answered offline too; the assistant never fetches web pages.
Reading Ledgeline reports
From Read up, the assistant can read the same reports you see in Ledgeline, so its figures match your screens. It prefers them to a raw hledger report when one fits. The reports it can read are:
- Statements. The balance sheet (at one date or at the end of each period), the income statement, cash flow, net worth over time, and each account’s change per period.
- Insights. The Insights dashboard, startup metrics such as MRR and churn, and subscriptions.
- Budget. Budget against actual, and categories with spending but no budget.
- Holdings. Investment holdings, and other assets valued by price, such as a house.
- Projections. The list of scenario files, without amounts.
- Accruals. Accrual status, recognition entries due, deferrals with no schedule yet, and proposed invoice-to-payment matches.
- Journal. Payees, tags, the Journal tab’s summary and chart for a filter, one account’s running balance, cash on hand, problems Ledgeline finds in the books, and the review queue.
This is a fixed list, and the assistant can’t reach any other part of the app through it. No report on it writes a file, changes a setting, updates prices, reaches the network or shows your keys, so nothing the assistant reads this way can change anything. Prices, bank sync, settings, rules and imports aren’t on the list.
The assistant uses these reports to answer you. They don’t become tables you can open. For those it runs hledger reports or searches transactions.
Tables and charts
The assistant doesn’t type the figures in its tables and charts. When a tool returns rows (an hledger report, a search for transactions), Ledgeline keeps them as a dataset with exact amounts. The model can then ask for a new dataset made from one it has: filtered, narrowed to some columns, grouped and totalled, pivoted, sorted, cut to the top few with the rest as “other”, bucketed by week, month, quarter or year, given a running total, or compared before and after. Ledgeline does that arithmetic with exact decimals. The model only picks the steps.
When the assistant shows you a result, it opens as a tab in the results pane. A chat line for each dataset has Show to open it, and in the side panel a link opens the full view where the results are. A result can be:
- a table, where clicking a column header sorts by it;
- a bar, stacked bar, line, area, pie or waterfall chart. A pie takes at most eight slices.
Every result ends with where it came from, such as the hledger command and the steps after it. Copy command copies the hledger command so you can run it yourself.
Export .xlsx saves a result as an Excel workbook. The first sheet holds the table, laid out like the reports’ exports, with amounts as numbers rather than text. A Notes sheet records the title, each step that made the result, the hledger command, and when you exported it. A chart can also be saved with Download PNG or Download SVG.
The assistant still writes numbers in its answers. Ledgeline compares every amount in an answer with what the tools returned in this conversation and with what you typed. A number found in neither gets a dotted underline, with the note “Not from your books”. This catches the worst case, a total the model made up. It can’t catch everything, such as a real number quoted for the wrong thing.
Charting a table yourself
You don’t need to ask the assistant for a chart. Every table result has a Table and Chart toggle at the top. Chart draws one straight away, with no model involved, and shows three controls:
- Chart picks the kind, from the same list the assistant uses.
- X axis picks the column across the bottom.
- Values lists the columns to plot. Tick the ones you want. A pie or waterfall takes one.
The first chart puts the first date or text column across the bottom and plots every number column. It is a line over dates and bars over anything else. Ledgeline refuses what it would refuse the assistant, such as a text column as values or a pie of more than eight slices, and says why. Table goes back, and your choices are kept if you switch again. Export and downloads work as they do for the assistant’s own charts.
Charting a table from an answer
Sometimes the assistant writes a table into its answer instead of opening one. Each such table has an Open in results button under it, which opens it as a table result, so Chart and Export .xlsx work on it too. Ledgeline reads a column as numbers when every filled cell is one ($1,234.56, -40 EUR, (12), 12.5%), as dates when every cell is a date, and as text otherwise.
These figures are the ones the assistant typed, not ones Ledgeline worked out from your books, and the result says so where it shows where it came from. Numbers the books don’t contain are already marked in the answer. A table from an answer can’t be saved as a report, because there are no steps to run again. Ask the assistant to build it from your books if you want to keep it.
Saved reports
A result you want again next month can be kept as a saved report. Click Save as report on a result in the full Assistant view, give it a name, and click Save. Ledgeline keeps how the result was made, not its numbers, so running it later uses your books as they are then.
A saved report holds three things:
- the request that made the source table, such as the hledger report and its query and period;
- each step the assistant applied to it since, such as a filter, a grouping or a sort;
- how it is showing, as a table or a chart. If you charted it yourself with Chart, your chart is what gets saved.
Periods stay as they were asked for. A report of “this year” covers this year whenever you run it, and a fixed date stays fixed.
Only results that started from totals, transactions, an hledger report or the account list can be saved. Answers drawn from Ledgeline’s own reports aren’t tables, so there is nothing to save. A result Ledgeline can’t remake says so when you try.
Running a saved report
The Saved reports list sits above the results in the full Assistant view (g a). Reports made on the books you have open come first. One made on other books shows an Other books badge, and you can still run it here.
- Run makes the report again from today’s books and opens it as a results tab. No model is involved, so nothing is sent anywhere. The tab works like any other result: table or chart, the Table/Chart toggle, and the same exports.
- Rename changes the name in the list.
- Delete asks once more. The button turns into Delete?, and a second press deletes the report.
Before a run, Ledgeline checks that the open books have every account the report asks for. If some are missing, it runs nothing, and says which accounts these books lack rather than showing you an empty table.
Saving, listing, running and changing saved reports all need the assistant to be on for the books you have open, even though a run reaches no model.
Saved reports are kept in ai-recipes.toml in Ledgeline’s config folder, never in your books folder.
Proposed changes
At Propose, the assistant can’t change your books directly. It can only propose a change, which Ledgeline checks and shows you, and nothing is written until you approve it.
A proposal is a list of edits of a fixed set of kinds:
- add a transaction;
- change a transaction: its date, description, status, a posting’s account, a tag, its comment, or replace some of its postings (which is how a split works);
- delete a transaction;
- declare an account, optionally with its type;
- declare a commodity;
- add
Pprice lines for a commodity; - remove an account’s declaration, described below;
- change or delete one comment, blank line or
accountline outside every transaction, described below; - a bulk edit, described below.
An edit to an existing transaction names it by its position and by its date and description. If the transaction has changed since the assistant read it, the edit is refused rather than applied to the wrong entry. One proposal can hold up to 200 edits.
Before changing a transaction’s postings, the assistant can look the transaction up (show_transaction): its journal text, and each posting numbered the way the edits count them, with the amount hledger works out for a posting you left blank.
For the three changes asked for most, the assistant has shortcuts that take only what you’d say yourself, and Ledgeline builds the full proposal from them:
- Add a transaction: the date, description and postings. An account your books don’t have is refused (usually a typo) unless you asked for a new account, which is then declared.
- Recategorize: the transactions, the account their postings are in now, and the one they belong in. Ledgeline finds the postings itself.
- Rename an account: the old and new names. Its subaccounts move with it, and so do their
accountlines, renamed where they are.
When your books declare their accounts, the shortcuts declare any new account too, with the type of the one it replaces. Each shortcut’s proposal also carries the checks that should hold, such as “the number of transactions doesn’t change” for a recategorize. Shortcut proposals are staged, checked and shown exactly like any other.
A proposal that can’t be staged never reaches you. Ledgeline tells the assistant which edit was wrong and how: an edit of the wrong shape gets the shape it should have had, and one that doesn’t apply gets the posting or amount that went wrong, or how much the transaction is out of balance. Every problem is listed at once, and the assistant is told to fix just those and try again. You see each attempt in the chat as a refused tool call.
The checks
Ledgeline applies the proposal to a copy of your books in memory and checks the result. Your files aren’t touched. The proposal card lists every check under two headings.
Checks are the ones every proposal gets:
- The journal parses and every transaction balances.
- Only the proposed transactions change. No transaction the proposal doesn’t name may change.
hledger check,hledger check accountsandhledger check commodities, run on copies of the books before and after. A check that passed before and fails after fails the proposal. A check that was already failing before is shown as “not run” and doesn’t block. So is the whole set when hledger isn’t available, or when the books include a file by an absolute or~/path: the copies would still point at the real file, so the checks wouldn’t see the change.
Separately, an amount in a commodity your books don’t have is refused before the proposal is staged, unless the proposal declares that commodity. So is an amount or a price with no currency at all (a house priced at 410000 rather than $410,000.00), when your books use currencies.
Promised by the assistant are the checks the proposal declares for itself, saying what must not change:
- the balance of some accounts, in total or at every month end, optionally at cost or market value;
- the postings of some accounts;
- the number of transactions, which must change by exactly a given amount;
- which accounts may change at all.
Ledgeline checks each promise by running hledger on the books before and after and comparing exact amounts. Where hledger can’t run (the iOS app, or books that include a file by an absolute path), Ledgeline checks balance and posting promises itself, with the same query language and exact amounts. It can’t value at market prices that way, so a market-value promise counts as failed there. Any promise that can’t be checked counts as failed.
When only the assistant’s own promises fail, either the change or the promise is wrong, and the assistant is told to work out which. Often it’s the promise: one that claims something the change alters on purpose. For example, turning a house into a priced commodity changes its market value but not its cost. The assistant may narrow or drop such a promise, but it must say why in the proposal’s reason, which you see on the card.
A proposal can also carry a note, which is advice rather than a check and never blocks approval. When a change leaves an account your books declare with nothing posted to it, the note names it, and the assistant is told to remove the declaration unless you want to keep it.
Below the checks the card shows the diff for each file that would change.
Approving
If every check passes, the card offers Approve, Send back… and Discard.
If any check fails, the proposal can’t be approved. There is no “approve anyway”. The card says “A check failed, so this can’t be approved”, shows what failed (for a balance, the months and accounts that differ), and offers only Send back… and Discard.
Send back… returns the proposal to the assistant with the failed checks and any comment you add under “What should change?”. The assistant revises it, and the new version is staged and checked again from the start. Send it back too when a check passes but the change is wrong, or when the assistant promised the wrong thing, such as “no balances change” for a change that is meant to move money.
To approve only part of a proposal, untick the edits you don’t want. The button changes to Approve 2 of 5, say, and the edits you kept are checked again on their own before anything is written.
Approving writes the files the same way the rest of Ledgeline does, only if they haven’t changed on disk since they were read. If your books changed after the proposal was checked, because you edited them or a sync brought something in, Ledgeline doesn’t write. It checks the proposal again against the books as they are now, and the card says: “The books changed since this was checked. It has been checked again; review it before approving.”
Accounts and comments
Many books keep their account lines, and comments about them, in a file of their own. Proposals keep those in step with the transactions:
- A renamed account is renamed where it is declared. The
accountline keeps its place, its type and its comment. If some postings stay with the old name (a rename of only this year’s transactions, say), the old line stays and the new name is declared beside it with the same type. - An account nothing uses any more can have its declaration removed. The
accountline goes, with the indented comment lines under it. Ledgeline refuses while any posting, budget or rule would still use the account or one below it, counting the proposal’s other edits, so a proposal can empty an account and remove it in one go. - A comment the change makes untrue can be changed or deleted. The assistant names the file, the line number and the line’s current text, which must still match. Only comments, blank lines and
accountlines can be changed this way, never a line of a transaction, anincludeor any other directive, and every transaction must come out byte for byte the same.
The diff shows these files too, and all the checks apply as usual.
Undo
Every approved change can be undone. After you approve, the card shows Applied and an Undo button. Changes in the chat header lists the changes the assistant made to the books you have open, newest first, each with Undo.
Ledgeline keeps the last 50 changes, and they survive quitting the app, so you can undo a change you made yesterday. They are kept in the ai-changesets folder in Ledgeline’s config folder, never in your books folder. Each holds the earlier contents of the files it changed, so that folder holds copies of parts of your journal.
Undo puts each file back exactly as it was before the change, but only if the file still holds exactly what the change wrote. If you, a sync or another program has changed one of the files since, undo refuses, names the files, and changes nothing. That means an older change can’t be undone once a newer one has written to the same file, until the newer one is undone first.
There is no git integration. If your books are in git, your own history works alongside this as usual.
Big changes
A change to hundreds of transactions, written out one edit at a time by a model, is likely to contain mistakes. For those, the assistant proposes a bulk edit instead: an hledger query that picks the transactions, plus one operation that Ledgeline applies to each of them. The operations are:
- move postings from one account (and its subaccounts) to another;
- set or remove a tag;
- delete the transactions;
- turn each matched revaluation entry into a
Pprice for a commodity, at the running value of some accounts on that date.
The model only has to get one query and one operation right. The card still lists every transaction it changes, the diff still shows every line, and all the checks still apply. A bulk edit can touch up to 2,000 transactions.
A house as a commodity
Say your books track a house as assets:home:cost plus assets:home:unrealized, with an entry every so often that moves the unrealized gain to match a new valuation. You ask the assistant to track the house as a commodity with prices instead. It can propose:
- declare a commodity
HOUSE; - change the purchase so it buys
1 HOUSE @ $500,000.00intoassets:home; - a bulk edit over every transaction touching
assets:home:unrealized, turning each revaluation into aPprice forHOUSEat the home’s value on that date; - a
Pprice on the purchase date, so the house has a value from the start.
And it promises: assets at market value unchanged at every month end, liabilities unchanged at every month end, and only assets:home and the unrealized equity account touched.
The revaluation entries were the only postings to assets:home:unrealized and the unrealized equity account, so the same proposal can remove those declarations and correct the comments that describe the old way.
If the assistant forgets the price on the purchase date, hledger can’t value the house for the months before the first revaluation, so market-value assets change for those months. That promise fails, the card shows which months differ, and the proposal can’t be approved until it is fixed. Reports at cost will change after this kind of edit. Net worth at market value is what must stay the same.
Ledgeline writes amounts in edits without thousands separators ($520000.00), as it does for every edit.
Attachments
Reading PDFs and emails, such as turning a receipt or an invoice into a transaction or a split, isn’t available yet. For now, paste the text into your message. A message can be up to 64 KiB.
Privacy
- Conversations are kept in memory only. Nothing is saved, and a conversation is gone when you quit, start a New chat, or change the assistant’s settings. Saving or deleting a profile ends every open conversation, and a lowered access level or
enabled = falsetakes effect with the next message. - What leaves your machine with a hosted profile: your messages, the manual sections the assistant reads, and, at Read and above, the book summary and whatever the tools return. The “Sent to” lines in the chat show exactly what each tool returned. With a local profile, all of it stays on your machine or your network.
- Nothing else is sent. There are no conversation titles from a second model and no telemetry. Settings’ Check and the model suggestions don’t contact the hosted service kinds at all; they ask only servers whose address you gave, and nothing is saved by asking.
- File contents are data, not instructions. File text the assistant reads or searches is marked as untrusted, and the assistant is told never to follow instructions found in it. A model can still be fooled, which is why it can’t reach the network or write anything without your approval.
- Undo history holds copies of the file contents it needs, in the config folder (see Undo).
- Saved reports hold the requests that make them, including account names and queries, in the config folder (see Saved reports). They don’t hold the results.
Choosing a model
Assistant models has the results of Ledgeline’s tests for each model tried so far.
- Tool calling matters most. Everything past answering from your own words goes through tool calls: searching the manuals, reading the books, building tables, proposing changes. A model that doesn’t support tool calls can only answer from what you type, and Check says so. Recent llama.cpp builds turn on the chat templates tool calls need. With an older
llama-server, start it with--jinja. - Larger models do better. Multi-step tool use, choosing the right hledger report and writing a correct proposal are hard for small models. The checks stop a bad proposal from being written, but a weak model will spend more of your time sending proposals back.
- Context size limits how much it sees at once. Ledgeline sizes each tool result to the model’s context window, so a model with a small window gets fewer rows per result, and older parts of a long conversation are left out sooner. Check shows the window when the server reports it. When it doesn’t, Ledgeline assumes 8,192 tokens for a local server and 128,000 for a hosted one.
- Ledgeline doesn’t use constrained JSON output. Some local servers can force a model’s output to match a JSON schema with a grammar. In Ledgeline’s testing that made one local model’s answers worse, while the same request without it came out right. Ledgeline asks for structured answers through tool calls instead, and checks every field itself, rejecting anything that doesn’t parse rather than cleaning it up.
- Image support varies by model. Check reports whether a local model reads images: llama.cpp reports it when the server was started with a vision projector, and Ollama reports it per model. Hosted services are assumed to take them. Images will matter once attachments arrive, and in testing, models that accept images didn’t all read an invoice correctly.