#DreamGen
DreamGen is an app and an API for AI-powered creative writing. They have a free tier, as well as a paid subscription that allows unlimited monthly access to their high-quality in-house text generation models made specifically for the purpose of steerable AI-assisted writing. Create an account to get started: https://dreamgen.com/.
The (free) credits reset at the start of each calendar month. See pricing to see the credit cost for each model and usage to see your remaining credits.
#Connecting to DreamGen
#Get API Key
Go to the DreamGen API keys page and click the "New API Key" button. Make sure the API Key is copied into your clipboard.


#Connect
- Go to the SillyTavern connection settings.
- Select API: Text Completion
- Select API Type: DreamGen
- Enter the API key
- (optional) Pick a model

#Models
DreamGen offers opus-v1-sm
, opus-v1-lg
, and opus-v1-xl
. The larger the model, the better it will be at following instructions and writing good stories.
#Formatting Settings
The DreamGen models expect a specific input format, which is documented here.
SillyTavern comes with built-in presets made for DreamGen. Make sure to use these settings as your baseline. These settings try to stick to the DreamGen format as closely as possible but due to the irregular formatting of character cards, it is not always perfect.
- Go to the "Advanced Formatting" page.
- Under "Context Template" pick
DreamGen Role-Play V1 Llama3 / ChatML
depending on the model (*). - Enable "Instruct Mode".
- Under "Instruct Mode Presets" pick
DreamGen Role-Play V1 Llama3 / ChatML
.


(*) When to use Llama 3 and when to use ChatML? As of 2024/06/17, opus-v1-sm
is ChatML
and all other models are Llama3
based. When running local models, the template will be indicated in the model's HuggingFace card.
#Completion Settings
DreamGen supports:
- "Temperature", "Top P", "Top K" and "Min P"
- "Presence Penalty", "Frequency Penalty" and "Repetition Penalty" (without range)
- "Min Length" -- lets you force the model to generate at least
min(min_length, max_tokens)
tokens
Good starting values might be:
- Min P: 0.05
- Temperature: 0.8
- Repetition Penalty: 1.1
#Tips for Formatting
The DreamGen models differ from the regular instruction-following models like OpenAI's ChatGPT.
The models were fine-tuned for the task of writing a story based on the provided description which typically consists of plot description, style description, characters, locations, lore, etc. The models can also be steered in the middle of the story, making you the director, telling the characters what they should do or how the plot should unfold.
A well-formatted system prompt message would look like this:
Note that the prompt should be a description of the story, rather than instructions or directives on how the story should be written. Avoid using phrases like:
- "Write the story as if..."
- "Make sure to..."
- etc.
See more examples of what the plot, style and character descriptions should look like.
The default "DreamGen Role-Play V1" template substitutes the different sections as follows:
## Plot description:
will consist of{{scenario}}
and{{wiBefore}}
.## Style description:
is not provided, you should either add it to the system prompt under Advanced Settings, or to the character cards, at the end of{{scenario}}
. This section is useful to influence the narrative style (first, second, third person), the tense (past, present), the level of detail and verbosity, etc.## Characters:
will have a{{char}}
character with description consisting of{{description}}
and{{personality}}
and a{{user}}
character with description consisting of{{persona}}
.
#Message Examples and Initial Message
The DreamGen models are very responsive to the context -- they will largely stick to the writing style (and facts) presented in the previous conversation turns. This makes the message examples and the initial message very important.
#Formatting Message Examples
The {{mesExamples}}
are appended at the end of the system prompt. To take full advantage of the instruct formatting, make sure that your examples are separated with the <START>
separator. For example:
#Examples
Here are a couple of example cards, adapted for DreamGen, that take into account the unique prompting. These cards also leverage the {{mesExamples}}
as described above.
#Seraphina
This is an edit of the popular Seraphina card that's built into SillyTavern by default.
#Lara Lightland
This is an edit of the Lara Lightland card by Deffcolony.
#FAQ
#What sampler settings should I use?
You can start with these:
- Temperature: 1.0
- MinP: 0.05
- Presence Penalty: 0.1
- Frequency Penalty: 0.1
#How can I make the responses longer or shorter?
You have several options:
- Change or add the
## Style description:
in the system prompt or model card. You can try adding something like "Sentences are generally long, and the narrative describes the setting in painstaking detail." - Change the
Min Length
in the Completion Settings. - Add
Last Output Sequence
similar to the following in the Advanced Formatting settings under Instruct Mode:
Here's an example of the Last Output Sequence
that might help make the model respond in a more verbose way, using the Llama 3 template:
The same expressed using the ChatML template:
You can change the text within to something more suitable for your scenario or context.
#How can I stop the model from repeating itself?
If the model repeats what's in the context, you can try increasing "Repetition Penalty" in the Completion Settings or you can try rephrasing the part of the context that's getting repeated. If the model repeats itself within one message, you can try increasing "Presence Penalty" or "Frequency Penalty".
#How can I steer the story?
If you want to direct the characters to do something, or to steer the plot in certain direction, you can use the user
role (that is the <|im_start|>user
preamble).
At this point, this functionality is not neatly integrated into SillyTavern natively, but you can use the Last Output Sequence
as described above to insert the user
(instruction) turn. See examples of what the instructions should look here.