EN ▾
Get API key

nsfwllms.comGuide

LLM Roleplay Prompts That Keep Characters Consistent

If you search for llm roleplay prompts reddit threads, you find hundreds of long prompts and little explanation of why any work. The patterns below are the ones that matter: a persona block, a scene block, rules for style, and a memory summary you update as the story goes.

Updated

Key points

  1. Split the prompt into persona, scene, style rules and memory instead of one wall of text.
  2. Put fixed facts in the system message and resend them every turn.
  3. Summarize old turns into a short memory block so the character stays consistent.
  4. All characters are adults; the API has a hard no-minors rule.
Three theatrical masks linked to glowing chat bubbles on a spotlit stage, representing consistent roleplay characters
Glowing scroll passing through a frame, with older blocks fading out, illustrating a context window

Why most shared prompts fail

Communities share roleplay prompts all the time, and many of them work for a day and then drift. The usual faults are the same. The prompt is a long block of adjectives about the character with nothing about how to speak. It tells the model what not to do, not what to do. Or it never says what the model should do when the user steers the scene somewhere new.

A model has no memory between requests. Every call, you send the whole conversation again, and the model reads it from the top. Consistency therefore comes from what you put in that text and how you keep it short enough to stay in the context window. Treat a roleplay prompt as a small document with parts, not a spell. When a thread's prompt works, take it apart and see which of the four parts below it supplies, then fill in the parts it skips.

The four-part structure

PartWhat goes in itChanges how often
PersonaName, age (adult), background, goals, how they speak, habitsNever, or rarely
SceneWhere we are, who is present, time, mood, current objectiveWhen the story moves
Style rulesPoint of view, tense, length, formatting, what the model must not doNever
MemoryA short summary of past events and promises madeEvery few turns

Keep the first and third parts in the system message. Update the second and fourth between turns. This split matters because the fixed parts are what keep the voice steady, and the changing parts are what give the model something new to react to.

A persona that holds up

Write the persona as behaviour. Compare "Mara is sarcastic and mysterious" with "Mara answers questions with a question when she is uneasy, never gives her full name to strangers, and speaks in short sentences. She was a ship's navigator and still thinks in compass bearings." The second gives the model concrete moves it can repeat. Include two or three sample lines of dialogue in her voice. Models copy examples closely, and a few lines do more than a paragraph of description.

Always state that characters are adults. This service has one hard limit that no setting changes: no sexual content involving minors. Keep your prompts within lawful adult use, and treat fiction as fiction.

Scene and style rules

The scene block answers: where are we and what is happening right now? Two or three sentences are enough. "Night, a rain-soaked harbour. Mara waits on a pier for a contact who is late. She suspects a trap." When the story changes location, rewrite this block instead of adding to it, so old details do not pile up.

Style rules work best as short positive instructions:

  • Write in third person, past tense.
  • Reply in 120 to 200 words.
  • Never speak or act for the user's character.
  • End on an open moment the user can respond to.
  • Stay in character; do not mention being an AI unless the user steps out of the story with a marked out-of-character note.

The "never act for the user" rule is the one that most improves a shared scene, and the length rule keeps costs predictable. If you want the bot to use tools, such as a dice roller or a notes lookup, read function calling with LLMs for the pattern.

Sending it through the API

The API is OpenAI-compatible, so any SDK works with the base URL below and the model uncensored. Build the system message from your parts, then add the chat history.

from openai import OpenAI

client = OpenAI(base_url="https://api.nsfwllms.com/v1", api_key="sk-your-key")

PERSONA = ("Mara Voss, 34, former ship's navigator turned smuggler. Wary, dry humour. "
           "Answers with a question when uneasy. Short sentences. Thinks in compass bearings. "
           "Sample line: 'North of here? Depends who is asking.'")
STYLE = ("Third person, past tense. 120-200 words. Never speak or act for the user. "
         "End on a moment the user can respond to. Stay in character.")

def build_system(scene, memory):
    return f"{PERSONA}\n\nRules:\n{STYLE}\n\nScene: {scene}\n\nStory so far: {memory}"

history = []
def turn(user_text, scene, memory):
    history.append({"role": "user", "content": user_text})
    resp = client.chat.completions.create(
        model="uncensored",
        temperature=0.9,
        messages=[{"role": "system", "content": build_system(scene, memory)}] + history,
    )
    reply = resp.choices[0].message.content
    history.append({"role": "assistant", "content": reply})
    return reply

print(turn("I step onto the pier and wave.", "Night, rain-soaked harbour pier.", "Mara suspects a trap."))

Temperature, top_p, stop, seed and the penalties are passed through. For creative scenes, a temperature around 0.8 to 1.0 usually gives variety. If the character repeats phrases, try a small frequency or presence penalty. See the docs for the full list.

Memory without blowing the context window

The window is 100,000 tokens for prompt and completion together, which fits a very long story. But sending everything every turn costs more and can bury important facts in the middle. A rolling summary solves both problems. Every 10 or 15 turns, ask the model to condense the oldest turns into a short list of events, relationships and promises, then drop those turns from the history.

def summarize(old_turns, previous_memory):
    text = "\n".join(f"{m['role']}: {m['content']}" for m in old_turns)
    resp = client.chat.completions.create(
        model="uncensored",
        temperature=0.2,
        messages=[{"role": "user", "content":
            "Update this story memory in under 150 words. Keep names, places, "
            "promises and unresolved threads.\n\nMemory:\n" + previous_memory +
            "\n\nNew events:\n" + text}],
    )
    return resp.choices[0].message.content

Keep the last six to eight turns verbatim so the tone carries over. For more on sizing the window, read context window for LLMs.

What it costs to run

Roleplay is cheap per message. Prices are $0.15 per 1M input tokens and $0.50 per 1M output tokens. Take a turn with 3,000 input tokens (persona, rules, summary and recent turns) and 250 output tokens:

  • Input: 3,000 x 0.15 / 1,000,000 = $0.00045
  • Output: 250 x 0.50 / 1,000,000 = $0.000125
  • Total: $0.000575 per turn, so 100 turns cost $0.0575

New accounts can claim a $0.50 trial with one click, valid 7 days, with no payment needed. After that you top up with crypto (USDT on TRC20 or USDC on Base) from $20; the pricing page lists the bonuses. Get a key on the API key page. The NSFW LLM online page explains what the service is and how it handles lawful adult fiction.

Questions and answers

How long should a roleplay system prompt be?

Long enough to define voice, scene and rules, usually 200 to 500 words. Longer prompts cost more on every turn and often add contradictions.

Why does the character forget details?

The model only sees what you send. Keep key facts in a memory block and resend it each turn, instead of relying on older messages.

Can I use these prompts with other front ends?

Yes. Any app that accepts an OpenAI-compatible endpoint can use the same base URL, key and model name.

Are there content limits?

The model is tuned to answer without content refusals for lawful adult use. Sexual content involving minors is never allowed.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key