Skip to main content

Playground Advanced Features

Configure advanced parameters for fine-tuned control over model responses.

Advanced Parameters

Click Advanced Parameters in the Playground to reveal additional configuration options.

Frequency Penalty (-2.0 to 2.0)

Controls repetition of tokens based on their frequency in the text so far.

ValueEffect
-2.0Strongly encourage repetition
0.0No penalty (default)
2.0Strongly discourage repetition

Use cases:

  • Positive values for creative writing to avoid word repetition
  • Negative values when you need consistent terminology

Presence Penalty (-2.0 to 2.0)

Controls repetition based on whether a token has appeared at all.

ValueEffect
-2.0Encourage reusing existing topics
0.0No penalty (default)
2.0Encourage exploring new topics

Use cases:

  • Positive values for brainstorming and diverse ideas
  • Negative values for focused, consistent responses

Seed (Integer)

Set a seed for reproducible outputs.

Seed: 42

Benefits:

  • Same seed + same input = same output
  • Useful for testing and debugging
  • Essential for A/B testing prompts

Note: Reproducibility is best-effort and may vary across model versions.

Stop Sequences

Define sequences that stop generation when encountered.

Stop: ###, <END>, \n\n

Examples:

  • ### - Stop at markdown section breaks
  • <END> - Stop at custom end markers
  • \n\n - Stop at double newlines

Enter multiple sequences separated by commas.

Request Modes

The Playground has two request toggles — Stream and Background. They are mutually exclusive: enabling one automatically disables the other. With both toggles off, requests are sent as standard synchronous calls.

Stream (Default)

Real-time token streaming as the model generates.

Features:

  • See responses as they're generated
  • Cancel mid-generation with the Stop button
  • Better user experience for long responses

Background

Submit requests as background jobs.

When to use:

  • Very long responses
  • Batch testing
  • When you don't need immediate results

How it works:

  1. Toggle Background on
  2. Submit your prompt
  3. Request is queued as a job
  4. View results in the Jobs page

Standard Requests

Turning Stream off (with Background also off) sends a standard request/response without streaming.

When to use:

  • Simple, short requests
  • When streaming causes issues
  • API behavior testing

Context Usage Warning

As a conversation approaches the selected model's context limit, the Playground shows a context-usage warning with the remaining token budget:

{remaining} tokens remaining

This helps you:

  • Stay within model context limits
  • Know when to trim the conversation or lower max tokens

Thinking Process Display

For models that support reasoning (with <think> tags):

  • Thinking blocks are displayed separately
  • Collapsible sections for cleaner output
  • Shows the model's reasoning process

Code Export

Click Code to get equivalent API code:

Exported Parameters

The code includes all your configured parameters:

response = client.chat.completions.create(
model="meta-llama/Llama-3.1-8B-Instruct",
messages=[...],
temperature=0.7,
max_tokens=1024,
top_p=0.9,
frequency_penalty=0.5,
presence_penalty=0.2,
seed=42,
stop=["###", "<END>"]
)

Best Practices

For Consistent Outputs

  1. Set temperature=0
  2. Use a fixed seed
  3. Keep top_p=1.0

For Creative Outputs

  1. Increase temperature (0.8-1.2)
  2. Add presence_penalty (0.3-0.6)
  3. Add frequency_penalty (0.3-0.6)

For Focused Outputs

  1. Lower temperature (0.3-0.5)
  2. Lower top_p (0.7-0.9)
  3. Use specific stop sequences

For Long-Form Content

  1. Use Background mode for reliability
  2. Set appropriate max_tokens
  3. Consider breaking into chunks