Skip to content
dhii.ai

AI Infrastructure & MLOps

AI Cost Optimisation

Lower your AI bill without lowering quality — by measuring where the money goes and fixing the biggest leaks first.

Cost audit
1–2 weeks
Quick wins
2–4 weeks
Structural savings
1–3 months

AI bills grow quietly

Most AI features launch on the largest model available with generous prompts, because that’s the fastest way to get something working. Then usage grows, and so does the invoice — often faster than revenue. Optimising later is entirely possible, but only if you can see where the money goes and can prove that cheaper doesn’t mean worse.

Measure first

We start by instrumenting every request: which feature, which model, how many input and output tokens, how long it took and whether the outcome was successful. The breakdown usually surprises people — a background job nobody watches, a retry loop, a feature that stuffs whole documents into every prompt. Alongside cost, we build a quality baseline, so every optimisation can be evaluated rather than hoped about.

The levers

  • Routing. Send simple requests to small, cheap models and reserve frontier models for the hard ones, escalating automatically when the small model is unsure.
  • Caching. Use provider prompt caching for repeated system prompts and context, and semantic caching for frequently repeated questions.
  • Context discipline. Retrieve fewer, better passages; trim boilerplate; ask for structured, concise outputs.
  • Batching. Move non-urgent work to batch APIs, which providers typically price lower.
  • Fine-tuned small models. For a high-volume narrow task, a fine-tuned open model can replace an expensive general one.
  • Right-sized infrastructure. For self-hosted models: the right GPU, quantisation, continuous batching and autoscaling to avoid paying for idle hardware.

Savings that stick

We make changes one at a time, each with a measured effect on cost and quality, and finish with budgets, per-feature alerts and a simple monthly review so spend stays under control as usage grows. We do this for our own products too: OptyCV runs its LLM pipeline on low-cost and free-tier models with fallbacks, which forced us to get good at it.

Deliverables

What you get

  • 01

    Cost breakdown

    Spend by feature, model, customer and request type, with cost per successful outcome.

  • 02

    Quality baseline

    An evaluation set so every saving is checked for quality impact.

  • 03

    Model routing

    Cheap models for easy requests, capable models for hard ones, with automatic escalation.

  • 04

    Caching and batching

    Prompt caching, semantic caching of repeated answers and batch APIs for offline work.

  • 05

    Prompt and context trimming

    Shorter prompts, tighter retrieval and structured outputs that cut tokens.

  • 06

    Infrastructure right-sizing

    GPU selection, quantisation, autoscaling and spot capacity for self-hosted models.

Process

How a ai cost optimisation project runs

  1. Step 1

    Instrument

    Add per-request cost and outcome tracking if it doesn't exist.

  2. Step 2

    Baseline

    Measure current quality so savings can be validated.

  3. Step 3

    Prioritise

    Rank savings opportunities by size, effort and risk.

  4. Step 4

    Optimise

    Implement changes one at a time, each evaluated for quality.

  5. Step 5

    Govern

    Set budgets, alerts and a monthly cost review.

Engagement models

Ways to work together

Every engagement starts with a fixed, written quote. See engagement models & pricing or the self-hosted llm vs api — cost, privacy and performance.

FAQ

AI Cost Optimisation: common questions

How much can we save?

It depends entirely on your current setup. Teams that send every request to the largest model with long prompts often have large savings available; already-optimised systems have less. The audit gives you a specific estimate before you commit to changes.

Won't cheaper models reduce quality?

Sometimes, which is why every change is measured against an evaluation set. Routing sends only suitable requests to cheaper models and escalates when confidence is low.

Is self-hosting always cheaper than APIs?

No. Self-hosting pays off at steady, high volumes or when privacy requires it. At low or spiky volumes, APIs are often cheaper once you count GPU idle time and engineering effort. We model both.

What is semantic caching?

Storing answers to previous requests and reusing them when a new request means the same thing, even if worded differently. It works well for repetitive questions and must be scoped so users never see each other's private data.

Related services

Start a project

Have a workflow that should run itself?

Tell us what you want automated or built. You get a written assessment of feasibility, risks and a fixed quote — usually within two business days.