Same results, a fraction of the cost
Cost
−0%
LLM cost per document after the migration
Scope
0
core prompt families redesigned: company code, vendor, extraction
Paying for vagueness
Understand the process, then shrink the model
01
Audit every prompt
Mapped what each step really decided, what it received, and where it relied on the model guessing.
02
Redesign around patterns
Split mixed decisions, added structured reference tables, and made context a deliberate choice.
03
Prove it on smaller models
Ran every version against the same test set until cheaper models matched or beat the baseline.
What made small models work
design / decompose
One decision per step
Narrow, well-defined questions that small models answer reliably.
data / tables
Reference tables, not recall
Candidate companies and vendors passed as compact, consistent tables, so the model chooses instead of guessing.
context / ocr
OCR only when it helps
Decided per task when to include OCR text, which pages matter, and when to leave it out entirely.
output / shape
Strict outputs
Clear formats that remove a class of errors and make results easy to validate.
eval / evidence
Measured, not felt
Every change compared on the same documents for accuracy and cost.
craft / reuse
Reusable playbook
The same patterns carry over to new prompts and new document types, not just the ones that were migrated.
Cheaper, clearer, easier to improve
pipeline — before / afterlive
$eval --baseline large-models
→accuracy: baseline · cost per document: 100%
$eval --candidate small-models --prompts v-redesigned
✓company code: matches baseline
✓vendor: matches or beats baseline
✓extraction: matches or beats baseline
✓cost per document: ~20% of baseline