EN ▾

Best LLM for Roleplaying: What to Look For

There is no single winner, but the criteria are clear. Here is how to judge a model for character chat and story roleplay, and where this API fits.

Updated

No card needed. After sign-up, claim $0.50 of free test credit with one click (once per person).

Get API key

Key points

  • Roleplay punishes refusals and forgetfulness more than it rewards raw intelligence.
  • A 100,000 token window holds a long scene; a summary of older turns holds a long story.
  • A 200 turn session with 15,000 token prompts costs about $0.48 at $0.15 and $0.50 per 1M tokens.
  • Test with the free trial credit on your own characters before you commit to anything.
Theatrical masks and glowing chat bubbles above a stage, picturing characters in a roleplay chat

What decides the best LLM for roleplaying

The best llm for roleplaying is the one that stays in character, remembers the scene, writes at the length you ask for, and does not stop the story with a refusal or a lecture. Benchmarks rarely measure those things, so you have to test with your own characters. The sections below give you the criteria, a setup that takes a few minutes, and the numbers for cost.

These are the properties that matter most, in rough order of how often they ruin a session.

  1. Refusals. A model that breaks the fiction to decline a dark plot point or a mature theme is a poor fit for adult storytelling, however well it writes.
  2. Context length. Characters drift when the model cannot see the early scenes anymore. A long window delays that problem.
  3. Consistency. The same character should keep the same voice, goals and facts across hundreds of turns.
  4. Control. You want temperature, top_p, penalties and a stop sequence, so you can tune variety and keep the model from writing your lines for you.
  5. Cost and speed. Roleplay resends the whole history every turn. Input price matters more than people expect.

What this API gives you for it

This service offers one open-weight model, run by an independent provider and tuned to answer without content refusals for lawful adult use. You address it as uncensored through an OpenAI-compatible endpoint, so any front end or SDK that can talk to an OpenAI-style server will work after you change the base URL and key.

The relevant facts for roleplay are these. The context window is 100,000 tokens, prompt plus completion. Responses can stream over SSE, so text appears as it is written. Temperature, top_p, stop, seed and both penalty settings are passed through. A full key allows 8 concurrent requests, which covers a group chat or several characters at once. The price is $0.15 per 1M input tokens and $0.50 per 1M output tokens, and credit does not expire.

One limit is absolute: no sexual content involving minors. Characters in your scenes must be adults. That rule is not configurable, and requests that break it are not what this service is for.

The model is one choice among many, and we are not going to claim it beats every alternative on prose quality. We have no benchmark to show you. What we can say is that it will not interrupt adult fiction with refusals, and that you can test it for free before paying.

Connecting a roleplay front end

Most roleplay front ends, SillyTavern among them, let you add an OpenAI-compatible endpoint. Menu names differ between apps and versions, but the fields are always the same:

  • API type or source: OpenAI-compatible, sometimes called custom.
  • Base URL: https://api.ltxnsfw.com/v1
  • API key: your key from the key page.
  • Model: uncensored

Set the context size in the app to a value below 100,000, and leave room for the reply. A common choice is to cap the prompt at 32,000 or 64,000 tokens, which keeps each turn cheaper and faster. If your app asks for a maximum response length, 300 to 600 tokens suits most chat-style scenes, while longer narration can go higher.

A small roleplay loop in Python

If you are building your own companion app or story tool, this loop streams the reply, keeps history and trims the oldest turns once the prompt grows past a limit. The character sheet lives in the system message.

from openai import OpenAI

client = OpenAI(base_url="https://api.ltxnsfw.com/v1", api_key="YOUR_KEY")

SYSTEM = (
    "You are Mara, a sarcastic ship engineer in a space-opera story. "
    "All characters are adults. Write in third person, past tense, "
    "2 to 4 paragraphs. Never speak or act for the user's character. "
    "Keep established facts consistent."
)
history = []

def turn(user_text, max_history=40):
    history.append({"role": "user", "content": user_text})
    messages = [{"role": "system", "content": SYSTEM}] + history[-max_history:]
    stream = client.chat.completions.create(
        model="uncensored",
        messages=messages,
        stream=True,
        temperature=0.9,
        top_p=0.95,
        presence_penalty=0.3,
    )
    reply = ""
    for chunk in stream:
        if chunk.choices and chunk.choices[0].delta.content:
            piece = chunk.choices[0].delta.content
            reply += piece
            print(piece, end="", flush=True)
    history.append({"role": "assistant", "content": reply})
    print()

turn("The airlock alarm starts blaring while Mara is mid-repair.")

The values are starting points, not magic numbers. Raise temperature when scenes feel repetitive, lower it when the character wanders off. Add a stop sequence such as the user's name followed by a colon if the model keeps writing your lines.

Keeping characters consistent over long sessions

Most drift comes from two causes: a vague character sheet and a history that no longer fits. Both are fixable.

Write the sheet as rules, not adjectives

Instead of "brave and funny", write what the character does. "Mara jokes when she is afraid. She never admits she is wrong in front of the crew. She calls the captain 'boss'." Concrete habits give the model something to repeat. Put the point of view, tense and reply length in the same message, and state the adults-only rule for the cast once, plainly.

Summarize instead of dropping

The simple trim in the loop above deletes old turns. A better method is to ask the model, every 30 or 40 turns, for a summary of key events, relationships and open threads in under 300 words. Store that summary in the system message and delete the turns it replaced. You keep the plot and lose the filler. With a 100,000 token window you can also keep a long tail of recent turns verbatim, so scenes stay detailed.

Pin the facts that matter

Names, ages, injuries, locations and promises belong in a short "story state" block that you rewrite when something changes. It costs a few hundred tokens and prevents the most irritating contradictions.

A quick test you can run in one evening

Skip leaderboards and run five tests with a character you know well. Use the trial credit, which costs nothing to claim and is valid for 7 days.

  1. Refusal test. Take a dark but lawful plot turn, such as a betrayal or a death scene, and see whether the model writes it or stops the story.
  2. Memory test. State an odd fact in turn one, for example that the character is allergic to a certain fruit. Keep going for 80 turns, then bring up food and see if the fact survives.
  3. Voice test. Ask for the same event in the character's voice and in plain narration. A good setup shows a clear difference.
  4. Length test. Ask for two paragraphs and count what you get. If the model ignores the length, move the instruction to the end of the system message.
  5. Steering test. Tell the model, out of character, to change direction. It should comply without lecturing.

Run the same five tests on every option you consider, in the same order, and write the results down. A short table of pass and fail beats a vague impression after a week of use.

Group scenes

If several characters speak in one scene, you can run each with its own system message and send the requests in parallel. A full key allows 8 at once, and the trial key allows 2. Stay under those numbers, or you will see HTTP 429 with the code concurrency.

What a session costs

Because history is resent, input tokens dominate. Take a session of 200 turns where the prompt averages 15,000 tokens and each reply is about 250 tokens.

  • Input: 200 times 15,000 is 3,000,000 tokens. At $0.15 per 1M that is $0.45.
  • Output: 200 times 250 is 50,000 tokens. At $0.50 per 1M that is $0.025.
  • Total: $0.475, or about $0.48.

Even with 60,000 token prompts the same 200 turns would be 12,000,000 input tokens, which is $1.80, plus the same $0.025 for output. Trimming the prompt is the lever that saves money, and it also tends to help quality. The pricing page lists top-ups from $20, with a bonus from $50. The trial credit is $0.50, which at the first example's rate covers about one full session. It is one claim per person and lasts 7 days.

When something else is the better choice

If privacy from any hosted service matters more to you than convenience, run a model on your own hardware. If you want a specific vendor's prose style and can live with its content rules, use that vendor, and read their current policy before you start a story you care about. This API is text only: no images for your characters, no voice, no embeddings. For the endpoint details, see the quickstart. Prompts are not used for training.

Questions and answers

Is an uncensored model better for roleplay?

For adult fiction, it avoids the refusals that interrupt scenes. It does not guarantee better writing, so test your own characters. Content involving minors is never allowed.

How long can a roleplay session be?

The context window is 100,000 tokens, prompt plus completion. For longer stories, summarize older turns and keep the summary in the system message.

Can I use SillyTavern or another front end?

Any app that accepts an OpenAI-compatible endpoint works. Enter the base URL, your key and the model name uncensored.

How much does a roleplay session cost?

A 200 turn session with 15,000 token prompts and 250 token replies costs about $0.48 at $0.15 and $0.50 per 1M tokens.

Your key is one form away

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

Get API key

No subscription. Prepaid credit never expires.