DocsOperate and improve
Exact arithmetic
Let decisio compute the line values of a bill, payslip or claim, and the facts of dates and times, exactly and show them to the model, so it checks the numbers instead of computing them.
A decision often depends on numbers in the text: is this invoice’s total right, does this payslip match its rules, is this claim within the limit. A model reading in one pass is good at checking values it can see and poor at computing exact totals from many lines. decisio’s calculator computes the line values exactly and shows them to the model in a fixed block after the state, so the model checks the values instead of computing them, in the same single read.
This is the block the model sees after the state:
Shipment SH-310, shipper: Teo Barrand....Calculator (exact values, shown to six decimals):- Loading time: 89 min x $41.00/h = $60.816667- Cargo weight: 980 lb = 444.528 kg; 444.528 x $0.35 = $155.5848- Haul distance: 212 mi = 341.1716 km; 341.1716 x $1.10 = $375.28876- Cold storage: 2 x $14.25 x 7 days = $199.50- Missed slot: $40.00 x 2 days = $80.00 (taken off)- Handling fee: 2 x $8.50 = $17.00- Claims credit: $25.00 (taken off)- Taxed base: $703.190227- Tax charged: $105.478534A shape to fill in, not a command to run.
The block never states the final figure, a verdict, or whether a claim is right: the decision stays the model’s.
Which models use it?
Section titled “Which models use it?”
It is opt-in per model: the server shows the block only to a model trained with it.
- The model records it. A tuned repository records the block format its model was trained with in
decision_config.json, asdefaults.calculator: "calc-v1". A base and any model that records nothing never see the block. - Decisio v3 records it, so the server adds the exact values for bills, invoices, payslips and dates with no flag. Its first start also downloads the calculator’s small tagger.
How do you turn it on or off?
Section titled “How do you turn it on or off?”- The server:
--calculator auto(the default) shows the block when the model records it;--calculator offnever does. The start printsCALCULATOR calc-v1 (the repository's defaults)when it is on. - A request:
"calculator": falsereads the state without the block, and then no registered task applies to that request."calculator": trueasks for it; on a model that records no format the request is answered without the block, withx-decisio-warningsaying so. - The amounts:
"calculator_input"sends the amounts instead of having them read from the text (below).
What does it read?
Section titled “What does it read?”The calculator reads structure, not item names: lines such as Label: 4 items at $12.50 each, a table of items, or a JSON object’s fields, plus the rule sentences that combine them.
- Items: a quantity at a price; durations at an hourly rate; lengths at a rate; a quantity converted with a factor the text states; per-day charges and day credits over a date range; fees and credits.
- Rules: a percentage added to or taken off one named item before tax; the tax rule; when a credit comes off; a definition of the figure asked about.
- One currency, one record, English (v1).
When does it show nothing?
Section titled “When does it show nothing?”All or nothing. Every line with a number has to be understood. If anything is uncertain, such as a sentence with a number or a rule word that matches no rule kind, an amount nothing places, two currencies or two records, there is no block at all and the response says why.
A missing block is the safe failure; a wrong number is the one failure the calculator is built never to make.
Counts that carry a multiplier or a number word (2 dozen eggs at $3.00 each, 2 packs of six), and a unit factor that joins two kinds of unit (1 lb = 0.4536 m), give no block too.
Which dates and times does it read?
Section titled “Which dates and times does it read?”A second block, time-v1, writes the facts a model would otherwise work out from dates and clock times.
It suits rotas, travel logs, shipment and incident timelines, warranty and notice periods.
The block holds facts, never an answer, and is written only where every value is certain.
Calculator, times (exact):- 13:00 Chicago time, 3 Sep 2026 = 18:00 UTC, 3 Sep 2026- 01:30 by my watch (Madrid time), 4 Sep 2026 = 23:30 UTC, 3 Sep 2026- 13:00 Chicago time, 3 Sep 2026 to 01:30 by my watch (Madrid time), 4 Sep 2026: 5 h 30 min- 31 Aug 2026 + 18 months: 31 Feb 2028 does not exist; February 2028 has 29 daysA shape to fill in, not a command to run.
- Four kinds of line: a dated zoned time in UTC, the real time between two dated zoned times, a date plus N days, weeks, months or years, and a month end that does not exist.
- Zones: an abbreviation with one meaning (CEST, EDT, JST), a UTC offset, or a major city (“Chicago time”), with that zone’s clock changes on the stated date.
- Two readings give no line: an abbreviation with several meanings (CST, IST), a city time without its date, or a date without a year when the text names several years.
- A model records it as
time-v1, orcalc-v1+time-v1for both blocks.
How does the cascade reader read more?
Section titled “How does the cascade reader read more?”The cascade reader may show a block for wordings and layouts the rule reader has no rule for. A small role tagger marks the role of each number in the text, and the same code renders the block, so its format does not change.
- Precision gates: every number marked, every value from the text and units that agree; then the rule reader gives the same block (
rules_agree), the text’s own figures are reproduced (stated_figures), or every tagger decision clears its threshold (threshold). - Never less than the rule reader: where the tagger gives no block, the rule reader’s block stands (
rules_only); where the two give different blocks, there is no block. - A tagger failure is no block, never a failed request.
How is the cascade reader turned on?
Section titled “How is the cascade reader turned on?”- By the model’s repository: a tuned model can turn the cascade reader on by itself, with its tagger pinned by commit and its thresholds written in the repository. Decisio v3 does, so
--basealone serves it. - By flag:
--calculator-reader cascadewith--calculator-tagger. A reader flag beats the repository, and--calculator-reader rulesturns it off. - Where it runs: on the serving card on vLLM with CUDA, and on the CPU on a Mac, where it adds tens of milliseconds to each request whose state it reads.
- If the tagger cannot be loaded, the server still starts, reads with the rule reader, and says why in its start line and in
/health.
How do you send the amounts yourself?
Section titled “How do you send the amounts yourself?”A client that already holds structured amounts can send them, and gets the same block with no reading of the text:
{ "state": "Shipment SH-310 for Teo Barrand: is the total charge of $469.09 right?", "questions": {"total": {"type": "noul", "instructions": "Is the stated total charge right?"}}, "calculator_input": { "currency": "$", "items": [ {"kind": "time", "label": "Loading time", "minutes": [51, 38], "rate": "41.00", "per": "h"}, {"kind": "convert", "label": "Cargo weight", "quantity": "980", "unit": "lb", "to_unit": "kg", "factor": "0.4536", "price": "0.35"}, {"kind": "days", "label": "Cold storage", "quantity": 2, "price": "14.25", "days": 7} ], "fees": [{"label": "Handling fee", "price": "8.50", "count": 2}], "credits": [{"label": "Claims credit", "amount": "25.00"}], "tax": {"rate": "15", "kind": "charged", "outside": []} }}Needs a model whose repository records the calculator format, such as Decisio v3, on a GPU or a Mac; the CPU development model records none.
- Item kinds:
count,days,time,length,convert(with the stated factor) anddaycredit. - Numbers are JSON integers or decimal strings; a JSON float is refused, since it is not exact. Unknown fields are refused, and labels must be unique.
- Validation is strict and all or nothing: an invalid or inconsistent field is a 422 naming its path, on any server.
What does the response say?
Section titled “What does the response say?”x-decisio-calculator:shown; lines=9; version=calc-v1, ornone; reason=<reason>, for exampleunparsed-rule,ambiguous-label,off-by-request,not-trainedorover-limit. With the cascade reader it names the path of a shown block:shown; lines=9; version=calc-v1; path=threshold.usage.input_tokenscounts the block./healthreportssystemone.calculatorwhen the server shows the block: its version and how many requests it read, showed a block for or took amounts for. No state text is logged.
What does it not cover?
Section titled “What does it not cover?”- A request never fails because of it: a block that would push the row over the engine’s prompt ceiling is left out (
none; reason=over-limit). - Not with images or
--mode packed, and not on other runtimes: an Ollama listing does not run decisio’s server. - Tasks and certificates carry the format when the block is on, so a task registered or a certificate made on reads with the block applies only where the block is shown. A certificate made with one reader is suspended under the other: certify again after you switch.
What next
Section titled “What next”- Server flags:
--calculatorin full. - The HTTP API: the
calculatorandcalculator_inputfields and the response headers. - Serve Decisio v3: the repositories that record the calculator.