Opus V1

This is a guide describing the inner workings and usage of the Opus V1 models. Refer to the dedicated guides on how to use the DreamGen platform for story-writing and role-playing.

For personal use, the models can be downloaded from HuggingFace.

This guide will explain how to prompt the Opus V1 models.

Throughout the guide, the prompt examples will use {{...}} to denote placeholders that should be replaced with actual content before sending the prompt to the model.

Prompting, or prompt engineering, is the process of crafting the input to the model in order to get the desired output. To prompt well, you need to understand how the model was trained.

The Opus V1 models were primarily trained for steerable story-writing, role-play, but they can also help with writing related tasks, as well as perform assistant-like functions.

ChatML+Text

The Opus V1 models are trained with the ChatML prompt format, with a few extensions.

The basic ChatML format looks like this:

<|im_start|>{{role[0]}}
{{content[0]}}<|im_end|>
<|im_start|>{{role[1]}}
{{content[1]}}<|im_end|>
<|im_start|>{{role[2]}}
{{content[2]}}<|im_end|>

Where the role is one of system, user, or assistant and where role[0] is always system.

The Opus V1 extension is the addition of the text role, and the addition / modification of role names.

Here's a basic example:

<|im_start|>system
Lorem ispum<|im_end|>
<|im_start|>user
Dolor sit amet<|im_end|>
<|im_start|>text
Ut enim ad minim veniam<|im_end|>

Here's an example with names:

<|im_start|>system
Lorem ispum<|im_end|>
<|im_start|>user
Dolor sit amet<|im_end|>
<|im_start|>text names= Alice
Ut enim ad minim veniam<|im_end|>
<|im_start|>text names= Bob
Duis aute irure dolor in reprehenderit<|im_end|>
<|im_start|>user
Tellus at urna condimentum mattis pellentesque<|im_end|>
<|im_start|>text names= Alice; Bob
Semper viverra nam libero justo laoreet sit amet cursus sit<|im_end|>

Pay attention to the following:

  • There can be multiple subsequent message with a text role, especially if names are involved.
  • There can be multiple names attached to a message.
  • The format for names is names= {{name[0]}}; {{name[1]}}, beware of the spaces after names= and after the ;. This spacing leads to most natural tokenization for the names.

Opus V1 Applications

Story-writing

You can write stories using Opus V1 in our dedicated story-writing interface or in the sandbox.

story setting

The basic template for story writing looks like this, where the various {{placholder}} values should be replaced with the actual content before sending the prompt to the model:

<|im_start|>system
You are an intelligent, skilled, versatile writer.

Your task is to write a story based on the information below.

## Overall plot description:

{{plot_description}}

## Characters:

### {{characters[0].name}}

{{characters[0].description}}

### {{characters[1].name}}

{{characters[1].description}}<|im_end|>
<|im_start|>user
{{instruction[0]}}<|im_end|>
<|im_start|>text
{{story_text[0]}}<|im_end|>
<|im_start|>user
{{instruction[1]}}<|im_end|>
<|im_start|>text
{{story_text[1]}}<|im_end|>

The template may contain more information, such as the style description, summary of previous, current and next chapters, and more. For example:

<|im_start|>system
You are an intelligent, skilled, versatile writer.

Your task is to write the chapter 4 and chapter 5 of the story based on the information below.

## Overall plot description:

{{plot_description}}

## Style description:

{{style_description}}

## Characters:

### {{characters[0].name}}

{{characters[0].description}}

### {{characters[1].name}}

{{characters[1].description}}<|im_end|>
<|im_start|>user
{{instruction[0]}}<|im_end|>
<|im_start|>text
{{story_text[0]}}<|im_end|>
<|im_start|>user
{{instruction[1]}}<|im_end|>
<|im_start|>text
{{story_text[1]}}<|im_end|>

## Summary of previous chapters:

### Chapter 2

{{chapter[1].description}}

### Chapter 3

{{chapter[2].description}}

## Summary of the chapters that you should write:

### Chapter 4

{{chapter[3].description}}

### Chapter 5

{{chapter[4].description}}

## Summary of next chapters:

### Chapter 6

{{chapter[5].description}}

Concretely, this is what the input to the model could look like, after you have filled in the placeholders. This example also show-cases the role-playing format by using the names= syntax:

<|im_start|>system
You are an intelligent, skilled, versatile writer.

Your task is to write a story based on the information below.

## Overall plot description:

In a world where magic is fading, a young mage named Elara embarks on a perilous journey to the Enchanted Forest. There, she hopes to uncover ancient secrets and restore magic to the land, battling dangerous creatures and facing personal trials along the way.

As Elara and Caelan traverse treacherous terrains, face mythical creatures, and unravel the mysteries of the Enchanted Forest, their relationship grows stronger, and they discover the true extent of their own powers. Along the way, they encounter allies and enemies, unearthing the dark forces responsible for the decline of magic. Their ultimate goal is to unlock the ancient magic that lies within the heart of the forest, revitalizing the world and fulfilling their destiny as true protectors of magic.

## Characters:

### Elara

Elara is the protagonist and young mage. Elara is 23 years old. She is a determined and compassionate young woman with a natural affinity for magic. She possesses an insatiable thirst for knowledge and a strong belief in the power of magic to bring harmony to the world. Elara is skilled in elemental magic and possesses a rare talent for communing with mythical creatures, which becomes essential on her journey to the Enchanted Forest.

### Caelan

Caelan is Elara's loyal companion and protector. He is a seasoned warrior with a heart of gold. He is known for his exceptional combat skills and unyielding bravery. Caelan has a tragic past intertwined with the loss of his family to a malevolent darkness, fueling his desire to protect others from a similar fate. Despite his initial skepticism towards magic, he develops a deep bond with Elara and becomes her trusted confidante and guardian on their quest. Caelan's unwavering loyalty and formidable swordsmanship prove invaluable throughout their journey.<|im_end|>
<|im_start|>user
In a serene clearing, Elara, a young mage, performs a powerful ritual, awakening the dormant magic in the Enchanted Forest. Vibrant bursts of energy transform the vegetation, filling the air with wonder. Unbeknownst to Elara, a mysterious figure watches from the shadows, setting the stage for an extraordinary adventure that will unravel secrets and determine the fate of the realms.<|im_end|>
<|im_start|>text
The Enchanted Forest was once a place of magic and wonder, filled with mythical creatures and the most powerful spells known to man. But now, it was a shadow of its former self. The trees were barren, the air was still, and the creatures that once thrived here had all but vanished.

But there was hope. A young mage named Elara had discovered a hidden chamber deep within the forest, filled with ancient artifacts and forgotten knowledge. She had spent months studying these relics, learning their secrets and unlocking their power. And now, on this fateful day, she was ready to perform a powerful ritual that would awaken the dormant magic of the Enchanted Forest.<|im_end|>
<|im_start|>text names= Elara
In the waning light of dusk, Elara stood in the quiet heart of Aylesford, her focus intent upon the ancient runes etched into the earth before her. The air, usually thrumming with the unspoken words of magic, lay heavy and still around her. Each gesture and incantation, practiced countless times, faltered, as if the very essence of magic was slipping through her fingers like grains of sand.<|im_end|>
<|im_start|>text names= Caelan
Caelan watched from a distance, his brow furrowed in concern. As the shadows grew longer, he approached, his steps soft upon the grass. "Elara," he began, his voice low, "There are whispers on the wind, tales from far-off lands. They speak of magic waning, of spells unspun and charms undone."<|im_end|>
<|im_start|>text names= Elara
Elara turned, her eyes wide with fear. “What do you mean?” Her voice trembled with uncertainty, a stark contrast to the confidence that usually filled her being when she cast spells.<|im_end|>

Plot description

This should contain a brief summary of the story's plot. It can be as vague or as detailed as you want it. Here are a few examples:

Kate is taken on a journey through her past by Death, who offers her a chance to extend her life if she helps him end the unnatural existence of a child kept alive by magic.
Lara, a survivor of an apocalyptic fungal catastrophe, finds a genie's bottle and releases Jalil, who grants her three wishes. Through their conversations, Lara learns about past apocalypses caused by wish-related consequences. She carefully wishes for the prevention of future disasters and the restoration of the world, reuniting with her friend Anna.
Karra, a college student, discovers her ability to shape people's futures through tarot cards. Initially using this power to grant her friends' wishes, she eventually meets Lola, an aspiring actress. As they grow closer, Karra secretly manipulates Lola's fortunes, ensuring her success and their relationship. However, as Lola's career takes off, Karra struggles with the consequences of her actions and grapples with the boundaries of her power. Ultimately, she decides to let go and allow Lola's future to unfold naturally, saying goodbye to their entwined destinies.
- Genre: Erotic fiction with exhibitionist themes.
- Young woman engages in exhibitionist behavior with a delivery driver in exchange for free food.
- The story blends elements of erotica with a slice-of-life narrative.
- The protagonist, a 20-year-old college student, receives repeated deliveries from the same driver.
- Initial encounters are casual, but the driver leaves a flirtatious note sparking a text conversation.
- Revealed during texting, the driver appreciates the protagonist's feet, beginning their mutual indulgence in fetishistic behavior.
- The driver, Robert, offers free food as gratitude, leading the protagonist to escalate exhibitionism as compensation.
- Their interactions intensify through text, where Robert expresses his arousal and desires openly.
- The relationship advances as the protagonist...

Style description

This can be anything from the narrator's point of view, the tone of the story to the language used. Here are some examples.

The story employs a first-person narrative with a conversational, often colloquial tone. Sentences are generally short and direct, contributing to the fast-paced and suspenseful atmosphere. The author frequently uses vivid and visceral imagery to depict the horrors the characters encounter.
The narrative is vivid, urgent, and intensely sensual, with a strong emphasis on internal conflict and raw emotion conveyed from a first-person point of view. The language is explicit, evoking intense imagery and indulging in the erotic exploration of the characters' passionate encounters. The tone varies from frustrated cynicism to deep yearning, reflecting the protagonist's inner turmoil and growth. Direct and unapologetic, the story's pacing is rapid, ramping up the tension and the stakes quickly, pulling readers into the ever-deepening relationship between Edison and Blessing.
The story is written with a haunting and visceral prose that immerses readers in a surreal world blending horror with feminist themes. Told through an omniscient third-person narrator, the dark tone is complemented by sharp dialogue that gives voice to each character’s unique perspective. The narrative weaves through various timelines, revealing each girl's past and present struggles in an oppressive system. The language is both evocative and efficient, with sentences that balance emotional weight and a swift pace, driving the plot towards its revolutionary climax.

Character description

This should contain a brief description of the character. You may want to include some or all of these aspects:

  • Physical appearance
  • Behavioral patterns
  • Gender and sexual orientation
  • Relationships with other characters
  • Likes and dislikes

Here are a few examples:

Olivia is Henry's mother and Liam's wife. She is an African-American woman from Chicago who is strong-willed and independent. She is fiercely loyal to her family and is devastated by the loss of her husband. She is also a skilled healer and cook.
Lucifer, the red-skinned, horned demon, is the embodiment of fallen grace. Wrestling with his notorious heritage and a newfound desire for love, his complex nature ferments with vulnerability. His character oscillates between hedonism and self-reflection, hungering for acceptance by Mia and the librarian. Embracing his mortal love, he yearns for transformation, embodying the notion that even the damned may seek solace in love's redemption.
- Physical appearance: Described as a not-quite-handsome man with a pleasant face and a bald head.
- Behavioral patterns: Competent and lucky, with a talent for avoiding mistakes and compartmentalizing his life. He is a considerate church-going person.
- Speech patterns and mannerisms: Highly articulate and eloquent, but always to the point.
- Interpersonal dynamics: Has an ambitious wife and three children.
- Gender and sexual orientation: Heterosexual.
- Preferences and dislikes: Avoids controversy at all costs. Uninterested in big ideas.
- Defining characteristics: Skilled politician known for his competence and luck.

Steering the plot

As you may have noticed above, you can interleave text and user roles in the prompt. The user role represents what we refer to as 'instructions'.

Instructions tell the model how the story should continue, typically describing the events of the next few paragraphs. While providing an instruction, you can specify the length of the text over which the instructions should unfold, and the characters that should be involved in the plot.

The model was specifically trained with different instruction formats to be more forgiving and flexible.

Here are some examples:

Steer the subsequent 400 words based on the following instructions:

Legolas expresses his insecurities about his appearance, believing he is not pretty. Gimli reassures him, pointing out the beauty in Legolas' strength and actions. Gimli then describes the beauty in Legolas' intimate features, leading to a passionate moment between them.
Write the next 2 paragraphs, advancing the plot as follows:

- Jesse meets Jane and is taken aback by her beauty but hesitates over a possible misunderstanding.
- Jane clarifies her intentions, revealing protective gear meant for confronting the dragon.
Jon confesses to Daenerys about his past love for a Wildling woman, but clarifies that she wasn't his wife.
Speaker: Amelia
Plot: Amelia offers the protagonist a drink and heads to the kitchen.
Length: 100 words
Characters: Jordan
Plot:
Jordan admires Luna's painting and leans in for a kiss.

When specifying length in words, it's best to round the number to the nearest 5. Do not expect the model to be precise.

When specifying characters, you can use either `Characters:` or `Speaker:`, the latter hints that the text should contain a direct speech by the character.

Role-playing

You can write stories using Opus V1 in our dedicated role-playing interface.

story setting

Everything that applies to story-writing, also applies to role-playing. The only difference is in the system prompt, and in the text messages, which may include names= in the role-playing setup.

Just change "story" for "role-play" in the system prompt, and you're good to go.

<|im_start|>system
You are an intelligent, skilled, versatile writer.

Your task is to write a role-play based on the information below.

Similary for a multi-chapter setup:

<|im_start|>system
You are an intelligent, skilled, versatile writer.

Your task is to write the chapter 4 and chapter 5 of the role-play based on the information below.

It's also recommended to kick-start the story with a few text messages (with names=), to make sure the model sticks to the role-playing format.

As mentioned before, the model will generate possibly multiple text messages after each other, representing the 'turns' of the role-play.

Keep in mind that not all text messages will necessarily have names=. If you want all messages to have names (and this not have any purely narrative text messages), you can achieve that by forcing the logits using you favorite inference server.

Writing assitance

Secondary goal when designing the Opus V1 models was to offer support for commonly encountered writing tasks.

Expanding story description into chapter descriptions

Try a live demo
  • Input: A brief plot description and the desired number of chapters.
  • Output: A description for each chapter.

This can be great for brainstorming, or for planning a story.

Use the following prompt template:

<|im_start|>system
You are an intelligent, knowledgeable, helpful, general-purpose assistant.

You will be given a story description.

Your task is to break down the story into 5 chapters and write a summary for each chapter.

Format your output like this:

"""

## Chapters:

### Chapter 1

(Summary of chapter 1)

### Chapter 2

(Summary of chapter 2)

...
"""<|im_end|>
<|im_start|>user

## Overall plot description:

{{plot_description}}

## Characters:

### {{characters[0].name}}

{{characters[0].description}}

### {{characters[1].name}}

{{characters[1].description}}<|im_end|>

Describing (summarizing) a story plot

Try a live demo
  • Input: A story, or a few chapters of a story.
  • Output: A description of the story or chapters.

This can be great for summarizing a story or chapters, letting you compress the prompt.

Use the following prompt:

<|im_start|>system
You are an intelligent, knowledgeable, helpful, general-purpose assistant.

You are given a story and will be asked to perform various tasks with it. Respond without any additional fluff.

The story:

"""
{{story}}
"""<|im_end|>
<|im_start|>user
Summarize the overall story in roughly {{word_count}} words.<|im_end|>

Describing (summarizing) a story style

Try a live demo
  • Input: A story, or a few chapters of a story.
  • Output: A description the style of the story.

Use the following prompt:

<|im_start|>system
You are an intelligent, knowledgeable, helpful, general-purpose assistant.

You are given a story and will be asked to perform various tasks with it. Respond without any additional fluff.

The story:

"""
{{story}}
"""<|im_end|>
<|im_start|>user
Describe the writing style of the overall story.<|im_end|>

Describing a character

Try a live demo
  • Input: A story, or a few chapters of a story, set of characters.
  • Output: A description of the characters.

Use the following prompt:

<|im_start|>system
You are an intelligent, knowledgeable, helpful, general-purpose assistant.

You are given a story and will be asked to perform various tasks with it. Respond without any additional fluff.

The story:

"""
{{story}}
"""<|im_end|>
<|im_start|>user
Describe the character of {{character_name}} in roughly {{word_count}} words.<|im_end|>

Describing story segments

Try a live demo
  • Input: A story with marked segments.
  • Output: A description of the segments.

Use the following prompt:

<|im_start|>system
You are an intelligent, knowledgeable, helpful, general-purpose assistant.

You will be given a narrative.

Your task is to describe each segment of the narrative as well as the overall narrative.

The narrative is provided in the following format:

"""


(Segment content)


(Segment content)

...
"""

Format your output like this:

"""


(Your description of the segment)


(Your description of the segment)

...


(Your overall description of the narrative)
"""

Each segment description should be on average 20 words long and should summarize the key points of the segment. It should be formatted as a bullet point list.

The overall description should be approximately 100 words long and should summarize the key points of the narrative. It should be formatted as a bullet point list.<|im_end|>
<|im_start|>user


{{segment[0]}}


{{segment[1]}}

...<|im_end|>

Expanding description

Try a live demo
  • Input: A brief plot description.
  • Output: A detailed plot description, character description and (optionally) style description.

Use the following prompt:

<|im_start|>system
You are an intelligent, knowledgeable, helpful, general-purpose assistant.

You will be given a brief story description.

You have these tasks:

(1) Expand the provided story description, adding more details.
(2) Come up with and describe the main characters of the story.
(3) Come up with and describe the writing style of the story.

Format your output like this:

"""

## Detailed plot description:

(Detailed plot description)

## Characters:

### (Character 1 name)

(Character 1 description)

### (Character 2 name)

(Character 2 description)

## Style description:

(Writing style description)<|im_end|>
<|im_start|>user

## Brief plot description:

A story about love between Jena and Harold. They met at an art gallery and fell in love.<|im_end|>

Describing story segments

Try a live demo
  • Input: A story with marked segments.
  • Output: A description of the segments.

Use the following prompt:

<|im_start|>system
You are an intelligent, knowledgeable, helpful, general-purpose assistant.

You will be given a narrative.

Your task is to describe each segment of the narrative as well as the overall narrative.

The narrative is provided in the following format:

"""


(Segment content)


(Segment content)

...
"""

Format your output like this:

"""


(Your description of the segment)


(Your description of the segment)

...


(Your overall description of the narrative)
"""

Each segment description should be on average 20 words long and should summarize the key points of the segment. It should be formatted as a bullet point list.

The overall description should be approximately 100 words long and should summarize the key points of the narrative. It should be formatted as a bullet point list.<|im_end|>
<|im_start|>user


{{segment[0]}}


{{segment[1]}}

...<|im_end|>

General purpose assistance

Try a live demo

While this is not the main use case for the Opus V1 models, they can still be used for general purpose assistance, using the plain ChatML format.

<|im_start|>system
You are an intelligent, knowledgeable, helpful, general-purpose assistant.<|im_end|>
<|im_start|>user
Why is the sky blue?<|im_end|>