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

# Prompt playground

> Test and compare prompts for different models in the LLM playground

Test and iterate on your prompts directly in the Keywords AI LLM playground. You can test your prompts with different models, settings, and parameters to evaluate their performance.

<Frame>
  <video controls className="w-full aspect-video" src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/prompt/playground.mp4" />
</Frame>

## Improve prompts

You can use the playground to test and iterate on prompts in your library.

### Bring prompts to the playground

When you finish writing a prompt in the prompt editor, you can bring it to the playground to test and iterate on it. First, enter the values for each variable in the prompt, then click the `Playground` button in the top bar.

<Frame>
  <img src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/prompt/prompt-to-playground.png" alt="Bring prompt to playground" />
</Frame>

### Save the prompt

After you have tested and iterated on a prompt, you can save it to the library for future use. Click the `Commit` button in the top bar to save the prompt. <br />
The prompt will be saved to the library, and you can find it on the [Prompts page](https://platform.keywordsai.co/platform/prompts).

<Frame>
  <img src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/prompt/playground-to-prompt.png" alt="playground" />
</Frame>

## Debug prompts from logs

You can also debug prompts from your production logs. Find a log containing a prompt that you want to debug, and click the `Open in Playground` button in the top bar.

<Frame>
  <img src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/prompt/logs-to-playground.png" alt="playground" />
</Frame>

## Simulate a prompt x times

You can simulate a prompt x times to see the variation in the responses. In the side panel of the playground, you can set the number of variants you want to simulate.

<Frame>
  <img src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/prompt/playground-set-variants.jpg" alt="playground" />
</Frame>

After you run the simulation, you can see the results in the right panel. Just click the `Variants` tab to see the results.

<Frame>
  <img src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/prompt/playground-see-variants.jpg" alt="playground" />
</Frame>

<Note>
  `Variants` is similar to the OpenAI API's `n` parameter. But it's different because we actually make API calls to the LLM to generate the variants.
</Note>

## Advanced features

We provide the ability to test LLMs with function calling and image support. Here's a guide on how to use these features.

### Function calling

In the playground, click the `Add tool` button to enter your function in the code editor.

<Frame>
  <img src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/prompt/function-calling.png" alt="playground" />
</Frame>

### Attaching images

You can attach images to your prompt by clicking the `link` icon.

<Frame>
  <img src="https://keywordsai-static.s3.us-east-1.amazonaws.com/docs/prompt/playground-image.png" />
</Frame>
