Skip to main content
Once evaluations define what correct means, cost becomes a search problem instead of a guess. The quality bar is fixed, so you can try cheaper configurations and keep any that still pass. The goal is not the most capable model; it is the cheapest one that does the job.

Why model choice is the cost lever

A workflow’s cost is mostly its model choices: the OCR engine and the language model each step uses. Those are configuration, not code, so they are easy to change. Evaluations tell you whether a change broke anything.

Pick the cheapest mode that passes evals

Before swapping OCR engines or vision models, check whether the document already has usable embedded text:
  • parseMode: native — zero parsing credits and no OCR/vision egress. Best for digital PDFs and strict data-residency requirements. Does not support raster images or figure descriptions. Fails if every page is empty or has detectable native-text problems rather than silently OCRing.
  • parseMode: native-or-ocr — same local-first path; pages with detectable native-text anomalies (empty, U+FFFD, lone surrogates, forbidden controls, unassigned/noncharacter, heavy PUA) trigger OCR. Provider capabilities decide whether only those pages are processed and billed. Reduced-byte subset egress is a separate capability, so the original document may still be uploaded even with page selection. Without page selection, the provider processes the whole document, but only fallback pages replace native text. OCR credits apply to usage.ocrPagesProcessed (provider pages dispatched), not necessarily every page in the output.
  • parseMode: ocr / vision — full-document parsing when native text is unreliable or you need layout/vision semantics on every page.
Legacy nativeText: true on OCR/Vision still works but applies document-wide — prefer explicit native modes for predictable billing. Then run the experiment workflow below when comparing OCR engines or LLM models on steps that still need provider egress.

Swap a model and re-run

Change the model on the relevant step, push a new version, and run the experiment. If the score still clears the threshold, you lowered cost with no loss of reliability.
compare shows you exactly which examples moved, so a small quality drop on a non-critical field is a deliberate decision rather than a surprise.

Re-run the search when prices change

Prices change and new models ship. Because the evaluations are permanent, you can re-run this search whenever that happens and re-pick the cheapest passing configuration. Operating cost stays at the minimum required to hold the agreed quality level, without anyone re-checking outputs by hand.