Blog Local AI No. 08

Why VioPO reads orders with a model we run ourselves

There are two ways to build a service that reads documents with an AI model. You can call a hosted model through someone else's API, or you can run a model yourself. VioPO does the second. This is why, and what it costs us.

What is in a purchase order

A purchase order tells you who buys what from whom, at what price. Prices and margins, customer names and addresses, buyers' names and email addresses, delivery sites. For many businesses that is commercially sensitive, and some of it is personal data.

When a document goes to a hosted model API, it goes to another company, under that company's terms, retention policy and choice of where to process it. Many providers offer good terms for business customers. It is still one more party holding your customers' orders, and one more thing to explain in a supplier security questionnaire.

When the model runs on hardware we operate, the document is read and dropped. No other party sees it. We can say exactly what happens to it: it is held in memory while it is processed and not kept.

Control over the model

A hosted model can change under you. Providers update models, retire versions and adjust behaviour. For a chat assistant that is usually fine. For an API whose whole value is that the output does not change shape, it is a risk.

Running the model ourselves means we pick the version, test it against our sample orders, and change it only when we choose to. The output format is ours too, and we do not depend on a provider's structured output feature behaving the same next month.

What it costs

It is not free. Local models are smaller than the largest hosted ones, so we do more of the work around the model:

  • A fixed schema the model fills. The model returns values as text inside a structure we define; it is never asked to invent the structure.
  • Normalisation in code. Dates, amounts, currencies, countries and units are converted by ordinary, tested code, not by the model.
  • Arithmetic checks. Every response is checked for sums that do not add up.

We also have to run and pay for the hardware, plan capacity, and queue requests at busy times. That is why the API has a queue and plans have a monthly page allowance.

Is a smaller model good enough?

For purchase orders, current open vision language models do well. An order is a structured business document with clear labels, which is the kind of page these models read best. On the sample orders on our example output page, a PDF with a text layer, a US style order and a scanned image, every line and total is read, and every arithmetic check passes.

Where a smaller model is more likely to slip is on poor scans and unusual layouts. The checks exist for exactly that. They will not catch everything, so for orders that will be posted without a person looking, we suggest posting only those where every check passed and there are no warnings.

You can judge for yourself: open the sample orders and their results and compare each result with the document. When VioPO opens, you can do the same with your own orders.