Few-Shot Prompt Builder
Guide: How to Write a Few-Shot Prompt: How Many Examples and How to Format ThemA few-shot prompt shows an AI model a handful of examples so it can copy the pattern. Add your examples, an optional instruction and the new input you want an answer for, and get one prompt to copy. Choose labels such as Input and Output, XML tags, or a User and Assistant layout. Empty examples are left out and you see a rough token count.
0 example(s) used, about 4 tokens (an estimate).
Examples that are empty are left out. Three to five varied examples usually work better than many similar ones. Check the result with your own model, because no prompt works the same everywhere.
Features
- Any number of examples, with an optional instruction
- Three layouts: labels, XML tags or chat
- Your own labels for input and output
- A rough token count of the finished prompt
How to use Few-Shot Prompt Builder
- Add an instruction and your examples.
- Type the new input and choose a layout.
- Copy the prompt into your AI tool.
Frequently asked questions
What is a few-shot prompt?
A prompt that contains a few worked examples before the real question, so the model can see the format and style you want. With no examples it is called zero-shot, with one example one-shot.
How many examples should I use?
Often three to five varied examples work well, but there is no fixed number. Examples that are too alike can make the answers too alike. Test it with your own model and adjust.
Which layout should I choose?
Labels (Input and Output) work in most tools. XML tags keep the parts clearly apart when the examples contain long or messy text. The chat layout mimics a conversation. None is always best, so try the one that gives the clearest answers.
Is my text sent anywhere?
No. The prompt is built in your browser and nothing is sent anywhere. You can check this yourself: switch off your internet connection after the page has loaded and the tool still works.