Start with the unit your business actually buys
A language-model API bill is a symptom of a workflow. The first useful question is what one accepted result costs: a reviewed document, a completed screening task, a supported customer conversation or a successful extraction. A cheap call can become expensive when it is repeated, repaired or reviewed by a person.
Build a baseline from representative requests. Include input length, output length, number of calls, retries, tool use, review time and the share of results that are accepted. Keep both typical and difficult examples. The goal is to see where resources go before choosing a new model or deployment platform.
A cheaper model call can still produce a more expensive accepted result.
Define the quality boundary before changing the system
Write down the mistakes the workflow must avoid. A plausible answer can still omit a required field, invent a fact or fail a tool call. Turn those failure modes into an evaluation set with clear acceptance criteria. Keep a held-out group of examples that is not used while tuning prompts or training a smaller model.
Agree which trade-offs are acceptable. A longer response time may be fine for a batch task and unacceptable for an interactive product. A small average quality change may hide a large failure rate in a valuable customer segment. Compare the same task, data and operating conditions when assessing alternatives.
Include these items in the quality review
- Missing or invalid required fields
- Unsupported claims or invented information
- Repeated tool calls and repair attempts
- Cases that need human review
- Failures concentrated in an important customer segment
Look at the workflow before replacing the model
Inspect the requests themselves. Long repeated instructions, unnecessary context, redundant calls and unbounded retries can create avoidable work. Some tasks can be routed to a simpler deterministic step or a smaller model, while difficult cases continue to a stronger model or human review.
Caching also needs a correctness rule. Decide what makes two requests equivalent, when an answer expires and whether a cached answer is safe for the data involved. Measure the effect on complete tasks. A cache hit rate or token reduction is useful operational evidence, but neither is a substitute for an accepted business result.
Evaluate smaller models and distillation as candidates
A specialized model may be suitable when the task is sufficiently bounded and representative training data are available. Knowledge distillation[1] is one possible way to transfer behavior from a larger teacher to a smaller student. It is a method to evaluate, not a promise that every model can be compressed without losing important behavior.
Keep the teacher baseline, the candidate model and the evaluation procedure reproducible. Inspect errors rather than only averages. Review data permissions and the teacher provider’s applicable terms before creating training material. Training and maintaining a model introduce work of their own, which belongs in the comparison.
Compare local inference with the whole operating cost
Local deployment changes the cost structure. Hardware, capacity planning, utilization, upgrades, model monitoring and engineering ownership become part of the decision. It may also help when data must stay in a controlled environment, provided the surrounding application and access controls are designed for that requirement.
Benchmark a realistic workload on the intended environment. Record concurrency, request sizes, warm-up behavior and latency distributions. A single fast demonstration does not establish production capacity. Compare the operating cost at expected demand and under a credible peak, including the cost of keeping the service available.
Make the release decision explicit
A useful optimization report states what changed, how it was measured, which quality thresholds were retained and where the candidate still fails. Keep the original baseline available for comparison. Plan a limited rollout with a fallback route and a clear condition for reverting.
Infiano’s existing HR optimization case describes a move toward a compact task-specific model and local deployment. Its reported outcome belongs to that project. For a new workflow, the right starting point is a bounded evaluation of your data, current system and constraints, followed by a decision on whether the improvement justifies the operational change.
A sequence for the first evaluation
- Define one accepted task and record the current workload.
- Preserve a baseline and a separate evaluation set.
- Test the suspected cost bottleneck while keeping the same acceptance conditions.
- Review the important errors, full operating cost and rollback condition before release.
A lower API bill can still buy a worse result
Consider an illustrative monthly comparison, not a result from an Infiano engagement. Both versions receive 1,000 tasks. The baseline spends $500 on model calls and $1,000 on review, with 800 accepted results. A candidate spends only $300 on calls but requires $1,200 of review and produces 750 accepted results. Both versions cost $1,500 in total. The candidate's API bill looks better, yet each accepted result costs more.
The baseline costs $1.875 per accepted result; the candidate costs $2.00. This simple calculation leaves out infrastructure and other costs, which should be added when relevant. It demonstrates why the denominator matters. Before celebrating token savings, ask whether the same work was completed and which costs moved elsewhere.
Use the worksheet to record a real baseline for your workload. Keep measured values separate from estimates, state the period and currency, and identify the person responsible for each input. If review effort is not recorded, sample it explicitly rather than silently treating it as zero. An initial optimization scope can then target the cost component with the clearest evidence.
| Monthly measure | Baseline | Candidate |
|---|---|---|
| Tasks received | 1,000 | 1,000 |
| Model calls | $500 | $300 |
| Human review | $1,000 | $1,200 |
| Accepted results | 800 | 750 |
| Cost per accepted result | $1.875 | $2.00 |
Practical questions
Should we start by switching to a cheaper model?
Start by measuring the workflow. A cheaper model may be a good candidate, but repeated attempts, invalid outputs and extra review can outweigh the lower call price. Compare it against the same acceptance conditions and representative workload.
When is local inference worth investigating?
When the workload, data boundary or operating costs justify evaluating it. Include hardware utilization, service ownership and maintenance alongside cloud spend. A private deployment is a different operating model, so the comparison should cover the whole system.
What should we bring to an optimization discussion?
Bring a task description, representative requests, the current model configuration and whatever cost and quality records you have. The first stage can establish missing measurements before deciding whether routing, context changes, distillation or local inference deserves a test.
Notes on the method
- PyTorch: Knowledge Distillation Tutorial ↗
A primary-source introduction to teacher–student distillation. Whether it suits a particular LLM workflow still needs its own evaluation.
Back to the text ↑ - PyTorch: Benchmark ↗
Benchmarking guidance for reproducible timing comparisons. Use the intended workload and environment.
Sources and further reading
Bring representative requests, the current configuration and the cost of a useful result. We can scope a first evaluation before choosing a model change.
Discuss LLM optimization