AI CompendiumA public chart of the language
Training & Inference

Inference

Using a trained model — the part you pay for on every request.

Definition

Running a trained model to produce output. No weights change; the model just performs the forward pass and generates. This is what happens on every single API call.

Inference cost is driven by how many tokens go in and how many come out, plus how much hardware the model needs. It is the recurring bill, as opposed to training’s one-off one.

Every cost and latency conversation is an inference conversation. The levers are few and mostly mechanical: generate fewer tokens, make fewer calls, parallelise what is independent, reuse prefixes, and cache results you have already computed. Model choice is the fifth lever and usually the bluntest.

How people use it
Budget review.
"Training was a one-time line item. Inference is every request, forever. That is where the money goes."
Worked example

Cutting a slow feature without changing models

A three-step pipeline feels sluggish.

Independent steps run in parallel instead of in sequence, the shared instruction preamble moves to a cached prefix, and the responses stream so the user sees tokens immediately. Same model, same quality, materially different experience.

Sources
  • docsLatency optimisation ↗OpenAI API docs · 2026

    The four levers that matter: fewer output tokens, fewer requests, parallel independent work, and streaming. Also defines throughput in tokens per second.

  • docsPrompt caching ↗OpenAI API docs · 2026

    Caching reuses the model’s key-value state for a matching prompt prefix. Explains why reordering your system prompt throws away the cache.

  • docsBatch processing ↗Claude platform docs · 2026

    Message batches for high-volume asynchronous work — evals, classification, backfills — with the submission and results lifecycle.

  • docsBatch API ↗OpenAI API docs · 2026

    Asynchronous batch requests for evals, classification and embeddings, with its own turnaround window and pricing — the cheap lane for non-interactive work.

Related terms