> ## 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.

# Prompt playground

> Build a prompt in the Prompt Playground, run it across a dataset as an experiment, compare variants and models, then save the winner to Prompt Hub.

export const AskAlyx = ({children}) => {
  const gradientId = `askAlyxGradient-${Math.random().toString(36).slice(2)}`;
  return <div style={{
    display: "flex",
    alignItems: "flex-start",
    gap: "0.625rem",
    margin: "1rem 0",
    padding: "0.75rem 1rem",
    borderRadius: "10px",
    border: "1px solid rgba(120, 115, 245, 0.25)",
    background: "linear-gradient(135deg, rgba(255, 110, 196, 0.08), rgba(120, 115, 245, 0.08))"
  }}>
      <svg width="18" height="18" viewBox="0 0 21 17" xmlns="http://www.w3.org/2000/svg" style={{
    flexShrink: 0,
    marginTop: "0.2rem"
  }}>
        <defs>
          <linearGradient id={gradientId} x1="0%" y1="100%" x2="100%" y2="0%">
            <stop offset="0%" stopColor="#FF3CA8" />
            <stop offset="100%" stopColor="#4827C1" />
          </linearGradient>
        </defs>
        <path d="M6.28906 12.7223C6.28889 11.3831 5.24007 10.3385 3.98926 10.3385C2.73859 10.3387 1.68963 11.3832 1.68945 12.7223C1.68945 14.0616 2.73849 15.1059 3.98926 15.1061C5.24018 15.1061 6.28906 14.0617 6.28906 12.7223ZM7.81152 0.557254C9.70554 -0.563135 12.1081 0.0645388 13.2607 1.91468L13.3691 2.09827V2.09925L20.7266 15.402C20.8713 15.6637 20.8667 15.9823 20.7148 16.2399C20.5629 16.4975 20.2864 16.6559 19.9873 16.6559H14.5459C13.0953 16.6474 11.7648 15.848 11.0469 14.5748V14.5739L6.33301 6.19104C5.22656 4.2273 5.87813 1.706 7.80957 0.558231L7.81152 0.557254ZM11.8906 2.91761C11.2374 1.74047 9.78961 1.34962 8.67188 2.01038L8.67285 2.01136C7.61521 2.64 7.19477 3.99924 7.69336 5.13733L7.80566 5.36194V5.36292L12.5186 13.7448C12.9466 14.5038 13.7274 14.9616 14.5557 14.9664H18.5547L11.8906 2.91663V2.91761ZM7.97949 12.7223C7.97949 14.9527 6.21527 16.7965 3.98926 16.7965C1.7634 16.7963 0 14.9526 0 12.7223C0.000173728 10.4921 1.76351 8.64923 3.98926 8.64905C6.21516 8.64905 7.97932 10.492 7.97949 12.7223Z" fill={`url(#${gradientId})`} />
      </svg>
      <span>{children}</span>
    </div>;
};

The Prompt Playground is where you build a prompt, run it across a dataset, score the outputs, and compare variants without writing code. This guide covers the full loop: drafting a prompt, running it as an experiment, comparing runs, and saving the winning version to Prompt Hub.

In Arize AX a prompt is a versioned artifact holding its messages, model, invocation parameters, tools, and response format together. See [the prompt object](/docs/ax/concepts/prompts/prompt-object) for what each version stores and why those pieces are versioned together.

## Build a prompt

<AskAlyx>**Ask Alyx** to draft a prompt or generate variations to compare. Press **Cmd+L** (macOS) or **Ctrl+L** (Windows and Linux) to open it.</AskAlyx>

<Frame caption="Open Playgrounds and create a new playground">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/create-a-prompt-1.gif" alt="Navigating to Playgrounds and clicking New Playground in Arize AX" />
</Frame>

<Tabs>
  <Tab title="By UI">
    <Steps>
      <Step title="Create a playground">
        Open the **Playgrounds** page, click **New Playground**, and choose a prompt playground from the menu.
      </Step>

      <Step title="Choose a provider and model">
        Select the LLM provider and model to run against. Options include OpenAI, Anthropic, Azure OpenAI, Gemini, AWS Bedrock, Google Cloud, NVIDIA NIM, and custom providers. Each provider needs credentials stored in the space before you can run against it, which an admin sets up under [model provider integrations](/docs/ax/security-and-settings/integrations-playground/overview).

        <Frame caption="Provider and model selection in the Prompt Playground">
          <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/create-a-prompt-2.png" alt="LLM provider and model dropdowns in the Arize AX Prompt Playground" />
        </Frame>
      </Step>

      <Step title="Write the messages">
        Add the system, user, and assistant messages that make up the prompt. Wrap variable names in curly braces, such as `{destination}`, to fill them from dataset columns at run time.

        <Frame caption="System and user messages with template variables">
          <video src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/create-a-prompt-3.mp4" width="100%" height="100%" style={{ display: "block", objectFit: "contain" }} controls muted loop aria-label="Defining system and user messages with template variables in the Prompt Playground" />
        </Frame>
      </Step>

      <Step title="Add tools (optional)">
        Open **Functions** and paste your tool definitions as JSON, adding one entry per tool. Use **Functions Selection** to tell the model when each tool should be called.

        <Frame caption="Tool definitions and function selection">
          <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/create-a-prompt-4.gif" alt="Adding function definitions and setting function selection in the Arize AX Prompt Playground" />
        </Frame>
      </Step>

      <Step title="Set invocation parameters">
        Open **Params** to set temperature, max completion tokens, stop sequences, and the other parameters your provider exposes. Available parameters differ by provider.

        <Frame caption="Invocation parameters in the Prompt Playground">
          <video src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/create-a-prompt-5.mp4" width="100%" height="100%" style={{ display: "block", objectFit: "contain" }} controls muted loop aria-label="Setting temperature and other invocation parameters in the Prompt Playground" />
        </Frame>
      </Step>
    </Steps>

    To start from a prompt your team already has, use the **Load a prompt** selector in the playground header to pull it from [Prompt Hub](/docs/ax/concepts/prompts/prompt-object) instead of drafting from scratch.
  </Tab>

  <Tab title="By Alyx">
    Create the playground and select a provider and model as above, or ask Alyx from the home page to create one for you. Alyx drafts against whichever model you selected, so set it before you start.

    <Steps>
      <Step title="Describe the prompt you need">
        Describe your use case in the **Alyx** panel, including the output format, tone, length, and any variables. For example:

        > Create a prompt for a customer support agent that handles returns and escalations. Use `{customer_input}` and `{order_id}` as variables.

        Give feedback on each draft and keep iterating in conversation until the prompt is right.

        <Frame caption="Drafting a prompt with Alyx in the Prompt Playground">
          <video src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/evaluate/alyxcreateprompt.mp4" width="100%" height="100%" style={{ display: "block", objectFit: "contain" }} controls muted loop aria-label="Describing a use case in the Alyx panel to draft and refine a prompt" />
        </Frame>
      </Step>

      <Step title="Try it on real rows">
        Attach a dataset and ask Alyx to run the prompt over its rows, or exercise it with manual inputs while you iterate.
      </Step>
    </Steps>
  </Tab>

  <Tab title="By Code">
    Create a prompt and its first version programmatically.

    <Tabs>
      <Tab title="Python SDK">
        For the full options, including providers, invocation parameters, and tools, see [create a prompt](/docs/api-clients/python/version-8/client-resources/prompts#create-a-prompt).

        ```python theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
        from arize.prompts.types import InputVariableFormat, LlmProvider, LLMMessage, MessageRole

        prompt = client.prompts.create(
            space="your-space-name-or-id",
            name="customer-support-agent",
            description="Handles returns and escalations",
            commit_message="Initial version",
            input_variable_format=InputVariableFormat.F_STRING,
            provider=LlmProvider.OPEN_AI,
            model="gpt-5.5",
            messages=[
                LLMMessage(role=MessageRole.SYSTEM, content="You are a support agent for {company}."),
                LLMMessage(role=MessageRole.USER, content="{ticket_text}"),
            ],
        )

        print(prompt.id, prompt.name)
        ```
      </Tab>

      <Tab title="TypeScript SDK">
        For the full options, see [create a prompt](/docs/api-clients/typescript/version-1/client-resources/prompts#create-a-prompt).

        ```typescript theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
        import { createPrompt } from "@arizeai/ax-client";

        const prompt = await createPrompt({
          space: "my-space",
          name: "customer-support",
          description: "Handles returns and escalations",
          version: {
            commitMessage: "Initial version",
            inputVariableFormat: "f_string",
            provider: "openAI",
            model: "gpt-5.5",
            messages: [
              { role: "system", content: "You are a support agent for {company_name}." },
              { role: "user", content: "{ticket_text}" },
            ],
          },
        });
        ```
      </Tab>

      <Tab title="CLI">
        For the flags and message JSON shape, see [`ax prompts create`](/docs/api-clients/cli/prompts#ax-prompts-create).

        ```bash theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
        ax prompts create \
          --name "customer-support-agent" \
          --space sp_abc123 \
          --provider openAI \
          --input-variable-format f_string \
          --messages '[{"role":"system","content":"You are a support agent for {company}."},{"role":"user","content":"{ticket_text}"}]' \
          --model gpt-5.5 \
          --description "Handles returns and escalations" \
          --commit-message "Initial version"
        ```
      </Tab>
    </Tabs>
  </Tab>
</Tabs>

## Run the prompt as an experiment

Running a prompt against a dataset creates an experiment on that dataset, so the results are directly comparable to your other runs.

<Frame caption="Running a prompt against a dataset in the Prompt Playground">
  <video src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/evaluate/playground2.mp4" width="100%" height="100%" style={{ display: "block", objectFit: "contain" }} controls muted loop aria-label="Selecting a dataset, attaching evaluators, and running a prompt in the Prompt Playground" />
</Frame>

<Steps>
  <Step title="Select a dataset">
    Choose the dataset to run against, then confirm each `{variable}` in your messages maps to a dataset column. The **Input Variables** panel shows the mapping. To reach the playground with a dataset already selected, use **New Experiment → Run in Prompt Playground** from the dataset.
  </Step>

  <Step title="Attach evaluators">
    Click **Add Evaluator** to score every row automatically. Load an evaluator saved in the space or create one. See [create evaluators](/docs/ax/evaluate/create-evaluators).
  </Step>

  <Step title="Run">
    Click **Run**. With multiple prompts in the playground, the button becomes **Run All** and each prompt runs against the same rows. Outputs and evaluator scores stream into the table as they complete.
  </Step>
</Steps>

## Compare experiments

The playground compares variants you are editing now. The dataset's **Experiments** tab compares completed runs, including runs produced by a different experiment type.

**Side by side in the playground.** Add a second prompt to compare wording changes directly, or use **Compare Models** to run the same prompt against different models. Both hold the dataset fixed, so the wording or model change is the only variable. Open a row's output, then click **View Diff on Experiments** to see that row's change against a baseline.

**Across runs on the dataset.** Open the dataset's **Experiments** tab, select two or more runs, and click **Compare Experiments** for per-row output differences, evaluator deltas, and summary metrics per run. This is where a run from last week and a run from today become directly comparable, whichever experiment type produced them.

<Frame caption="Comparison view with diff mode enabled against a baseline run">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/improve/ui_compare_two.png" alt="Arize AX Compare Experiments view with diff mode enabled, highlighting insertions and deletions against a baseline run" />
</Frame>

### Classification metrics

When your task returns a label rather than free-form text, accuracy, F1, precision, and recall are more useful than an output diff. Configure them once per dataset in **Metrics Settings** on the dataset's **Experiments** tab:

* **Ground Truth Column**, chosen from the dataset's own columns.
* **Predicted Column**, chosen from the experiment's output columns.
* **Positive Class Value**, the label that counts as positive.

With all three set, the metrics you select are computed for every experiment on that dataset, so classification runs become comparable on the same numbers.

## Save the winning prompt

When a variant wins, save it to Prompt Hub so your app can resolve it at runtime and your team can see what changed.

<Frame caption="Prompt Hub with its prompt 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 the prompts list and version management" />
</Frame>

<Steps>
  <Step title="Save from the playground">
    Click **Save Prompt** to write the current state, including messages, parameters, tools, and response format, as a new immutable version. Add a **Commit Message** describing what changed, the same way you would for code.
  </Step>

  <Step title="Review the version history">
    Open Prompt Hub to compare versions and see what changed between them.
  </Step>

  <Step title="Tag the version you ship">
    Tag the winning version with your deployment label, such as `production`, so your app resolves the approved prompt rather than a specific version number.
  </Step>
</Steps>

<Frame caption="Prompt version history and comparison in Prompt Hub">
  <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 aria-label="Browsing and comparing prompt version history in Prompt Hub" />
</Frame>

For version management from code, see [save and version prompts](/docs/ax/improve/save-and-version-prompts).

## Save your playground session

A playground view is a named snapshot of a playground session, holding its prompt messages and tools, model and parameter configuration, dataset selection, and results. Views let you return to a setup, hand it to a teammate, or branch a new variant without rebuilding it.

Saved views are listed under **Playgrounds**, where **All**, **Prompt**, and **Agent** filter by playground type. Each view can be renamed, duplicated, or deleted, and **Enable view auto-save** keeps a view current as you work.

<Frame caption="Saved playground views with rename, duplicate, and delete actions">
  <img src="https://storage.googleapis.com/arize-phoenix-assets/assets/images/arize-docs-images/evaluate/Screenshot%202026-04-22%20at%209.02.57%E2%80%AFPM.png" alt="Arize AX Playgrounds list with options to edit the name, duplicate, or delete a saved playground view" />
</Frame>

## Next steps

<CardGroup cols={3}>
  <Card title="Remote agent experiments" icon="robot" href="/docs/ax/improve/remote-agent-experiments">
    Test a deployed agent end to end when the change spans more than one model call.
  </Card>

  <Card title="Code experiments" icon="code" href="/docs/ax/improve/code-experiments">
    Run experiments from your own runtime for pipelines and multi-step workflows.
  </Card>

  <Card title="Run evals on experiments" icon="list-check" href="/docs/ax/evaluate/run-evals-on-experiments">
    Score outputs with LLM and code evaluators.
  </Card>
</CardGroup>
