> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/ai/ai-model-hub/dcd-how-tos/use-playground.md).

# Use the Playground

Test text, vision, and image generation models in the AI Model Hub Playground, compare two models, and copy API code.

The **Playground** tab of the <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code> lets you send prompts to a model, compare two models side by side, and copy ready-to-use API code. This guide explains how to test text, vision, and image generation models, how to use the compare mode, and how to move your test to the API.

{% hint style="warning" %}
**Warning:** The Playground bills each request at the standard rates of the model. Use it to evaluate models, and use the API for production workloads. Response times reflect the real-time load of the model and can vary from request to request.
{% endhint %}

## Prerequisites

* A user account that has the **Access and manage AI Model Hub** privilege. For more information, see [<mark style="color:blue;">Get Started with AI Model Hub in the DCD</mark>](https://docs.ionos.com/cloud/ai/ai-model-hub/dcd-how-tos/get-started.md#prerequisites).
* A contract with completed billing details. Accounts that have not completed their registration can open the Playground but cannot send prompts. The prompt field shows **Complete your registration to send messages**.

## Open the Playground

1. In the **DCD**, go to **AI** > **AI Model Hub**.
2. Select the **Playground** tab.

Alternatively, on the **Models** tab, select **Open in playground** for a model. The Playground opens with the model and the matching mode already selected.

## Select a mode and a model

Use the mode buttons to select what you want to test:

| **Mode**             | **Input**                           | **Output** |
| -------------------- | ----------------------------------- | ---------- |
| **Text**             | Text                                | Text       |
| **Vision**           | Image and text                      | Text       |
| **Image generation** | Text, or text and a reference image | Image      |

The **Model** list shows only the models that support the selected mode. The list excludes models that do not fit the mode, such as an image model in **Text** mode. **Hosting location** shows where the selected model runs.

{% hint style="info" %}
**Note:** Selecting another mode or model, or switching between **Single** and **Compare**, starts a new conversation.
{% endhint %}

## Test a text model

1. Select the **Text** mode and a model.
2. Optionally, adjust the parameters in the parameters panel:

   ![The Playground in Text mode with the mode and model bar, the parameters, and the example prompts](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-36848ccb24065a8121bf81ada019e2f5c83c9bfb%2Fai-model-hub-dcd-playground-text-empty.png?alt=media)

   * **Temperature**: A value from 0 to 1. Lower values give more precise answers, and higher values give more creative answers.
   * **Top P**: A value from 0 to 1. Lower values give more focused answers, and higher values give more diverse answers.
   * **Apply token limit**: Select the checkbox to limit the length of the answer, and enter the maximum number of tokens. The value must be between 64 and 32,768.
   * **System prompt**: Enter instructions that define how the model behaves for every request.
   * **Reasoning effort** or **Reasoning**: Only available for models that support reasoning. Models with two settings show an on and off switch. Other models offer levels such as **Low**, **Medium**, and **High**.
3. Enter a prompt in the prompt field, or select one of the four example prompts: **Classify a message**, **Analyse feedback**, **Summarise a note**, or **Redact personal data**.

   The Playground places the example text in the prompt field, where you can edit it.
4. Press **Enter** or select the **Send prompt** arrow.

   Press **Shift+Enter** to add a new line.

   ![A text model answering a prompt, with the statistics line below the answer](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-9ce09eb83d8e825bd7074e00559a0501e9cfce8c%2Fai-model-hub-dcd-playground-text.png?alt=media)

The answer appears as the model generates it. To stop a response, select **Stop generating**, which replaces the **Send prompt** arrow while the model answers. For models that show their reasoning, a collapsible **Thinking** section appears above the answer.

For each answer, the Playground shows statistics for the request:

* **Input tokens** and **Output tokens**: The number of tokens in your prompt and in the answer. A token is a small unit of text, roughly a word or part of a word.
* **Throughput**: How many tokens the model generates per second.
* **TTFT**: The time to first token, which is how long the model takes to start answering.
* **Total time**
* **Cost**: The estimated cost of the request.

The **Playground** keeps the conversation, so you can ask follow-up questions. To start over, select **Clear session**.

## Test a vision model

1. Select the **Vision** mode and a model.
2. Drag an image into the upload area, or select **Browse** and select a file.

   Upload a PNG or JPG image of up to 12 MB. For details, see [<mark style="color:blue;">Image Input</mark>](https://docs.ionos.com/cloud/ai/ai-model-hub/how-tos/image-input.md). To analyze a document, convert it to an image first, for example a PDF page.

   ![The Playground in Vision mode with the upload area and the prompt suggestions](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-c7264f7fb222342e7c0789599be85c874bb9c0a9%2Fai-model-hub-dcd-playground-vision.png?alt=media)
3. Enter a question about the image, or select one of the suggestions: **Extract table**, **Parse invoice**, **Analyse chart**, or **Transcribe document**.
4. Select **Send prompt**.

To remove the image, select the **×** on its preview.

## Generate an image

1. Select the **Image generation** mode and a model.
2. For models that allow a custom resolution, enter the **Resolution** as width × height, up to 4 megapixels (MP), where a megapixel is about one million pixels.

   For the maximum resolution of a model, see its [<mark style="color:blue;">model card</mark>](https://docs.ionos.com/cloud/ai/ai-model-hub/models.md).
3. Optionally, upload a reference image, which is an image that guides the result.

   Only models that accept image input offer the upload area.

   ![The Playground in Image generation mode with the resolution fields and the upload area](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-f72bff5378ac7814bb12e140b58a998040519fb0%2Fai-model-hub-dcd-playground-image.png?alt=media)
4. Describe the image, or select an example such as **Product photo**, **Food photo**, **Interior scene**, or **Abstract background**.
5. Select **Send prompt**.

The generated image appears in the conversation with the total time and the estimated cost.

## Compare two models

Use the compare mode to send the same prompt to two models and review the answers next to each other.

1. In the Playground, select **Compare**.
2. In each column, select a model.
3. Optionally, select **Adjust parameters** in a column to change **Temperature**, **Top P**, **Token limit**, or the reasoning setting for that model only.

   In **Image generation** mode, the column offers the resolution, which applies to both columns. The expanded view also shows the **System prompt**. In the second column, select **Same as left** to reuse the system prompt of the first column.
4. Enter a prompt and select **Send prompt**. Both models receive the prompt at the same time.

   ![Two models answering the same prompt in compare mode](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-a0d0355f7b63e1a893e6f75f7aa6ad30ce2a6dfe%2Fai-model-hub-dcd-playground-compare.png?alt=media)

To send a different prompt to each model, select **Different prompts**. Each column then has its own prompt field and send button, so you can run one model again without sending a request to the other. Select **Clear both** to reset both conversations.

![Compare mode with the Different prompts option and one prompt field for each model](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-8345f52606b5a6c04482aab0808e533df1fc85de%2Fai-model-hub-dcd-playground-compare-split.png?alt=media)

To return to one model, select **Single**.

{% hint style="info" %}
**Note:** A reference image or a resolution that you set in compare mode applies to both columns.
{% endhint %}

## Copy API code

The **API code** tab generates code that reflects your current **Playground** settings.

1. Select the **\</> API code** tab.
2. Select **Python**, **Node.js**, or **cURL**.
3. Select **Copy**.

   ![The API code tab with the language buttons and the Copy button](https://1737632334-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MifAzdGvKLDTtvJP8sm%2Fuploads%2Fgit-blob-26521719006d30724d8c2c64fd6781fdcaff4570%2Fai-model-hub-dcd-playground-api-code.png?alt=media)
4. Replace the token placeholder in the code with an [<mark style="color:blue;">authentication token</mark>](https://docs.ionos.com/cloud/ai/ai-model-hub/dcd-how-tos/get-started.md#generate-an-authentication-token).

In compare mode, the tab shows one code panel for each model, and each panel has its own **Model** list.

Review the parameters, add error handling, and test your application before you deploy it. To learn more about moving to production, expand the **From Playground to production** section.

{% hint style="success" %}
**Result:** You have tested one or more models and have API code that you can use in your application.
{% endhint %}

## Troubleshooting

| **Message**                                                                                               | **What to do**                                                                                                                                                  |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Authentication required** in the conversation area, or **Sign in to send messages** in the prompt field | Your session might have expired, or your account might not have the required permissions. Refresh the page. If the message remains, contact your administrator. |
| **Complete your registration to send messages**                                                           | Complete the billing details of your contract to send prompts.                                                                                                  |
| **Reduce the resolution to 4 MP or less to send this prompt.**                                            | Lower the width or height of the image.                                                                                                                         |

## Next steps

* [<mark style="color:blue;">Track Cost and Usage</mark>](https://docs.ionos.com/cloud/ai/ai-model-hub/dcd-how-tos/track-cost-and-usage.md)
* [<mark style="color:blue;">Text Generation</mark>](https://docs.ionos.com/cloud/ai/ai-model-hub/how-tos/text-generation.md)
* [<mark style="color:blue;">Image Input</mark>](https://docs.ionos.com/cloud/ai/ai-model-hub/how-tos/image-input.md)
* [<mark style="color:blue;">Image Generation</mark>](https://docs.ionos.com/cloud/ai/ai-model-hub/how-tos/image-generation.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/ai/ai-model-hub/dcd-how-tos/use-playground.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
