LLM Learning Hub

workspace/llm-course/home

Inference

Inference is running a trained model on new inputs to produce predictions, without updating weights. It is the deployment phase of the ML lifecycle.

What is Inference?

Inference is running a trained model on new inputs to produce predictions, without updating weights. It is the deployment phase of the ML lifecycle.

Inference is running a trained model on new inputs to produce predictions, without updating weights. It is the deployment phase of the ML lifecycle.

Where is it used?

ChatGPT serving, Claude API calls, and local Llama inference all run forward passes only; techniques like KV-cache, quantization, and batching optimize inference throughput.

How to build it

Load a trained model with `model.eval()`, wrap inference in `torch.no_grad()`, pass a single input tensor, and decode the output — measure latency with `time.perf_counter()`.