What it is
Inference is everything that happens after training: a prompt goes in, the model produces an answer. Nothing is learned; the weights stay fixed. Every test chat, every evaluation answer, every judge verdict and every reply in production is inference.
How it works
A model generates text one token at a time. First it reads the whole prompt in one pass (called prefill), which is fast because all the tokens can be processed in parallel. Then it decodes: predicts the next token, appends it, and repeats until it produces an end token or reaches a length limit. Each new token needs another pass through the model, which is why long answers take longer than long questions.
- Time to first token is mostly prefill: longer prompts, longer wait before anything appears.
- Tokens per second is decode speed: it sets how fast the answer streams.
- Sampling settings such as temperature decide how the next token is picked from the model's probabilities. Low values make answers more predictable; high values more varied.
- Batching: a server answers many requests at once to keep the GPU busy. Serving systems such as vLLM manage memory so well that they raised throughput 2–4× over earlier systems at the same latency.
Deployment
Training produces a set of weights stored at the provider. To answer, those weights must be deployed: loaded into the memory of one or more GPUs, behind an endpoint that accepts requests. The memory needed is roughly the number of parameters times the bytes used per parameter:
memory for weights ≈ parameters × bytes per parameter
7B model × 2 bytes (16-bit) ≈ 14 GB
70B model × 2 bytes (16-bit) ≈ 140 GB → several GPUsAllocating that hardware, downloading the weights and loading them into GPU memory is the cold start. For managed models it is usually quick or invisible; for open models on dedicated GPUs it often takes 10 to 40 minutes. Once loaded, the deployment stays warm and answers in seconds — for as long as it exists.
- 01Choose durationhourly cost shown up front
- 02Deployingload weights · cold start
- 03Livechat · the meter runs
- 04Deletingbilling stops
- A supervised run on an 8-billion-parameter open model has finished. In 16-bit precision its weights take about 16 GB, so it needs a GPU with more memory than that, plus room for the requests being processed.
- You start a test chat for two hours. The hourly price is shown before anything is created.
- Deploying: the GPU is allocated and the weights load. This takes about 15 minutes; billing for the deployment has started.
- Live: each question is answered in a second or two. You try ten real questions from last week.
- You finish early and end the session. Deleting removes the deployment and billing stops. Cost: the time the deployment existed × the hourly price, however few questions you asked.
Common mistakes
- Leaving a dedicated deployment running overnight “in case” — it bills by the hour, used or not.
- Judging a model on its first answer after a cold start, or on response time while it is still loading.
- Testing with different sampling settings or a different system prompt from the ones used in evaluation.
- Expecting a fine-tuned model to know things that happened after training: inference doesn't learn.
References and further reading
External sources open in a new tab.
- 01Efficient Memory Management for Large Language Model Serving with PagedAttentionKwon et al., 2023 · arXiv · arxiv.orgThe vLLM paper: how serving systems batch requests and manage GPU memory.
- 02Text Generation InferenceHugging Face docs · huggingface.coA production serving stack for open models, with its features explained.
- 03Inference EndpointsHugging Face docs · huggingface.coWhat deploying a model behind a managed endpoint involves.
- 04Cold start (computing)Wikipedia · en.wikipedia.orgThe general idea of a cold start.