What is inference? Meaning, examples and AI inference
The everyday meaning of inference, how it works inside an AI model, what each answer costs, and the providers that run open models for you.
An inference is a conclusion you reach from evidence and reasoning rather than from something stated outright. In AI, inference is the moment a trained model is put to work: it takes a new input, such as your question, and produces an output, such as an answer, a label or an image.
The word lives in two worlds. Teachers use it for reading between the lines, logicians for deduction and induction, statisticians for drawing conclusions about a population from a sample. In tech, it now mostly means running a model, and that is where the money goes: every chatbot reply is an inference, billed per token. This page explains both senses without jargon, shows how a model turns a prompt into tokens, separates inference from training, then compares six providers that sell inference on open models, with what they publish about price.
Some links to tools may be affiliate links. The definition and our take on each tool stay the same either way.
What inference means: reaching a conclusion from evidence
You hear bangs outside on the evening of a holiday and think: fireworks. You didn't see them, but the sound, the date and what you know about holidays point there. That step, from clues to a conclusion nobody spelled out, is an inference. The dictionary puts it the same way: a conclusion or opinion formed because of known facts or evidence, and also the act of reaching it.
Logic splits inferences into three families, and the split is useful far beyond philosophy class:
- Deduction goes from premises taken as true to a conclusion that must follow. All humans are mortal; all Greeks are humans; so all Greeks are mortal. If the premises hold, the conclusion can't be wrong.
- Induction goes from particular cases to a general rule. Every swan you have seen is white, so you conclude swans are white. Useful, and open to the one black swan.
- Abduction looks for the best explanation of what you see. The lawn is wet, the sky is grey: it probably rained. It aims at likelihood, not certainty.
In reading, an inference is what you understand without being told: a candle and a quill on a desk suggest someone writing by candlelight, perhaps someone wealthy. In statistics, inference means moving from sample data to statements about a whole population, with a margin of error attached. In law, it is a conclusion a court draws from facts already proven.
Two words get mixed up with it. An observation is what you perceive directly (the bang); the inference is what you conclude (fireworks). An implication is what a speaker suggests; the inference is what the listener draws. The writer implies, the reader infers.
AI borrowed the word from this tradition. Early AI systems were built to automate logical inference with rules, in programs called inference engines. Today the same word is applied to neural networks: when a trained model produces a prediction from new data, it is said to run inference.
How AI inference works: from a prompt to tokens
A model has two lives. During training, it reads huge amounts of data and adjusts its internal parameters until its outputs get good. During inference, those parameters are frozen and the model applies what it learned to inputs it has never seen. Training aims for accuracy; inference aims to deliver the trained model as efficiently and cheaply as possible. Technically, inference only runs the network forward, with no parameter updates: one forward pass for a classifier, one per generated token for an LLM.
For a large language model (LLM), the work is counted in tokens, the small pieces of text a model reads and writes: a short word is often one token, a long word several. An answer is produced in two phases:
- Prefill. The model reads your whole prompt at once (instructions, documents, chat history) and builds its internal state. A long prompt makes this phase slower and, on a bill, adds input tokens.
- Decode. The model then writes the answer one token at a time, each new token depending on the ones before. This is why answers appear word by word, and why output tokens are priced higher than input tokens.
Three numbers describe how fast inference feels. Time to first token is the wait before anything appears, the one users notice in a chat. Time per output token, or its mirror tokens per second, is how fast the answer then flows. Throughput is how many requests a system serves at once, the number that sets the cost per answer for the provider. For the wider topic of delay, see what latency is and how to cut it.
Inference runs in two main modes. Online inference handles each request as it arrives, for chatbots, voice agents or fraud checks that must answer now. Batch inference groups many inputs and runs them on a schedule, for tagging a catalog or summarizing last month's tickets overnight; it is cheaper because the hardware stays busy. Micro-batching sits between the two: requests are grouped for a few milliseconds to a few seconds, which raises throughput while keeping answers fast.
Where it runs changes the trade-offs. In the cloud, on GPUs or specialized chips rented by the hour or by the token. On the edge, on hardware close to the data source, such as a server in a store or a factory. On device, on your phone or laptop, using its neural processing unit: the most private option, limited by the device's compute. GPUs remain the standard hardware. A TPU (tensor processing unit) or an NPU (neural processing unit) is a chip designed specifically for neural network math; NPUs use less power than GPUs for narrower tasks. Some providers go further and build their own inference chips (application-specific chips, or ASICs), such as Groq's LPU, to push more tokens per second.
One recent shift: reasoning models think before they answer by generating extra tokens you don't always see. Spending more compute at inference time to get a better answer is called test-time scaling. It makes answers smarter, and it makes the inference bill depend on how long the model thinks, not only on how long the visible answer is.
A worked example: what inference costs for a support chatbot
Inference prices are quoted in dollars per million tokens, with a separate price for input (what you send) and output (what the model writes); our LLM API pricing index tracks them model by model. Take a support chatbot that handles 10,000 conversations a month. Each conversation sends about 2,000 input tokens (a system prompt, the help-center extract, the question) and gets about 500 output tokens back. That is 20 million input tokens and 5 million output tokens a month.
Now run it on the same open model, DeepSeek V4.1 Flash, at public list prices:
- Standard serverless at $0.30 per million input tokens and $1.20 per million output tokens: $6 + $6 = $12 a month. Together AI and Fireworks AI list exactly these two prices for this model.
- With prompt caching. If 1,500 of the 2,000 input tokens are the same system prompt every time, they bill as cached input at $0.006 per million: 15 million cached tokens cost $0.09, the 5 million fresh ones $1.50, the output still $6. Total: about $7.59, 37% less, for the same answers.
- On the Fast tier at Together AI, $0.60 input and $2.40 output: $24 a month, double, for quicker replies.
- As a batch job at Fireworks AI, 50% off input and output: $6 a month, if the answers can wait.
Two lessons hide in these numbers. First, output dominates: here a fifth of the tokens make half of the standard bill, because output is priced four times higher. Asking for shorter answers saves more than trimming the prompt. Second, the model is the same everywhere, but the mode of inference (standard, cached, fast, batch) moves the bill by a factor of four.
The other way to pay is by the hour, for a dedicated GPU that runs only your model. An NVIDIA H100 lists at $5.49 an hour at Together AI and at Replicate, $8.00 an hour at Fireworks AI, and $2.90 an hour at DeepInfra, billed by the minute. Left on all month (730 hours), that is about $4,008, $5,840 or $2,117, whether it serves one request or a million: the same GPU varies by a factor of almost three from one provider to the next. Dedicated capacity only pays off at steady, high volume, or when you need a fine-tuned model that serverless menus don't carry; our dedicated GPU server comparison covers that route.
What to ask a provider before you commit: the input, cached and output prices for your exact model; whether a faster or region-pinned tier costs extra; the batch discount; the rate limits of the entry plan; and the precision the model is served at (full precision, fp8 or fp4), since a cheaper endpoint can be a compressed one. For a side-by-side of model APIs, see the best LLM APIs.
Online or batch inference: which fits which job
Online inference fits…
- Chatbots and AI assistants that answer while the user waits
- Voice agents, where a pause on the line feels like a dropped call
- Fraud and risk scoring at the moment of payment
- Coding assistants that complete code as you type
- Product recommendations computed when the page loads
Batch inference fits…
- Tagging or translating a whole product catalog
- Summarizing last month's support tickets overnight
- Scoring a CRM list of leads once a week
- Generating embeddings for a document archive
- Evaluating a new model on thousands of test prompts
Inference vs training and fine-tuning: what changes
Training builds the model, fine-tuning adapts it, inference uses it. Training happens once per model version; inference happens on every single request.
| Inference | Training and fine-tuning | |
|---|---|---|
| What happens | A frozen model answers new inputs with forward passes only | Training: the model learns its parameters from data Fine-tuning: an existing model is adjusted on a smaller, targeted dataset |
| Goal | Fast, cheap, reliable answers | Training: accuracy Fine-tuning: better results on one task or style |
| How often | Every request, all day | Training: once per model version Fine-tuning: occasionally, per use case |
| How it's billed | Per token, per second of GPU, or per hour of a dedicated GPU | Training: GPU clusters for days or weeks Fine-tuning: per job or per token of training data |
| Who pays for it | Anyone who uses or ships an AI feature | Training: model labs Fine-tuning: teams with a specific need |
| Key metrics | Time to first token, tokens per second, cost per answer | Loss and benchmark scores |
Serving is the infrastructure that exposes a model to applications; inference is the computation it runs on each request.
The best inference providers to run open models
If you use an AI model through an API, you are buying inference. For closed models (GPT, Claude, Gemini), you buy from the maker or one of its cloud partners, at prices they set. For open models, several providers host the same weights and compete on price and speed, which is where the choice matters. We compared six of them on what they publish: price per token, pricing modes, dedicated GPUs and limits. The quick route: you want a broad menu of models, Together AI; you mix live and batch traffic, Fireworks AI; you want a low list price on a popular model, DeepInfra; you need speed above all, Groq; you live on the Hugging Face Hub, Hugging Face; you want one key for everything, OpenRouter. Cerebras, which also builds its own chips and lists gpt-oss-120b at about 3,000 tokens per second, and Replicate, which bills most models by the second of GPU time, are worth a look too. For the full ranking with scores, see the best AI inference providers; to rent raw GPUs instead, the best GPU clouds.
The tools
Together AI: a broad menu of open models and several pricing tiers
Large catalogTogether AI runs open models (DeepSeek, Kimi, Qwen, GLM and many more) behind one API, billed per million tokens, and also rents dedicated GPUs for your own models.
Who it's for. Teams that want to try several open models side by side and keep the option of a dedicated endpoint or a fine-tune later, at the same provider.
The limit. The menu has layers that change the bill: a Fast tier at double the price ($0.60 and $2.40 per million tokens on DeepSeek V4.1 Flash, against $0.30 and $1.20), and US geo-pinned endpoints at 25% more ($0.375 input on the same model). Read the column you are actually calling.
The tip. Cached input is where the savings are: $0.006 per million on DeepSeek V4.1 Flash, fifty times less than fresh input. Keep your system prompt identical from one call to the next so it stays in cache.
- Price
- Pay per token, e.g. $0.30 in / $1.20 out per 1M tokens (DeepSeek V4.1 Flash); H100 at $5.49/hour
- Best for
- Comparing open models, then scaling up
- Limit
- Fast and geo-pinned tiers cost more
Fireworks AI: five pricing modes for the same model
Flexible billingFireworks AI serves open models serverless, per million tokens, with five modes you switch per request on the same endpoint: Standard, Priority, Fast, Batch and Spot. It also rents dedicated GPUs on demand, billed by the GPU-second.
Who it's for. Products with mixed traffic: live requests that must answer now and background jobs that can wait, on one account.
The limit. Priority, which puts your traffic first at peak load, costs 20% to 50% more depending on the model (GLM 5.3 at $1.75 input and $5.50 output, against $1.40 and $4.40 on Standard; Kimi K3.1 Pro at $3.00 input against $2.00). Spot, at 50% off, is only available on GLM 5.3 for now and runs on best-effort capacity whose throughput can drop to zero: you need a retry or a fallback.
The tip. Batch mode takes 50% off input and output, and cached input bills at half price or less, with no write fee. Send anything that doesn't need an answer within seconds to Batch. And watch the region: a region-restricted dedicated deployment is priced at 1.5 times the standard GPU rate.
- Price
- From $0.05 per 1M input tokens; gpt-oss-120b at $0.15 in / $0.60 out; H100 at $8.00/hour
- Best for
- Mixing live and batch workloads
- Limit
- Spot only on GLM 5.3, and it can stall
DeepInfra: low list prices on popular open models
Low list pricesDeepInfra hosts open models behind an OpenAI-compatible API, priced per million tokens, with a lower rate for cached input, and dedicated GPUs for your own models.
Who it's for. Cost-sensitive apps that run one popular open model at volume and care about price per token more than about extra features.
The limit. Its prices move: some models carry temporary discounts on the pricing page (51% off DeepSeek V4.1 Flash 1017, at $0.098 input instead of $0.20). Budget on the list price, not the promotion.
The tip. Even at list price, DeepSeek V4.1 Flash costs $0.20 input and $0.60 output here, against $0.30 and $1.20 at Together AI and Fireworks AI. On our chatbot example, that is $7 a month instead of $12, before any discount.
- Price
- Pay per token, e.g. $0.20 in / $0.60 out per 1M tokens (DeepSeek V4.1 Flash, list price); H100 at $2.90/hour
- Best for
- Running one open model cheaply
- Limit
- Promotional prices change
Groq: inference on its own chips, built for speed
Built for speedGroq runs open models on its own inference chip, the LPU, which it now also pairs with NVIDIA GPUs, through GroqCloud, an API billed per million tokens. Its model list publishes the speed of each model.
Who it's for. Voice agents, live assistants and any product where tokens per second decide the experience.
The limit. The catalog is short: a handful of production models, and some of them are priced through sales rather than on the page (Llama 3.3 70B, for one).
The tip. On gpt-oss-120b, Groq lists $0.15 input and $0.60 output, the same as Fireworks AI's Standard price, at about 500 tokens per second. When the price is equal, the speed is free. If you build in n8n, here is how to plug the Groq chat model into n8n.
- Price
- Pay per token, e.g. $0.15 in / $0.60 out per 1M tokens (gpt-oss-120b)
- Best for
- Real-time and voice apps
- Limit
- Short model list
Hugging Face: one account for hosted providers and dedicated endpoints
Best for open-source teamsHugging Face gives two ways to run inference. Inference Providers routes your request to partner providers at their own rates. Inference Endpoints deploys any model from the Hub on a dedicated machine billed by the hour.
Who it's for. Teams already working on the Hugging Face Hub, who want to test a model through a partner then move it to a dedicated endpoint without changing platform. Our Hugging Face review covers the rest of the platform.
The limit. Free accounts get no monthly inference credits: you buy credits to call Inference Providers. PRO ($9 a month) includes $2 of compute credits a month, enough to experiment, not to run production.
The tip. Hugging Face charges the provider's rate with no markup, so routing through it costs the same as going direct, with one bill for several providers. Dedicated endpoints start at $0.033 an hour on the smallest CPU machine.
- Price
- Providers at the provider's rate, no markup; endpoints from $0.033/hour; PRO $9/month
- Best for
- Hub users moving from test to dedicated
- Limit
- No free inference credits on free accounts
OpenRouter: one API key for hundreds of models and providers
Best routerOpenRouter is not a host but a router: one API that sends each request to a provider serving the model you asked for, open or closed, and falls back to another provider if the first one fails.
Who it's for. Developers who want to switch models without rewriting code, compare providers, and keep one bill. If it doesn't fit, see the OpenRouter alternatives.
The limit. The fee sits on credits: 5.5% on each credit purchase on the Standard plan, 8% on Business. Inference itself is billed at the provider's list price, and an attempt that errors is not charged for its model tokens.
The tip. The same model can be served at different precisions by different providers. If quality matters, pin the provider or the quantization in your request instead of letting the router pick. Free models are capped at 50 requests a day, raised to 1,000 once you have bought $10 of credits.
- Price
- Provider list price plus a 5.5% fee on credit purchases (Standard)
- Best for
- Switching models through one API
- Limit
- Fee on credits; provider varies by default
Is your tool missing from this page? Email us: hello@hackceleration.com
Inference FAQ
What is the difference between generative AI and AI inference?
They answer different questions: generative AI is a kind of model, one that produces new text, images or code, while inference is the act of running any trained model. Every reply from a chatbot or every image from an image model is a generative model running inference, but a fraud score or a spam filter is inference too, with nothing generated. The billing follows the output: text models bill per token, while image models often bill per image, such as GPT Image 2, from $0.053 per image at Together AI at the lowest resolution. More on the first notion in what generative AI is.
Is an inference the same as an assumption?
No. An inference rests on evidence you can point to; an assumption is something you take as true without checking it. One dictionary definition calls an inference a conclusion drawn from two or more available facts. If you can't name the facts behind a conclusion, it is closer to an assumption, and worth testing before you act on it.
How do you make an inference when reading?
Put a clue from the text together with what you already know, then ask which conclusion makes the most sense. A character who checks the clock, grabs a coat and leaves a coffee half drunk is late, even if the text never says so. Then reread: a good inference is one the rest of the passage supports, not one it contradicts.
What is the difference between inference and prediction?
In AI, they are often the same act: running inference is what produces a prediction. In statistics, the words split: prediction asks what the next value will be, inference asks why, which variables matter and how sure you can be. A model that forecasts sales is used for prediction; a study that asks whether price changes drive those sales is doing inference.
Can you run AI inference on your own computer?
Yes, for smaller open models. A laptop with enough memory can run models with a few billion parameters locally, which keeps your data on the machine and costs nothing per token. The catch is the hardware: large models need far more memory than a laptop has, and phones keep on-device inference to specific tasks. To wire a local model into your workflows, see how to use an Ollama chat model in n8n.
Why can the same open model give different answers at two providers?
Because providers can serve it at different precisions and with different settings. In a 2025 benchmark of gpt-oss-120b across hosts, six providers scored 93.3% on the same math test while one heavily compressed version scored 36.7%, and another first scored 80% because of an outdated serving setup. Developers who route through aggregators report the same thing and pin their providers. Rerun a few of your own prompts before you switch, using the method in our guide on how to evaluate an LLM.
