Prompt Prefilling
Use Prompt Prefilling to control the initial output of the completion.
Prompt prefilling is a powerful feature that allows you to control the initial output of your models. This can be particularly useful for maintaining context, structuring outputs, or continuing previous dialogues.
How It Works
To use prompt prefilling, include an assistant message at the end of your input with the following characteristics:
- Set the
role
to “assistant” - Set the
name
to “prefill” - Include your desired prefill content in the
content
field
Our completions will start their response taking the prefilled content into account, effectively “continuing” from where you left off.
Example Usage
Basic Prefilling
The response will continue the story from there.
Structured Output
Prefilling can be used to enforce specific output structures:
This ensures the response starts with the desired format.
Maintaining Character in Roleplays
For roleplay scenarios, prefilling can help maintain character consistency:
Notes
- Prefilling only works when interacting with our OpenPipe finetuned models.
- You can use this feature while finetuning as well, maintaining the same characteristics for the assistant message.
By leveraging prompt prefilling, you can create more controlled, consistent, and context-aware interactions in your applications.