Prompting

Prompt Template

Also known as: parameterised prompt

A reusable prompt with blanks to fill in, so the same reliable instruction can be applied to many different inputs.

Choose your level

A prompt template is a fill-in-the-blank prompt. Instead of writing a fresh instruction every time, you create one good prompt with gaps, "Summarise this email for {audience}: {email}", and reuse it by slotting in the details. It is how apps apply a proven instruction consistently to thousands of different inputs, like a form letter for AI.

A prompt template is a reusable prompt with placeholders (variables) that get filled in at runtime. It separates the fixed, well-crafted instruction from the changing input.

Why it is useful

  • Consistency: the same tested prompt is applied every time, so results are reliable.
  • Scale: one template serves countless inputs (each user request fills the blanks).
  • Maintainability: improve the prompt in one place; every use benefits.

Templates are the backbone of AI applications (as opposed to one-off chatting), and they pair naturally with structured output and orchestration.

A prompt template parameterises a prompt with typed slots filled at runtime, decoupling the engineered instruction from variable inputs and enabling versioning, testing and reuse across an application. It is foundational to productionised LLM systems: templates are composed within orchestration (system + template + retrieved context + few-shot exemplars) and evaluated as artefacts.

Engineering concerns include input sanitisation (untrusted values in templates are a prompt-injection surface), delimiting and escaping variable content, token-budget management, and template versioning tied to model versions (prompts can be model-specific). Mature practice treats templates like code, source-controlled, unit/eval-tested against datasets, monitored for regressions, and often managed via prompt-management tooling, and pairs them with structured-output contracts. As instruction-following improves, robust templating and context engineering matter more than clever one-off phrasing.

← Back to the glossary

What are you looking for?