Skip to content

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 to
prompt = 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

LabelBehavior
productionThe default label. Points to whatever version you designate as production.
latestAutomatically 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 it
xeroml.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:

  1. Draft — edit the prompt and save (creates a new version, labeled latest)
  2. Test — use the Playground or staging label to validate the change
  3. Deploy — update the production label to the new version number in the UI or via API
  4. Monitor — watch evaluation scores and usage metrics in the dashboard
  5. Rollback if needed — point production back 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 5
xeroml.set_prompt_label(
name="my-prompt",
version=5,
label="production"
)
Terminal window
# Via cURL
curl -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}'