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.

Introduction

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.

Prompt Format

The Opus V1 models are trained with the either ChatML or Llama3 inspired prompt format, depending on the base model.

The basic format looks like this:

<|start_header_id|>system<|end_header_id|>

(some system message)<|eot_id|>
<|start_header_id|>user<|end_header_id|>

(some user instruction)<|eot_id|>
<|start_header_id|>writer<|end_header_id|>

(some writer response)<|eot_id|>

The difference from the original Llama 3 / ChatML prompt format is the addition of the writer / text role for Llama 3 / ChatML and the ability to specify the names of the characters involved in the conversation.

Here's an example with names:

<|start_header_id|>system<|end_header_id|>

Lorem ipsum<|eot_id|>
<|start_header_id|>user<|end_header_id|>

Dolor sit amet<|eot_id|>
<|start_header_id|>writer character: Alice<|end_header_id|>

Ut enim ad minim veniam<|eot_id|>
<|start_header_id|>writer character: Bob<|end_header_id|>

Duis aute irure dolor in reprehenderit<|eot_id|>
<|start_header_id|>writer character: Alice + Bob<|end_header_id|>

Excepteur sint occaecat cupidatat non proident<|eot_id|>

Pay attention to the following:

  • There can be multiple subsequent message with a writer / text role, especially if names are involved.
  • There can be multiple names attached to a message.

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:

<|start_header_id|>system<|end_header_id|>

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}}<|eot_id|>
<|start_header_id|>user<|end_header_id|>

{{instruction[0]}}<|eot_id|>
<|start_header_id|>writer<|end_header_id|>

{{story_text[0]}}<|eot_id|>
<|start_header_id|>user<|end_header_id|>

{{instruction[1]}}<|eot_id|>
<|start_header_id|>writer<|end_header_id|>

{{story_text[1]}}<|eot_id|>

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

<|start_header_id|>system<|end_header_id|>

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}}

## Locations:

...

## Summary of past events:

...

## Current scene:

...

## Summary of future events:

...<|eot_id|>
<|start_header_id|>user<|end_header_id|>

{{instruction[0]}}<|eot_id|>
<|start_header_id|>writer<|end_header_id|>

{{story_text[0]}}<|eot_id|>
<|start_header_id|>user<|end_header_id|>

{{instruction[1]}}<|eot_id|>
<|start_header_id|>writer<|end_header_id|>

{{story_text[1]}}<|eot_id|>

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, specifying the names of the characters involved in the conversation:

<|start_header_id|>system<|end_header_id|>

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

### 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.<|eot_id|>
<|start_header_id|>user<|end_header_id|>

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.<|eot_id|>
<|start_header_id|>writer<|end_header_id|>

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.<|eot_id|>
<|start_header_id|>writer character: Elara<|end_header_id|>

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.<|eot_id|>
<|start_header_id|>writer character: Caelan<|end_header_id|>

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."<|eot_id|>
<|start_header_id|>writer character: Elara<|end_header_id|>

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.<|eot_id|>

FYI: Some older opus-v1 models handle past/current/future events differently:

  • ## Summary of past events -> ## Summary of previous chapters
  • ## Current scene -> ## Summary of the chapters that you should write
  • ## Summary of future events -> ## Summary of next chapters

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.

<|start_header_id|>system<|end_header_id|>

You are an intelligent, skilled, versatile writer.
Your task is to write a role-play based on the information below.<|eot_id|>

It's also recommended to kick-start the story with a messages to make sure the model sticks to the role-playing format.

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

Keep in mind that not all writer / text messages will necessarily have character names attached to them.

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:

<|start_header_id|>system<|end_header_id|>

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)

...
"""<|eot_id|>
<|start_header_id|>user<|end_header_id|>

## Overall plot description:

{{plot_description}}

## Characters:

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

{{characters[0].description}}

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

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

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:

<|start_header_id|>system<|end_header_id|>

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}}
"""<|eot_id|>
<|start_header_id|>user<|end_header_id|>

Summarize the overall story in roughly {{word_count}} words.<|eot_id|>

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:

<|start_header_id|>system<|end_header_id|>

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}}
"""<|eot_id|>
<|start_header_id|>user<|end_header_id|>

Describe the writing style of the overall story.<|eot_id|>

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:

<|start_header_id|>system<|end_header_id|>

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}}
"""<|eot_id|>
<|start_header_id|>user<|end_header_id|>

Describe the character of {{character_name}} in roughly {{word_count}} words.<|eot_id|>

Describing story segments

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

Use the following prompt:

<|start_header_id|>system<|end_header_id|>

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.<|eot_id|>
<|start_header_id|>user<|end_header_id|>

<segment 1>
{{segment[0]}}

<segment 2>
{{segment[1]}}

...<|eot_id|>

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:

<|start_header_id|>system<|end_header_id|>

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)
"""<|eot_id|>
<|start_header_id|>user<|end_header_id|>

## Brief plot description:

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

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 typical user and assistant roles.

<|start_header_id|>system<|end_header_id|>

You are an intelligent, knowledgeable, helpful, general-purpose assistant.<|eot_id|>
<|start_header_id|>user<|end_header_id|>

Why is the sky blue?<|eot_id|>