A prompt edit is a production deploy: it changes system behavior for every user, instantly, and most teams ship it with less ceremony than a CSS change.
Tier: Advanced · Workflow area: Serving & LLMOps
This playbook builds the release pipeline DevOps-for-GenAI postings describe: prompts and model choices in a registry with versions, CI evals as the merge gate, staged canary rollout via gateway weights, and automatic rollback on eval regression.
For an internal notebook prompt only you use, a git-committed text file is version management enough.
Register prompts; stop inlining them. Move each production prompt into the MLflow prompt registry (mlflow.genai.register_prompt(...)); the app loads by alias (prompts:/support-answer@production) at startup or per-request-cached. Model choice + generation params live alongside as versioned config. From here on, "edit the prompt" means "register a new version," never "edit the string in code."
Gate new versions in CI. A prompt PR (template change in the repo that registers on merge) triggers the eval harness against the new version: golden-set scores must meet absolute thresholds and not regress vs the current production version by more than your margin. Fail the check, block the merge — identical discipline to a failing unit test.
Canary by alias + traffic weight. Promotion is moving the candidate alias, then splitting traffic at the gateway: 5% → 25% → 100%, each stage held long enough to collect N sampled online scores (from your pb-49 pipeline) at the stage's traffic share. Tag each request/trace with the prompt version so scores are attributable per version — without that tag, canary analysis is impossible.
Define the automatic rollback rule numerically. Example: "if candidate's sampled faithfulness mean over ≥50 scored requests is >3 points below production's trailing mean, or error rate doubles, set weight to 0 and re-point candidate at the prior version." Implement as a small scheduled checker that reads scores and calls the gateway API — automation matters because prompt regressions surface at 2 a.m. exactly as often as code regressions.
Drill both paths. Ship a genuinely better prompt version through the full pipeline; then ship a deliberately degraded one (remove a key instruction) and watch CI catch it — and, if you force it past CI, watch the canary checker roll it back. Save the evidence of both.
Extend the same pipeline to model swaps. A model upgrade (provider bump, or hosted → self-hosted pb-46 endpoint) rides the identical path: register config version → CI evals → canary → rollback rule. This is where the pipeline pays for itself, because model swaps are bigger behavioral changes than prompt edits.
Alias + weight is the whole trick: applications reference stable aliases, releases move aliases and weights, and rollback is a metadata operation that takes seconds — no deploy, no code change, no waiting on CI.
MLflow registry, CI runner, gateway, and observability all self-host — the full release pipeline runs air-gapped, with judge calls on a local model. For client work, map the canary stages onto the client's change-management gates (their CAB approves the 5%→100% promotion); the pipeline generates exactly the evidence such boards ask for.
Keep prompt versions immutable and never delete rolled-back ones — the failed version plus its scores is your regression test corpus for the next edit.