# Deploying a prompt template #

Deploy a prompt template so you can add it to a business workflow or so you can evaluate the prompt template to measure performance\.

## Before you begin ##

Save a prompt template that contains at least one variable as a project asset\. See [Building reusable prompts](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-prompt-variables.html)\.

## Promote a prompt template to a deployment space ##

To deploy a prompt template, complete the following steps:

<!-- <ol> -->

1.  Open the project containing the prompt template\.
2.  Click **Promote to space** for the template\.
    
    ![Promoting a prompt template to a deployment space](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/xgov-deploy-prompt1.png)
3.  In the *Target deployment space* field, choose a deployment space or create a new space\. Note the following:
    
    The deployment space must be associated with a machine learning instance that is in the same account as the project where the prompt template was created.
    
    If you don't have a deployment space, choose **Create a new deployment space**, and then follow the steps in [Creating deployment spaces](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/ml-space-create.html).
    
    If you plan to evaluate the prompt template in the space, the recommended **Deployment stage** type for the space is *Production*. For more information on evaluating, see [Evaluating a prompt template in a deployment space](https://dataplatform.cloud.ibm.com/docs/content/wsj/model/wos-eval-prompt-spaces.html).
    
    Note: The deployment space stage cannot be changed after the space is created.

<!-- </ol> -->

<!-- <ol> -->

1.  **Tip**: Select **View deployment in deployment space after creating**\. Otherwise, you need to take more steps to find your deployed asset\.
2.  From the **Assets** tab of the deployment space, click **Deploy**\. You create an online deployment, which means you can send data to the endpoint and receive a response in real\-time\.
    
    ![Deploying a prompt template](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/xgov-deploy-prompt2.png)
3.  Optional: In the *Deployment serving name* field, add a unique label for the deployment\.
    
    The serving name is used in the URL for the API endpoint that identifies your deployment. Adding a name is helpful because the human-readable name that you add replaces a long, system-generated unique ID that is assigned otherwise.
    
    The serving name also abstracts the deployment from its service instance details. Applications refer to this name, which allows for the underlying service instance to be changed without impacting users.
    
    The name can have up to 36 characters. The supported characters are \[a-z,0-9,\_\].
    
    The name must be unique across the IBM Cloud region. You might be prompted to change the serving name if the name you choose is already in use.

<!-- </ol> -->

## Testing the deployed prompt template ##

After the deployment successfully completes, click the deployment name to view the deployment\.

![Deploying a prompt template](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/images/xgov-deploy-prompt3.png)

<!-- <ul> -->

 *  **API reference** tab includes the API endpoints and code snippets that you need to add this prompt template to an application\.
 *  **Test** tab supports testing the prompt template\. Enter test data as text, streamed text, or in a JSON file\. For details on testing a prompt template, see\.

<!-- </ul> -->

If the watsonx\.governance service is enabled, you also see these tabs:

<!-- <ul> -->

 *  **Evaluate** provides the tools for evaluating the prompt template in the space\. Click **Activate** to choose the dimensions to evaluate\. For details, see [Evaluating prompt templates](https://dataplatform.cloud.ibm.com/docs/content/wsj/model/wos-eval-prompt.html)\.
 *  **AI Factsheets** displays all of the metadata that is collected for the prompt template\. Use these details for tracking the prompt template for governance and compliance goals\. See [Tracking prompt templates](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/xgov-track-prompt-temp.html)\.

<!-- </ul> -->

For more information, see [Deployment spaces](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/ml-spaces_local.html)\.

## Learn more ##

<!-- <ul> -->

 *  [Tracking prompt templates ](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/xgov-track-prompt-temp.html)
 *  [Evaluating a prompt template in a deployment space](https://dataplatform.cloud.ibm.com/docs/content/wsj/model/wos-eval-prompt-spaces.html)
 *  [Security and privacy for foundation models](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-security.html)

<!-- </ul> -->

**Parent topic:**[Deploying and managing assets](https://dataplatform.cloud.ibm.com/docs/content/wsj/wmls/wmls-deploy-overview.html)

<!-- </article "role="article" "> -->