Take your prompt to production
Compare a change, publish a version, retrieve it, and roll back.
Continue from the ticket-routing baseline. Version 1 is your initial production version. This walkthrough adds a more precise routing rule and compares a saved candidate before moving production.
Make a focused change
Add this dataset case with reference account:
I cannot sign in to download my invoice.The ticket mentions billing, but sign-in access is the immediate blocker. Add this instruction to your personal draft:
When a ticket includes multiple issues, route by the immediate blocker.
If the customer cannot sign in, choose account even if they mention an invoice.Keep the model and temperature fixed so you can interpret the effect of the instruction. Save the draft as a new version. Saving creates a snapshot; production still points to version 1.
Compare the candidate
Start an evaluation of the new saved version against production. For this six-case dataset, a Quick run includes every case. For a larger dataset, choose coverage deliberately.
The comparison pins the production version when it starts. PromptLens can reuse a compatible completed production run; after changing the dataset, expect to need a baseline that covers the new inputs. Inspect the ambiguous ticket and the original five cases. A new rule is useful only if it improves the intended case without introducing unacceptable regressions.
The examples in this guide describe what to inspect, not guaranteed model scores. Record the outputs you actually receive.
Screenshot placeholder — Candidate versus production Show both version numbers, coverage, and the ambiguous invoice/sign-in case with each side's output and score.
Publish the chosen version
Open the saved version's label controls and assign staging for a test integration. When ready, assign production. Inspect any coverage warning before confirming. You may see a warning for a version without an evaluation, an evaluation on an older dataset, or Quick-only coverage.
Publication is your decision; a saved version or a higher aggregate score alone does not move the production label. See labels and rollback for concurrency and warning behavior.
Retrieve it in an application
Have an administrator create a prompt-scoped retrieval key. Copy the prompt ID from the dashboard and use https://www.promptlens.io/api/v1/prompts/{promptId} for retrieval. Fetching with no selector resolves production; ?label=staging resolves staging, and ?version=1 pins version 1.
Follow the complete TypeScript or Python example to retrieve the configuration and call a model. Keep retrieval keys and provider keys in your server environment.
Roll back when needed
Assign production back to version 1. The next server retrieval resolves the restored version; an application that caches configuration must revalidate to observe label changes. A rollback changes the label, so it does not erase the candidate, its evaluation, or your draft. Reproduce the regression as a dataset case before preparing another candidate.