Prompt Templates and Versioning
In this article
- Split a prompt built inside application code into a template with named variables and the values each request supplies.
- Name the minimum record that rebuilds the request behind any reply, with every movable label resolved to the fixed version it pointed to.
- Explain what a rebuilt request proves about a reply, and why its new reply can still differ.
- Say what must be saved and rerun before a new prompt version goes live.
- Terms defined here: prompt template, prompt version, regression gate.
Overview
A support lead points at a reply from seven months ago and asks why the model chose that category. The instruction text in the code has been edited a dozen times since, and the name the code uses for the model now reaches a newer release. Nobody can say what was sent that day, so nobody can answer.
The company and every name and number below are invented. Brightline, a home-internet provider, runs a ticket sorter: a model puts each support ticket in one of four categories, billing, technical, account or other, and says whether a person must see it now. Its routing code, the part of the application that reads the reply, acts on it. The reply has the shape from JSON Schemas for Model Output, {"category": ..., "escalation": ...}, where escalation is {"escalate": true, "reason": ...} for a yes with a reason or {"escalate": false} for a no.
The map: a reply can be explained only from the full request behind it, so the fixed text of the prompt, the exact model release, the settings and the schema are saved once under a name that never changes, each ticket's own text goes into a stored record of that request, and any name that moves to newer releases is written down as what it pointed to at the time.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- A prompt kept in a string
- Templates and variables
- Versions and movable labels
- What the version stores
- The trace and the rebuild
- Worked example
- Before a new version goes live
- Common mistakes
- Sources
- Check yourself, 5 questions