Version Control & Labels
Version control and labels are the mechanism that makes prompt management practical at scale. Versions give you an immutable history of every change; labels give you a stable name your code can reference while the underlying version changes.
How Labels Work
Your application fetches a prompt by label:
# Always fetches whichever version "production" points toprompt = xeroml.get_prompt("my-prompt", label="production")When you want to deploy a new prompt version, you update the production label to point to the new version number. Your running instances pick up the change on their next cache refresh — no code change, no redeployment.
Built-in Labels
| Label | Behavior |
|---|---|
production | The default label. Points to whatever version you designate as production. |
latest | Automatically updated to the newest version on every save. Useful for development. |
Custom Labels
Create custom labels for staging environments, A/B experiments, or team-specific workflows:
# Create a version and point a staging label at itxeroml.create_prompt( name="my-prompt", prompt="Updated prompt text...", labels=["staging"] # Doesn't touch production)This lets you:
- Test in staging while keeping production stable
- Run A/B experiments by routing traffic to different labels
- Give different teams access to different versions
Deployment Workflow
A typical prompt release cycle:
- Draft — edit the prompt and save (creates a new version, labeled
latest) - Test — use the Playground or staging label to validate the change
- Deploy — update the
productionlabel to the new version number in the UI or via API - Monitor — watch evaluation scores and usage metrics in the dashboard
- Rollback if needed — point
productionback to the previous version number
The entire cycle happens without touching application code.
Rollbacks
To roll back, go to the Prompt detail page, select the previous version, and click Set as Production. The label update is instantaneous. Running instances see the rollback within their cache TTL (default 5 minutes, or immediately on next fetch if cache is cleared).
Via the API
You can also manage labels programmatically:
# Point "production" at version 5xeroml.set_prompt_label( name="my-prompt", version=5, label="production")# Via cURLcurl -X PATCH https://cloud.xeroml.com/api/public/v2/prompts/my-prompt \ -u "pk-xm-...:sk-xm-..." \ -H "Content-Type: application/json" \ -d '{"label": "production", "version": 5}'