> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Save and version prompts

> Save versioned prompts from the Playground to Prompt Hub for easy tracking and comparison.

Every save creates a new version in **Prompt Hub**. Browse the history, roll back if something regresses, or tag a version as **Production** so your application always pulls the latest approved prompt without a code deploy.

<Frame caption="Prompt Hub: prompts list, versions, and labels">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/prompt-hub.gif" alt="Prompt Hub in Arize AX showing prompts list and version management" />
</Frame>

## Why save and version prompts?

Saving and versioning is how Prompt Hub turns prompt management from scattered snippets into a disciplined workflow — each **Save Prompt** writes the next immutable version your team can diff, tag, and resolve by label at inference time.

For the conceptual model (immutable versions, mutable tags, rollback, deploy-without-redeploy), see [Versioning and tags](/ax/concepts/prompts/versioning-and-tags). For the Hub's role across the platform, see [The Prompt Hub](/ax/concepts/prompts/prompt-hub).

## Workflow

<Tabs>
  <Tab title="By Skills">
    <Callout icon="clock" color="#3b82f6">
      Coming soon!
    </Callout>
  </Tab>

  <Tab title="By Alyx">
    In the **Prompt Playground**, you can ask **Alyx** to persist the prompt you have been editing - for example:

    > Save this prompt to Prompt Hub as `support-agent-v2` with a description that we tightened escalation rules.

    Alyx can help you refine messages, parameters, and tools first; when you are ready, ask it to **save** (or click **Save Prompt** yourself) so a new **immutable version** is written to [Prompt Hub](/ax/improve/save-and-version-prompts) with the name, description, and tags you want. You can still open **Prompt Hub** afterward to compare versions, add notes, or tag **Production**.

    <Frame>
      <video src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/evaluate/savepromptalyx.mp4" width="100%" height="100%" style={{ display: "block", objectFit: "contain" }} controls autoPlay muted loop aria-label="Screen recording of saving a prompt to Prompt Hub with Alyx in the Playground" />
    </Frame>
  </Tab>

  <Tab title="By UI">
    <Steps>
      <Step title="Save from the Playground">
        Any time you click **Save Prompt** in the Playground, the current state (messages, parameters, tools, and response format) is saved as a new version in **Prompt Hub**. Give it a name, description, and optional tags to make it findable later.

        From the **Prompt Playground**, you can also use the [Playground Agent](/ax/alyx/using/playground-agent) to refine wording or structure before you save—then use **Save Prompt** to persist a new version.
      </Step>

      <Step title="Browse and compare versions">
        Every refinement creates an **immutable**, hashed version. With version control, you can:

        * **Compare and revert easily.** If a new edit performs worse, roll back to a previous version instantly.
        * **Collaborate safely.** Multiple team members can test variations of the same prompt without overwriting each other's work.
        * **Maintain traceability.** Each version can include notes describing what changed and why, helpful for debugging and auditing.
        * **Measure improvements.** Track performance across prompt iterations to identify which modifications lead to better model responses.

        View all versions of a prompt in **Prompt Hub** by clicking the prompt name and browsing the version history. You can tag specific versions (for example, `prod-v1.2`) for deployment without ambiguity.

        <Frame caption="Browse version history and compare prompt versions">
          <video src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/version-prompt.mp4" width="100%" height="100%" style={{ display: "block", objectFit: "contain" }} controls muted loop />
        </Frame>

        For a deeper walkthrough, see [Save and version prompts](/ax/improve/save-and-version-prompts#workflow).
      </Step>

      <Step title="Tag Production for deployment">
        Tag the winning version as **Production** in **Prompt Hub**. The **Prompt Hub SDK** automatically pulls the production-tagged version at run time. This enables a human-in-the-loop workflow: you review, approve, and tag before anything goes live. Your application continuously uses the strongest prompt without code changes.
      </Step>
    </Steps>
  </Tab>

  <Tab title="By Code">
    | Step                 | Python                                                                                              | TypeScript                                                                                              | CLI                                                                               |
    | -------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
    | List versions        | [List versions](/api-clients/python/version-8/client-resources/prompts#list-versions)               | [List versions](/api-clients/typescript/version-1/client-resources/prompts#list-versions)               | [`ax prompts list-versions`](/api-clients/cli/prompts#ax-prompts-list-versions)   |
    | Create a new version | [Create a new version](/api-clients/python/version-8/client-resources/prompts#create-a-new-version) | [Create a new version](/api-clients/typescript/version-1/client-resources/prompts#create-a-new-version) | [`ax prompts create-version`](/api-clients/cli/prompts#ax-prompts-create-version) |
  </Tab>
</Tabs>

## Next up

To save and reopen whole Playground setups (not prompts), use [**Playground views**](/ax/improve/saving-and-managing-playground-views).
