AI systemsLLMlanguage modelfoundation modelchat model

Large language model

Definition

A large language model (LLM) is a transformer-based model that, given a prompt of tokens, predicts the next token repeatedly to produce text, code or structured output.

In practice

For system design, an LLM is best treated as a remote dependency that is slow (seconds per answer), billed per token, rate-limited by quotas and non-deterministic. A request first processes the whole prompt (prefill), then generates output tokens one by one (decode), so generation dominates latency and holds capacity far longer than your own code does.

The model is stateless between calls: anything it should know, such as conversation history or private documents, has to be put into the prompt. It can sound confident while being wrong, so its output needs validation, grounding or human review where errors matter. Pin model versions, because providers update models and behaviour can shift without any code change.

Example

A support assistant sends a 3,000-token prompt to a hosted model and streams back a 400-token answer: the first token arrives after 600 ms and the full answer after 6 seconds.