MLflow Prompt Registry on Databricks: Register, Version, Alias and Load a Prompt
Databricks GenAI Engineer · Deep dive

MLflow Prompt Registry on Databricks: Register, Version, Alias and Load a Prompt

The MLflow Prompt Registry stores prompt templates as Unity Catalog objects with immutable, numbered versions and movable aliases such as production. Code registers a version with mlflow.genai.register_prompt(), points an alias at it with set_prompt_alias(), and loads it with load_prompt() through an alias URI such as prompts:/name@production, so promotion and rollback move a pointer instead of editing a file.

Last updated November 2026.

What this deep dive adds

Chapter 40 of the course teaches the model: versions never change, aliases move, and promotion is never a branch merge or an overwritten file. This post is the working version: names and privileges in Unity Catalog, both template formats, every call from registration to rollback, how an app should load a prompt, and the frameworks that need single braces.

Prompt version control is a Section 4 (Assembling and Deploying Applications) objective in the 18 March 2026 exam guide, and the guide's sample question 7 is about it. How prompt promotion fits a wider release pipeline is Chapter 41 of the course.

Status: the Databricks docs list the Prompt Registry as Beta (pages updated September and October 2026), and it needs mlflow[databricks] 3.1.0 or above.

Names and privileges

On Databricks a prompt is a Unity Catalog object, so its name has three parts, catalog.schema.prompt_name, and access is governed like any other UC object. To view or create prompts you need CREATE FUNCTION, EXECUTE and MANAGE on the schema. Point the session at Databricks first:

import mlflow

mlflow.set_tracking_uri("databricks")
mlflow.set_registry_uri("databricks-uc")

NAME = "main.support.ticket_summary"

An experiment tag, mlflow.promptRegistryLocation set to catalog.schema, records a default location so tools can find the schema without it being repeated everywhere.

Names, privileges and the experiment tag from the Databricks pages "Prompt Registry" and "Create and edit prompts".

Register a prompt and its versions

The first register_prompt() call creates the prompt as version 1. Every later call with the same name adds the next version. Variables use double braces:

v1 = mlflow.genai.register_prompt(
    name=NAME,
    template=(
        "Summarise this ticket for {{audience}} "
        "in {{num_sentences}} sentences: {{ticket}}"
    ),
    commit_message="First version",
    tags={"owner": "support-ai", "task": "summarization"},
)

v2 = mlflow.genai.register_prompt(
    name=NAME,
    template=[
        {"role": "system", "content": "You write support summaries for {{audience}}."},
        {"role": "user", "content": "Summarise in {{num_sentences}} sentences: {{ticket}}"},
    ],
    commit_message="Split into system and user messages",
)

v1.version, v2.version   # (1, 2)

Aliases: promote and roll back

An alias is a named pointer to one version. Point production at the tested version and staging at the candidate:

mlflow.genai.set_prompt_alias(name=NAME, alias="production", version=1)
mlflow.genai.set_prompt_alias(name=NAME, alias="staging", version=2)

Promotion after the candidate passes evaluation is one more pointer move. Saving the old target first under another alias makes rollback a single call too:

# Promote: remember the current production version, then move the alias
current = mlflow.genai.load_prompt(f"prompts:/{NAME}@production")
mlflow.genai.set_prompt_alias(NAME, "production-previous", current.version)
mlflow.genai.set_prompt_alias(NAME, "production", 2)

# Roll back: point production at the saved version
previous = mlflow.genai.load_prompt(f"prompts:/{NAME}@production-previous")
mlflow.genai.set_prompt_alias(NAME, "production", previous.version)
Promotion and rollback move an alias, not a version Three immutable versions, v1, v2 and v3, sit in a row. Before promotion, the production alias points at v2 and staging points at v3. After v3 passes evaluation, production moves to v3 and production-previous keeps v2. To roll back, production moves back to v2. The versions themselves never change. BEFORE: V3 IN STAGING v1 v2 v3 production staging AFTER: V3 PASSED EVALUATION v1 v2 v3 production production-previous Rollback: move production back to v2. No version is edited.
Every environment change is an alias move between versions that never change.

delete_prompt_alias(NAME, "staging") removes a pointer and leaves the versions in place; delete_prompt() removes a version or the whole prompt.

Calls and the promotion pattern from the Databricks page "Use prompts in deployed applications". Every snippet in this post was run against MLflow 3.18 with a local registry (a plain prompt name instead of a Unity Catalog one): versions 1 and 2, promotion to 2, rollback to 1, and the loads shown.

Loading the prompt in an application

Application code loads an alias, never a version number, so a promotion takes effect without a redeploy. Reading the alias from an environment variable lets the same code run against staging in one deployment and production in another:

import os

alias = os.getenv("PROMPT_ALIAS", "production")
prompt = mlflow.genai.load_prompt(f"prompts:/{NAME}@{alias}")

text = prompt.format(
    audience="a store manager",
    num_sentences=2,
    ticket="Printer jams on tray 2 after the firmware update.",
)
URILoads
prompts:/{name}@productionThe version the alias points at now. The form for application code.
prompts:/{name}/2Exactly version 2, for tests and evaluations that must not drift. load_prompt(name, version=2) is the same.

format() fills the variables and returns a string for a simple prompt or a list of messages for a conversation prompt. The MLflow client caches loaded templates, so reading from the registry adds no per-request latency. In MLflow 3.18 an alias load is cached for 60 seconds by default, so a running app picks up a promotion within about a minute; a version load is cached with no expiry, since that version can never change. load_prompt(..., cache_ttl_seconds=0) bypasses the cache.

LangChain, LlamaIndex and other libraries expect single-brace ({variable}) templates. prompt.to_single_brace_format() converts the template, so the registry stays the source of truth while the framework gets the syntax it needs.

What this means for the exam

Exam tip: "promote a prompt with instant rollback and a record of what ran" means register a new version and move the production alias. Any answer that merges a git branch, overwrites a prompt file on a CI runner, or updates a Delta row in place loses the immutable history or the pointer to roll back to.

A second trap is hard-coding a version number in the application, which turns every promotion back into a redeploy.

FAQ

How do I promote a prompt to production in MLflow?

Register the new prompt as a version, evaluate it, then call set_prompt_alias to point the production alias at that version. Applications that load prompts:/name@production pick it up without a code change or redeploy.

Can I edit an existing prompt version in the MLflow Prompt Registry?

No. Prompt versions are immutable once created, so every change is registered as a new version with register_prompt. That immutability is what gives an exact audit trail and lets rollback return to precisely the old text.

What permissions do I need for the Prompt Registry on Databricks?

You need CREATE FUNCTION, EXECUTE and MANAGE on the Unity Catalog schema that holds the prompts. Prompts are Unity Catalog objects named catalog.schema.prompt_name and are governed like other objects in the catalog.

What template syntax does the MLflow Prompt Registry use?

Templates use double braces, such as {{question}}, and format() fills them. For LangChain or LlamaIndex, which expect single braces, to_single_brace_format() converts the loaded template.

Back to the chapter

Prompt version control is Chapter 40 of the Databricks Generative AI Engineer Associate course, in Unit 4, Assembling and Deploying Applications, with exam-style checks on promotion and rollback.

Open Chapter 40 →