What is a prefill in AI chat? Starting the reply for the model
Updated
A prefill is text you place at the start of the AI's reply before it writes, so the model continues from your words instead of starting fresh. If the reply is made to begin "*Mara doesn't touch the coin.*", the model carries on in that voice and format. Prefill works naturally in text completion and only in some chat completion APIs, so check whether yours continues a trailing assistant message.
Try it now, free, no account neededStart a story with Mara VellSharp-tongued innkeeper with a secretHow a prefill works
A language model only ever does one thing: it writes the next piece of text after everything it has been given. Normally the app ends the prompt at the point where the character's reply should begin. A prefill moves that point forward by writing the first few words yourself.
In a chat-style request, that means the last message in the list is an assistant message that isn't finished:
- system: the character card for Mara, a sharp-tongued innkeeper.
- user: *I slide a silver coin across the bar.* "A room, and no questions."
- assistant (prefill): *Mara doesn't touch the coin.*
If the server supports it, the model continues straight on: " *She studies your boots instead, the mud still wet on them.* 'Rooms come with questions here, love.'" The app then shows your prefill and the continuation as one reply.
What roleplayers use it for
| Goal | Example prefill |
|---|---|
| Lock the format to narration first | *Mara |
| Open with dialogue | " |
| Keep a set tense or person | She |
| Skip chatty preambles | The character's name and a colon |
| Set the mood of one reply | *The fire has burned low when |
A short prefill nudges; a long one dictates. Most people keep it to a few words, because the model writes better when it gets to choose most of the sentence.
Why support varies
With a text completion API, a prefill is just the end of the prompt, so it always works: the app writes "Mara:" and the model carries on. With a chat completion API, it depends on the server. Some continue a trailing assistant message as if mid-sentence. Others treat it as a finished turn and write a new reply after it, and a few reject the request.
A quick test tells you which you have. Send a trailing assistant message that reads "The password is" and look at the result. A continuation like " swordfish, and it changes at midnight" means prefill works. A fresh reply that starts its own sentence means the server treats your text as a complete message, and you should steer another way. Front ends such as SillyTavern have a setting for starting the reply with your own text, and how they send it depends on the API type you connect; what a Chat Completions API is explains the two types.
Pitfalls
- The same prefill every turn makes every reply open the same way, which reads as repetition. See stopping repetition.
- A prefill that fights the character card confuses the model; keep them in agreement.
- Watch spacing. A prefill ending without a space can glue the next word on.
- A prefill can't fix a model that doesn't know the scene. If replies are off, look at the card and context first.
Steering without a prefill
If your setup doesn't support prefill, the same effect comes from elsewhere. The greeting and example dialogue show the model how replies begin, which is why the first message matters so much. An instruction such as "Begin every reply with the character's action in asterisks" works in a system prompt or an author's note. On the UnsavedAI site you don't send raw requests at all: Edit the opening of a reply you dislike, or ask for Another version, and later replies follow the corrected pattern.
Questions people ask
Is a prefill the same as a system prompt?
No. A system prompt is instructions the model reads before the chat. A prefill is the first words of the reply itself, which the model continues.
Does the prefill show up in the chat?
Depends on the app. Many show it as part of the reply, since the model's words follow straight on from it. Some keep it hidden.
How do I know if my API supports prefill?
Send an unfinished assistant message as the last turn, such as "The password is", and see whether the reply continues the sentence or starts a new one.
