Context
Prompt versioning & templates
Prompts are code: version them, review them, test them, roll them out gradually.
What it is and why it exists
A prompt change can regress quality as badly as a code change. Templates with variables, a registry with versions, evals in CI and staged rollouts make prompt changes boring.
Quick prototype
Prompt string in the code.
In production, at scale
Prompts in source control or a registry, referenced by version, logged with every call, evaluated before release, rolled out behind feature flags with online metrics compared per version.
Vendors and tools
| Langfuse / LangSmith / Braintrust / PromptLayer | Prompt registries with versioning |
|---|---|
| promptfoo | Prompt tests in CI |
On AWS: Bedrock Prompt Management with versions and aliases.
How it fails
- Hot-editing a prompt in production with no record of what changed
- No way to tell which prompt version produced a bad answer
What the interviewer asks next
What do you log with every LLM call?
Prompt version, model and version, parameters, input and output (redacted as needed), token counts, latency, cost and the trace ID.