Infiano
Let’s talk

LLM Cost Optimization

Reduce the cost of a useful result, rather than optimizing the price of an isolated model call.

An illustrative comparison: both workflows cost $1,500, but 800 accepted baseline results cost $1.875 each and 750 candidate results cost $2 each.
Illustrative comparison · hypothetical inputs
0% read
Text
Contents

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.

Editorial takeaway · Infiano Research & Engineering
Total workflow cost ÷ accepted results
Use the same period, workload definition and acceptance rule on both sides of the comparison.

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

  1. Define one accepted task and record the current workload.
  2. Preserve a baseline and a separate evaluation set.
  3. Test the suspected cost bottleneck while keeping the same acceptance conditions.
  4. 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.

Illustrative cost comparison — hypothetical inputs, not customer results
Monthly measureBaselineCandidate
Tasks received1,0001,000
Model calls$500$300
Human review$1,000$1,200
Accepted results800750
Cost per accepted result$1.875$2.00
A workflow from incoming requests through model calls and validation to accepted results, with retries and review included in the cost boundary.
The measurement boundary covers the workflow that produces an accepted result, including retries and review.

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.

See the change in a real project

The HR case describes a narrower screening task and a move toward a compact model in the company's own environment.

Read the HR optimization case

Notes on the method

  1. 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 ↑
  2. PyTorch: Benchmark ↗

    Benchmarking guidance for reproducible timing comparisons. Use the intended workload and environment.

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

Tell us about your project.

The goal, your current approach and the constraint are enough to start.

Start with the task
What should the system help a person or product accomplish?
Make the limit clear
Accuracy, cost, latency, data access or a method that does not yet exist.
Define a useful next step
A focused discussion can establish the evidence and scope the next stage needs.
hello@infiano.ai ↗
Your first call

If you’d like to meet, suggest a time in your time zone. We’ll confirm by email. In 30 minutes, we’ll discuss your goal, the main constraint and a useful next step.

Prefer email? ↗

LET’S FIND THE NEXT STEP

Bring us your challenge.

Tell us the goal, what you have tried and what is holding the work back.

Search Infiano

Open the full search page ↗
Website privacy

Cookie settings

Optional analytics are currently off. The services below are planned and cannot collect data through this site.

Necessary settings

Page functionality and your requested privacy preferences. No advertising use.

Always available