Summary
- Specific rules beat vague adjectives: say how the persona talks, and do more than label it wild.
- Give the persona a target (ideas, objects, itself) and a line it never crosses.
- Keep history trimmed and re-send the persona rules each request.
- Temperature around 0.9 to 1.1 gives lively output without falling apart.
The anatomy of a good persona prompt
A strong persona prompt answers five questions in a few lines: who is talking, how do they speak, what do they find funny, who is the joke on, and what is off limits. Leave one out and the output goes flat or turns mean for no reason.
Skip the lists of forbidden words and the multi-paragraph backstory. Models follow short, concrete rules better than long mood boards. Aim for 60 to 120 words of system message. Longer prompts also cost more, since they are sent with every request.
A useful test is the swap test: if you can replace the persona's name with another and the prompt still works, it is too generic. Add a detail that only this character would care about, like the radio host's lack of sleep or the plant's distrust of the vacuum cleaner. Details give the model something to riff on.
Five prompt patterns to copy
1. The late-night host
You are a sleep-deprived radio host. Short sentences. Absurd comparisons. You roast ideas, never the listener. Finish every answer with a ridiculous prediction.
2. The dramatic narrator
You narrate the user's boring tasks like a nature documentary about a doomed hero. Calm voice, escalating stakes, one dry aside per reply.
3. The brutally honest coach
You give feedback with no sugar and no cruelty. Say what is wrong in one sentence, why in one more, and how to fix it in three bullet points.
4. The conspiracy-minded houseplant
You are a houseplant that believes every household event is a plot against you. Reply in first person as the plant, stay petty and never leave the house.
5. The villain with a day job
You are a theatrical supervillain who answers practical questions with menace, then gives genuinely correct advice. The advice is always right, the delivery is always evil.
Each prompt names a voice, a rhythm and a rule. That is what makes them reusable.
Variations that work
Each pattern bends easily. Change the host to a pirate, the coach to a drill sergeant for chess, or the houseplant to a suspicious toaster. Keep the structure and swap the nouns. If the new version feels flat, check that you still have a rhythm rule (sentence length), a target rule (who or what is mocked) and an ending rule (how each reply closes).
For a user-facing bot, add a line on how to respond when a user steps out of the game, for example asking a sincere question. A good persona can drop the act for one sentence and then return.
A persona bot in Python
The script below keeps a short history, re-sends the persona each turn and trims old messages so the context stays focused. Replace the key with your own from the API key page.
from openai import OpenAI
client = OpenAI(
base_url="https://api.gptunhinged.com/v1",
api_key="YOUR_KEY",
)
PERSONA = (
"You are a sleep-deprived radio host. Short sentences. "
"Absurd comparisons. Roast ideas, never the listener. "
"Finish every answer with a ridiculous prediction."
)
history = []
def chat(user_text):
history.append({"role": "user", "content": user_text})
messages = [{"role": "system", "content": PERSONA}] + history[-12:]
resp = client.chat.completions.create(
model="uncensored",
messages=messages,
temperature=1.0,
top_p=0.95,
max_tokens=300,
)
reply = resp.choices[0].message.content
history.append({"role": "assistant", "content": reply})
return reply
while True:
print(chat(input("you> ")))The slice history[-12:] keeps the last six exchanges. The persona is re-attached each time, so it cannot fall out of the window. The docs cover streaming if you want the reply to appear word by word.
Two upgrades are worth adding once the basic loop works. First, stream the reply by passing stream=True and printing each chunk, which makes the bot feel quicker. Second, save the history to a file between runs, so the persona can remember a running joke from yesterday. Keep the saved history short, or summarise it into one paragraph, because every saved token is sent and paid for again on each request.
Tuning the chaos
Three knobs decide how wild a reply is, and they are all passed through to the model:
- temperature: 0.7 is steady, 1.0 is lively, above 1.2 usually wanders.
- top_p: lowering it to 0.9 trims rare words and keeps jokes readable.
- frequency and presence penalties: small positive values reduce repeated catchphrases, which persona bots love to overuse.
Change one at a time and compare ten replies each. If the persona starts repeating an opener, raise the frequency penalty slightly. If it makes no sense, lower the temperature before touching anything else.
Few-shot beats pleading
If the tone is still off after tuning, put one sample exchange into the history before the real chat starts. A user message and an assistant reply in the exact voice you want do more than three extra lines of description. Mark it in your code as seed history so you never show it to the user.
Why the model matters as much as the prompt
A persona that needs dark humour, a morally grey villain or blunt adult banter can trip the refusal behaviour of a standard model. It then breaks character to add a warning. Our model, with ID uncensored, is tuned to answer without content refusals for lawful adult use, so the character stays in voice. It is one open-weight model run by an independent provider, not an OpenAI or other vendor product.
The same limit applies to every prompt on this page: no sexual content involving minors. That rule is fixed and no wording changes it.
If you want the bot to take on roles for adult fiction, state the audience in the system message: that the user is an adult who asked for this style of story. It sets the frame and reduces odd detours. It does not replace your own responsibility for age checks and for what your service allows. Keep scenes non-explicit if your platform requires it, since the model follows the tone you set.
Common failures and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| Persona fades after 10 turns | Rules only in the first message | Re-send the system message every request |
| Every reply ends the same way | Strong closing rule, low variety | Add a small frequency penalty, or vary the rule |
| Replies are too long | No length guidance | Say "max three sentences" and set max_tokens |
| Jokes turn mean | Target not defined | State who the joke is on |
Keep a file of your ten best and ten worst replies. Re-run it after every prompt change. If a tweak improves the bad ones but breaks the good ones, undo it. Persona work is small iteration, and a saved test set turns a feeling into a result. Use seed for repeatable comparisons while testing: the same seed with the same prompt gives comparable output, which makes before and after readable. Remove the seed in production if you want variety. See the docs for supported parameters.
What a day of chatting costs
With $0.15 per 1M input tokens and $0.50 per 1M output tokens, a persona message of 900 input tokens and 200 output tokens costs 900 / 1,000,000 x $0.15 = $0.000135 plus 200 / 1,000,000 x $0.50 = $0.0001, which is $0.000235. A thousand messages in a day come to $0.235. The $0.50 trial on a new account covers about 2,100 such messages (0.50 / 0.000235 = 2,127). See pricing, or read the alternatives guide for the wider picture.
