How to make Gemini good for RP/ERP

Guide For Dummies

Prologue — Introduction

Howdy all! I'm MarinaraSpaghetti. You may know me from my past model reviews, merges such as NemoMix-Unleashed-12B, or simping for ‘that weird blue-haired doctor with pronouns.’

Alt Tag

Now that the introductions are behind us — here's how to make Gemini good. With the settings below, Gemini models should:

  • Be less repetitious.
  • Follow instructions better.
  • Pick up the writing style better.
  • Be less confused on larger contexts and generally remember things more.

All according to my tests, of course. Test them out for yourself!

Interlude Chapter — How To Connect

Gemini models are available for free. Don't use OpenRouter. They have sussy wussy tactics of cutting out contexts in the middle, their version of the model is more censored, and it works slower. Honestly, don't use OpenRouter.

  1. Go to https://aistudio.google.com/.
  2. Log in via your Gmail account (no, I won't tell you how to create one, go figure that one yourself, you're a big boy/girl/bean).
  3. Go to Get API Key tab.
  4. Click "Create API Key".

Alt Tag

  1. Copy the API Key you got.
  2. Go to SillyTavern and choose the Connections tab (the one with the plug icon).
  3. Choose "Chat Completion" for API and "Google AI Studio" for Chat Completion Source.
  4. Paste your API Key and press "Connect".

Alt Tag

  1. All done!

Chapter One — SillyTavern Edit

THE NEWEST STAGING BRANCH OF SILLYTAVERN ALREADY HAS THIS CHANGE MERGED, SO YOU DON'T HAVE TO DO THIS PART WITH THAT UPDATE!

This is the hard part. If you do it, you're good to go.

IMPORTANT: I'm on the staging branch of the SillyTavern. The code for release branch may look a little different.

  1. Go to your SillyTavern folder.
  2. SillyTavern/src/endpoints/backends/chat-completion.js
  3. Open chat-completion.js in Visual Studio Code or any text editing program of your choice.
  4. Find lines 304-318.
  5. Edit them to match the image below.

Alt Tag

Add:

model: model, //Edit here
systemInstruction: prompt.system_instruction, //Edit here

Comment:

1
2
3
4
//Comment this.
/*if (should_use_system_prompt) {
body.system_instruction = prompt.system_instruction;
}*/
  1. Save the file.
  2. Reopen SillyTavern.
  3. ???
  4. Profit.

You did the hard part! Yeepee! Now you're sending the system instruction correctly and before the chat history, as it was intended. Gemini should be much better at following instructions now. Go try it!

Chapter Two — Settings

Settings are the easy part. Just use mine, they're the best for stable roleplay. Minnie-v4's settings also work well.

https://huggingface.co/MarinaraSpaghetti/SillyTavern-Settings/blob/main/Chat%20Completion/Gemini%20MarinaraSpaghetti.json

Improved version:

https://huggingface.co/MarinaraSpaghetti/SillyTavern-Settings/blob/main/Chat%20Completion/Gemini%20MarinaraSpaghetti%20UPDATED.json

Alt Tag

Remember to check all the prompt parts with {{// Edit Accordingly}} tag!

I don't recommmend using the scenario or example messages. Scenario pushes Gemini to finish the roleplay prematurely. You can steer story bits with [OOC] commments instead. Example response encourages more repetition. A well-written character card and first message are enough for Gemini to pick up on desired formatting and style.

Parameters

You can see explanation on which parameters Gemini supports in their docs.

Rise Temperature for more chaos, but keep in mind the higher it is, the bigger the hallucinations. Do not touch Top K or Top P — they're applied before Temperature in the backend which renders them useless and will only cut down on the creativity. Generally speaking, Temperature at 1.0 alone is the perfect balance between logic and creativity, IMO.

UPDATE: Experiment with Top K values between 20 and 40 and fluctuate Top P between 1 and 0,95. Apparently, if you don't set Top K, it just defaults to what is recommended for the model, significantly limiting the output's creativity. Temperatures between 1.0 and 1.5 work best. Experiment, and see what works best for you. You can see the token probablities and how different samplers influence them here.

I'm currently using those settings, but the ones in the file are also good:

Alt Tag

Disabling Macro (Optional)

Disable <user> macro for my settings to work as intended. You can also replace <user> with <protagonist> intead.

  1. Go to SillyTavern folder.
  2. SillyTavern/public/scripts/macro.js
  3. Comment line 445, like in the image below.

Alt Tag

//EDIT HERE. { regex: /<USER>/gi, replace: () => typeof env.user === 'function' ? env.user() : env.user },
  1. Save file.
  2. Reopen SillyTavern.

Group Chats

My settings are group-compatible. I just make sure to have cards set to merge together so the dialogues between the present in the scene characters feel natural. You can also just swap the cards instead.

To encourage the model to respond as a selected character, toggle on the Group Nudge in the prompt.

Refusals

UPDATE TO THE NEWEST STAGING BRANCH OF SILLYTAVERN TO GET RID OF FLASH 2.0 REFUSALS, THEY CHANGED HOW THE FILTERS WORK AND THEY NOW NEED TO BE SET TO 'OFF' INSTEAD OF 'BLOCK-NONE'.

If you're getting refusals, it means something is off in your character/persona card in 9 out of 10 cases. Avoid any mentions of the word "young" like a plague, even if you mean "young adult". State ages of characters directly.

Example of how "censored" Flash 2.0 is:

Alt Tag

You can also add a Prefill for the model saying that it accepts that everything is a fiction, and it understands that you can do wild shit without any copnsequences, but personally I'm doing just fine without it. Other than that, what can I say except skill issue. Last time I got my prompt blocked was back in August, when I had a word "righteous" in a description of one character, lmao.

Chapter Three — First Message

Gemini likes the first message in the chat history to be that of the user. From my experiences, it tends to stick to the style you were going for much better that way, since it treats it as the "initial prompt" (besides system instructions).

Just make sure to have the first message sent in the prompt as "yours", then the model's "response" (you can simply split your initial message in two parts—like I did—and send one part as the one from the user, and the other from the model).

Alt Tag

Alt Tag

Remeber to hide the first message if it's in the chat history, to prevent it from being doubled in the prompt.

Alt Tag

Chapter Four — Epilogue

That's it! Congratulations, you've just improved your Gemini experience tenfold! Give yourself a pat on the back.

For the model choice… Go for Gemini 2.0 Flash for ERP and Gemini Experimental 2024-12-06 for RP. Both work well on high contexts. Gemini 2.0 has better prose and less repetition, while 12-06 is smarter. Test both, see which one suits you better. I recommend switching between the two if things get stale.

Fuck you Google for addicting me to models with high context sizes, now I cannot even look at anything below 128k. You've ruined LLMs for me.

Chapter ??? — Character Card

If you want an example of a well written card by yours truly or you just want to smooch the blue-haired gay man with pronouns.

Click here.

Autopromotion

If you feel particularly generous today and enjoy what I do, please consider donating to me on Ko-fi! Thank you so much, it means a lot!

I also have Twitter X where I post my art. Everything on this page was drawn and animated by me.

Questions?

Ask freely on Discord:
marinara_spaghetti

Happy Holidays & New Year!

Alt Tag

Edit
Pub: 28 Dec 2024 20:49 UTC
Edit: 18 Jan 2025 18:58 UTC
Views: 9040