Inference
Running an already-trained model to produce output from an input, as opposed to training it. Every API call or local generation is an inference request.
Why it matters. Per-token prices, speed and rate limits are all properties of inference, so most cost and latency decisions are inference decisions.
How it works
Inference uses a model whose weights are fixed: the prompt is split into tokens, passed through the network, and the model produces output tokens one at a time. The model does not learn from your requests while answering them; whether a provider later uses your data for training is a separate policy question.
For language models, inference has two phases, prefill (reading the prompt) and decode (generating output tokens), with different costs and speeds. Providers run it on clusters of GPUs or other accelerators, using serving engines that batch many users' requests together, which is why price per token falls with scale and speed varies with load.
API users see inference as per-token prices, rate limits, latency and output speed. Self-hosting means taking on the hardware, the serving engine and capacity planning, and the cost per token then depends on how busy you keep the hardware.
Worked example
Illustrative: a request with a 2,000-token prompt and a 500-token answer at $3 input and $15 output per 1M tokens costs 2,000 / 1,000,000 x $3 + 500 / 1,000,000 x $15 = $0.006 + $0.0075 = $0.0135. The shorter output is the larger share of the bill.
Common mistakes
- Assuming the model learns from your conversations as you use it; memory across requests exists only if your app or the provider adds it.
- Estimating cost from input tokens alone, when output tokens are usually priced several times higher.
- Planning capacity from average traffic; inference load is bursty, and peaks set the rate limits and hardware you need.
Across the catalog today
Who serves the open-weights models in the catalog
- DeepInfrahosts open-weights models10 models
- Together AIhosts open-weights models9 models
- Amazon Bedrockhosts open-weights models7 models
- Replicatehosts open-weights models5 models
- Azure AI Foundryhosts open-weights models4 models
- fal.aihosts open-weights models4 models
- Fireworks AIhosts open-weights models3 models
- Groqhosts open-weights models2 models
Published prices from each host's own pricing page.
Related terms
- Inference25
Prefill and decode
Reading the prompt, then writing tokens one by one
Explained - Basics01
Token
The unit models read, write and bill by
Explained - Basics06
Latency
How long a request takes to answer
Explained - Inference35
Serving engine
Software that loads weights and serves requests
Explained - Pricing14
Self-hosting cost
What it costs to run open weights yourself
Explained