EN ▾
Get API key

Heretic LLMHeretic LLM for Roleplay: Settings and Tips

Heretic LLM for Roleplay: Settings and Tips

If you are looking at heretic llm for roleplay, the setup is short: point a roleplay front end or a small script at an OpenAI-compatible endpoint, write a firm character prompt, and keep sampling settings moderate. The model has no refusal filter for lawful adult fiction, so most of the quality comes from your prompt and your settings.

Updated

Stage with floating speech bubbles and masks lit by data streams, representing roleplay over a text API

Key points

  • Use the base URL https://api.hereticllm.com/v1 with model uncensored in any OpenAI-compatible roleplay client.
  • A short, firm system prompt and a stop sequence do more than long character cards.
  • The 100,000 token window is large, but summarizing old turns keeps cost and drift down.
  • Text only, for lawful adult fiction. Sexual content involving minors is never allowed.

What the API gives a roleplay setup

Roleplay is a long conversation with a consistent voice, and an API is a good fit for it. You send the whole chat each turn, the model writes the next reply, and you pay only for the tokens used. Heretic LLM runs one open-weight model that is tuned to answer without content refusals for lawful adult use. For fiction that means a villain can act like a villain and a dark plot does not get cut off by a lecture mid-scene. The model still follows your instructions, and it is only as good as the setup you give it.

It helps to be clear about what you are getting. The service is text only: no images, voice or video, so a companion app that wants portraits or speech needs a separate service for those parts. The context window is 100,000 tokens, shared by prompt and reply. There is no memory feature on the server. Each request is independent, so "memory" means whatever you put into the messages array.

There is also one rule that does not bend. Sexual content involving minors is never allowed. The best way to keep your own setup clean is to state in the system prompt that every character is an adult, as the example below does.

Connect a roleplay client

Most roleplay front ends accept an OpenAI-compatible endpoint, because the format became a common denominator. SillyTavern, for example, lets you add a custom OpenAI-compatible source. Whatever app you use, look for these three fields and fill them as follows:

  1. API base URL: https://api.hereticllm.com/v1. If the app appends /chat/completions itself, do not add it yourself.
  2. API key: the key from the API key page. New accounts can claim $0.50 of trial credit with one click, which is enough to test a character before paying anything.
  3. Model: type uncensored. If the app only offers a dropdown, look for a custom model field, or for a button that fetches models from GET /v1/models.

Use the chat completion mode of the app, not the older text completion mode, because the API speaks the messages format. Turn streaming on so replies appear word by word. In roleplay, reading while the text arrives feels much closer to talking with someone. Remember that a stream keeps one of your concurrency slots until it ends: 2 on a trial key, 8 on a full key. If you run several chats at once from one account, a ninth stream gets a 429 with the code concurrency.

A system prompt that holds a character

The system prompt does most of the work. Long character sheets with fifty traits tend to produce flat, over-explained replies. A short prompt with a clear voice, a situation, hard rules about format and a few concrete details works better. Here is a complete example for a science fiction scene:

You are Mara Venn, a salvage pilot in a rain-soaked orbital port city. Stay in character at all times.

Setting: the story is a slow-burn science fiction drama between adults. Mara is dry, guarded and quick with a joke. She has a debt to a dock boss named Orlek and a damaged ship called the Lantern.

Rules for the scene: write only Mara's actions, speech and thoughts, and never write the user's character. Use third person for actions and quotation marks for speech. Keep each reply between 80 and 180 words and end on something the user can answer. Do not summarize the scene or step out of the story unless the user writes OOC: first. All characters in the story are adults.

Look at what each part does. The first line fixes identity and tone. The setting paragraph gives the model things to act on: a debt, a boss, a damaged ship. Those are hooks that produce plot without your help. The rules block controls format, and the format rules matter most. Two of them solve the most common complaints in roleplay. "Write only Mara's actions" stops the model from speaking for you, and the word range stops replies from growing every turn until each one is an essay.

The out-of-character line, "unless the user writes OOC:", gives you an escape hatch. When you want to steer the story, write a line that starts with OOC: and say what you want, and the model drops the voice for one reply. Without that, steering messages tend to get answered in character, which can derail the scene.

Keep the system prompt at the start of the messages array every time, never in the middle. If you edit the character mid-story, change the system message and resend the full history so the new instructions apply from that point.

Sampling settings to start from

The API passes temperature, top_p, stop, seed and both penalty parameters through to the model. There are no magic values, but some starting points work for most characters and are easy to adjust.

SettingStart atChange it when
temperature0.8 to 0.9Replies feel flat (raise a little) or lose the thread and contradict earlier facts (lower)
top_p0.95Odd word choices appear (lower to 0.9)
frequency_penalty0.3The same phrases repeat across turns (raise slowly)
presence_penalty0.2The scene keeps circling the same topic
stopspeaker labelsThe model starts writing your lines
seedunsetYou want to compare two prompt versions on the same draw

Change one setting at a time and give each change several turns before you judge it, because a single reply tells you almost nothing. Stop sequences are the underrated tool here. If your chat format uses labels such as User: and the model sometimes continues past its own line into yours, adding that label to stop cuts the reply at the right place.

Leave max_tokens out unless you want a hard ceiling. The word range in the system prompt is a gentler way to control length, and a hard cut in the middle of a sentence is worse than a slightly long reply.

A small chat loop you can adapt

If you are building your own companion app or just want to test a character from the terminal, this loop is a complete starting point. It reads the character from a file, streams the reply, and sends only the last 40 messages so that very long chats stay manageable.

import os
from openai import OpenAI

client = OpenAI(base_url="https://api.hereticllm.com/v1", api_key=os.environ["HERETIC_API_KEY"])

SYSTEM = open("mara.txt", encoding="utf-8").read()
history = []

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

while True:
    turn(input("> "))

Save the system prompt from the previous section as mara.txt next to the script and run it. The stop sequence strings in the code use an escaped newline, so a reply ends if the model begins a new line with a speaker label. Keep your own input free of those labels to avoid confusion.

The trade-off in this version is that anything older than 40 messages is forgotten. For a short scene that is fine. For a story that runs for days, you want the next section.

Long stories, the 100k window and summaries

A window of 100,000 tokens is enough for a very long chat, and for many stories you can simply send everything and never trim. The catch is cost and attention. Every turn resends the whole history as input, so the price per reply grows as the chat grows, and models tend to pay less attention to details buried deep in a long prompt. A story that runs for hundreds of turns benefits from compaction.

The pattern is simple. Once the history passes a threshold, ask the model to summarize the oldest part into a short note of names, places, promises, injuries and open plot threads, then replace those messages with the note and keep the recent turns word for word. The function below does that with a second call at a lower temperature, which keeps the summary factual.

import os
from openai import OpenAI

client = OpenAI(base_url="https://api.hereticllm.com/v1", api_key=os.environ["HERETIC_API_KEY"])

def compact(history, keep_last=30):
    if len(history) <= keep_last + 10:
        return history
    old, recent = history[:-keep_last], history[-keep_last:]
    transcript = "\n".join(m["role"] + ": " + m["content"] for m in old)
    resp = client.chat.completions.create(
        model="uncensored",
        temperature=0.3,
        messages=[
            {"role": "system", "content": "Summarize this roleplay so far in under 300 words. "
             "Keep names, places, promises, injuries and open plot threads. Plain prose."},
            {"role": "user", "content": transcript},
        ],
    )
    note = "Story so far: " + resp.choices[0].message.content
    return [{"role": "user", "content": note}] + recent

Run compact before each turn and replace your history with the result. Read the summary now and then. If it dropped something that matters, such as an agreement between characters, add it to a pinned block that you keep in the system prompt. A short "facts that must stay true" list in the system message is the most reliable memory you have.

Cost stays modest either way. At $0.15 per 1M input tokens and $0.50 per 1M output tokens, a 50-turn scene with a short system prompt comes to under ten cents. The pricing page lists top-up amounts and bonuses, and the API documentation covers parameters in full.

Common problems and fixes

  • The model writes your character's actions. Add a rule against it in the system prompt, add a stop sequence for your speaker label, and make sure your own messages are clearly marked as coming from the user role.
  • Replies keep getting longer. Set a word range and repeat it at the end of the system prompt. Models copy the length of their own earlier replies, so edit a few long ones down in the history.
  • The character drifts out of voice. Lower temperature a little, shorten the history, and move the key traits to the end of the system prompt.
  • Repeated phrases. Raise frequency_penalty in small steps, or edit the repeated phrase out of earlier replies, since the model sees them as examples of what to write.
  • 429 errors during busy sessions. A 429 with concurrency means too many simultaneous requests, and rate_limited means too many per minute. Wait and retry. A 429 with a Retry-After: 5 header means temporary overload, and the same delay applies.

Failed or refused requests are not charged, and prompts are not used for training. If something behaves oddly, include the X-Request-Id response header when you write to support. For apps aimed at the public, state your own age rules and keep the adults-only line in every character prompt.

Questions and answers

Which model name do I enter in my roleplay app?

Enter uncensored as the model, with https://api.hereticllm.com/v1 as the base URL. If the app asks for a provider type, choose OpenAI-compatible or custom.

Does it remember characters between chats?

No. The server keeps no memory, so each request must contain the system prompt and the history you want the model to see. Summaries and a pinned facts list are how you carry a story forward.

Can it generate pictures or voice for my characters?

No. The API is text only, with no image, audio or video generation and no embeddings. Use a separate service for those parts.

How much does a long roleplay session cost?

A 50-turn session with a short prompt costs under ten cents at $0.15 per 1M input tokens and $0.50 per 1M output tokens. Longer chats cost more because history is resent each turn.

Is there any content the API will not write?

Yes. Sexual content involving minors is never allowed. Outside that, the model is tuned to answer without content refusals for lawful adult use.

Your key is one form away

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

Get API keyRead the docs