Skip to content

Guides

How to cut LLM costs

Most LLM spend comes from a few jobs your app runs over and over. Trimming, caching, and batching shave a share off each of those calls. Moving a high-volume job to a small model trained on it changes the price of the call itself.

The short answer

  • Break spend down by job. Not by model or by team: by the question your app asks.
  • Trim, cache, and batch. Shorter prompts, cached prefixes, and slower lanes for work that can wait.
  • Route the easy calls. Send them to a cheaper model when you can tell them apart.
  • Replace the biggest job. A small model trained on it costs a fraction per call. Sous’s example models cost 8.5 and 6.2 times less.

Where the money goes

The cost of a job is its number of calls times the tokens in each call times the price of those tokens. A job that runs a million times a month with a long prompt can cost more than everything else combined. So the first step is a table: each job, its calls per month, its average input and output tokens, and the model it uses.

The levers, from quickest to biggest

LeverHow it savesGood forWatch out for
Trim prompts and cap outputsFewer tokens per callEvery jobCutting context the model needs
Prompt cachingA lower rate on repeated prompt prefixesLong, stable instructions or documentsOnly exact prefix matches count
Batch and flex processingLower prices for slower turnaroundBack-office and offline jobsNot for calls a user is waiting on
RoutingA cheaper model for easy callsMixed trafficYou need a reliable way to tell easy calls from hard ones
A small model trained on the jobA far lower price per token, and usually faster answersHigh-volume jobs with an answer that has a shapeIt needs examples and a test on calls it never saw

OpenAI, for example, charges a lower cached-input rate on reused prompt prefixes, discounted by up to 95% depending on the model, and lists lower Batch and Flex prices for work that can wait. Check your provider’s current rates.

Why a small model saves the most

The other levers lower the cost of a frontier model’s tokens. A small model changes which tokens you pay for. On Sous, a trained model costs from $0.05 per million input tokens and $0.40 per million output tokens at 2B, and $0.10 and $0.80 at 4B. Here are two jobs as the Sous trainer logged them:

JobCheaper than the frontier modelSame answer as the frontier modelLearned from
PII redactor8.5×84%128 calls from an app
Support ticket router6.2×92%300 past tickets

It works best on jobs with an answer that has a shape: a label from a list, yes or no, fields, a score. See SLM vs LLM for where a small model fits, and estimate your savings with the calculator on the pricing page.

Cut costs without losing answers

  1. Keep a test set. Hold back real calls, about 20% of them, and score every change on them.
  2. Change one lever at a time. So you know which one moved quality.
  3. Switch only on a match. Move a job to a cheaper setup when it gives the answers you want on calls it never saw.
  4. Keep watching. Inputs drift. Rescore after you switch, and retrain when the job changes.

Sous does this for a job automatically: it keeps your current model’s answers, trains up to 4 small models, and switches your app only when one matches.

Questions people ask

What is LLM cost optimization?

Cutting what you spend on model calls without losing the answers you need: fewer tokens, cheaper tokens, or a cheaper model for the job.

What is the fastest way to cut LLM costs?

Measure spend by job, then trim the prompt and turn on caching for the biggest one. For the largest savings on a high-volume job, train a small model on it.

Does a smaller model hurt quality?

On broad, open-ended work, usually. On one narrow job, a small model trained on your calls can give the same answers most of the time: Sous’s example models matched the frontier model on 84% and 92% of calls they never saw. Measure before you switch.

How much can a small model save?

In Sous’s example runs, 8.5 and 6.2 times less per call than the frontier models they learned from.

Does prompt caching work on every request?

Only when requests share an exact prefix. Put stable instructions and documents first and the parts that change last.

Sources

Train your first model

Wrap your client and keep calling your model. Sous trains a small one on your calls and switches you over when it’s ready. Every account starts with $20 of credit, and a training that fails costs nothing.

Four steps, from your app’s calls to a small model

  1. 1Make a model and an API keyin the app
  2. 2Wrap your clientSous(OpenAI(), model=…)
  3. 3Use your app as usualSous keeps each call
  4. 4Let it switchwhen a student is ready