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

# Create Playgrounds

> Test LLM prompts in an interactive environment. Compare models side-by-side, adjust parameters, and iterate on prompts before deploying to production.

Use **Playgrounds** to:

<AccordionGroup>
  <Accordion title="Quickly test prompts" icon="flask">
    Test [Prompts](/docs/prompts/overview) in an easy-to-use interactive environment before deploying to production.
  </Accordion>

  <Accordion title="Compare models side-by-side" icon="code-compare">
    Run the same prompt across multiple models simultaneously and compare outputs directly.
  </Accordion>

  <Accordion title="Test with new models" icon="swap">
    Try existing use cases and prompts against new models without touching your production configuration.
  </Accordion>

  <Accordion title="Experiment with parameters" icon="sliders">
    Adjust temperature, top-p, max tokens, and other parameters to tune model behavior.
  </Accordion>

  <Accordion title="Build fine-tuning datasets" icon="database">
    Provide feedback on responses to create curated datasets for future fine-tuning.
  </Accordion>
</AccordionGroup>

## Create a Playground

Head to the AI Studio, choose a [Project](/docs/projects/overview), and use the `+` button to select **Playground**.

The following modal opens:

<Frame caption="Give your Playground a title, choose a Project, and select the initial model. Everything can be modified later.">
  <img src="https://mintcdn.com/orqai/x_6IXnot9ETOc_0g/images/docs/337cdcb-Screenshot_2024-08-13_at_17.10.27.png?fit=max&auto=format&n=x_6IXnot9ETOc_0g&q=85&s=10d21af7210321cbcc85fe2b40042587" alt="Give your Playground a title, choose a Project, and select the initial model. Everything can be modified later." width="646" height="428" data-path="images/docs/337cdcb-Screenshot_2024-08-13_at_17.10.27.png" />
</Frame>

After which, the Playground can be configured:

<Frame caption="Configure model, parameters, and prompt template in the Playground.">
  <img src="https://mintcdn.com/orqai/sz0pmFlKGzJiFYQH/images/configuring-playground.gif?s=62edc1ac8243ed91bfbab19c9ec3e5e4" alt="Configuring a Playground" width="1200" height="789" data-path="images/configuring-playground.gif" />
</Frame>

## Layout

The Playground is split into two panels:

* **Left panel**: Parameters, Prompt template, Knowledge Bases, and Tools configuration.
* **Right panel**: Chat and generation area where responses appear.

The top-right toolbar contains **Add model**, **Variables**, and **Blocks**.

Use the **Logs** tab to view call logs for this Playground. See [Logs](/docs/observability/logs) for details.

## Parameters

The **Parameters** block at the top of the left panel controls the model and its settings. Click the chevron to collapse or expand it.

Available parameters include: Model, Max Tokens, Temperature, Top P, Top K, and Response Format.

To change the model, click the model name to open the list of available models.

<Info>
  See which models are available in the [AI Router](/docs/model-garden/overview).
</Info>

In the Playground, you can test all available models through the **Orq.ai** API key without setting up your own API keys.

<Frame caption="When selecting a model, the block automatically updates with all corresponding parameters for that model.">
  <img src="https://mintcdn.com/orqai/x_6IXnot9ETOc_0g/images/docs/1826225-Screenshot_2024-04-15_at_11.57.23.png?fit=max&auto=format&n=x_6IXnot9ETOc_0g&q=85&s=eba61722899cd526536c73550cb8ba27" alt="When selecting a model, the block automatically updates with all corresponding parameters for that model." width="1194" height="260" data-path="images/docs/1826225-Screenshot_2024-04-15_at_11.57.23.png" />
</Frame>

The **Max Tokens** parameter is especially important: make sure the model has enough tokens allocated for the expected output.

<Info>
  To learn more about the most common model parameters, see [Model Parameters](/docs/prompts/creating#model-parameters).
</Info>

## Prompt Template

Define the prompt in the **Prompt template** block. Use the **Import prompt** button to load an existing prompt from your project.

Use `{{variable_key}}` syntax in the prompt message to define variables. The **Variables** button in the top toolbar lists all variables defined in the current prompt and lets you set their values before generating.

<Info>
  To learn how to set up your Prompt and Messages, see [Creating a Prompt](/docs/prompts/creating).
</Info>

## Knowledge Bases

Attach a [Knowledge Base](/docs/knowledge/overview) to the Playground using the **Add Knowledge Base** button in the **Knowledge Bases** section. The Knowledge Base content is included in the prompt context when generating.

## Tools

Add tools to the Playground using the **Add Tool** or **Import Tool** buttons in the **Tools** section. Tools extend what the model can do during generation.

## Generation

Once the prompt template is ready, click **Generate** to produce a response.

Use **Add message** to append messages before generating. Use **Clear chat** to reset the conversation while keeping the prompt template.

<Frame caption="Responses stream in real time. Continue the conversation by adding messages and generating new answers.">
  <img src="https://mintcdn.com/orqai/E8L3R46ivX7g9-QI/images/docs/abdac6c-Screenshot_2024-04-15_at_15.38.35.png?fit=max&auto=format&n=E8L3R46ivX7g9-QI&q=85&s=46712d46b3b04d4720a3faece882b9b8" alt="Responses stream in real time. Continue the conversation by adding messages and generating new answers." width="1784" height="876" data-path="images/docs/abdac6c-Screenshot_2024-04-15_at_15.38.35.png" />
</Frame>

Cost and token count for the latest generation are shown at the bottom-right of the panel.

## Comparing Multiple Models

Click **Add model** in the top toolbar to add a second model block. Each model gets its own block, allowing side-by-side comparison with the same prompt.

### Copying and Duplicating Models

Use the <Icon icon="ellipsis" /> menu at the top-right of any model block to:

* **Copy Prompt Template**: copy the template to one or all other model blocks.
* **Duplicate Block**: create a copy of the block including its configuration.

### Blocks

Use the **Blocks** button in the top toolbar to toggle which model blocks are visible or delete blocks you no longer need.

<Frame caption="Use the Blocks menu to view all models in your Playground, toggle visibility, and delete blocks.">
  <img src="https://mintcdn.com/orqai/E8L3R46ivX7g9-QI/images/docs/b5fced5-Screenshot_2024-04-15_at_16.35.07.png?fit=max&auto=format&n=E8L3R46ivX7g9-QI&q=85&s=0013925b5b47fc7438eca0befc25dfc9" alt="Use the Blocks menu to view all models in your Playground, toggle visibility, and delete blocks." width="752" height="322" data-path="images/docs/b5fced5-Screenshot_2024-04-15_at_16.35.07.png" />
</Frame>
