Config settings and MAIN/NSFW prompts for Stheno-L2-13B
This is a basic dump of the MAIN and NSFW prompts, prompt formatting, and generation settings which you can use with the Stheno-L2-13B language model here:- https://huggingface.co/TheBloke/Stheno-L2-13B-GGML.
Why should you care about Stheno, you ask? Because it's a local language model that can fit in 16 Gb of main RAM, which has text quality better than Turbo, and requires no jailbreak. If you are someone who has been affected by the Claude/GPT4 proxy drought, then your time of misery is over. You can use these configuration settings and talk to your waifus or have as much other ERP as you want, without OpenAI or Anthropic being involved.
The three software programs you will need for this method are Koboldcpp, SillyTavern, and SimpleProxy for SillyTavern. I won't go into how to install those here, because there are two other Rentries for that.
https://rentry.org/llama_v2_sillytavern
https://rentry.org/local_LLM_guide
I'm just going to give you these four pieces.
This first file is the text generation presets for the language model. It goes in SimpleProxy's presets directory.
Stheno.json:-
Below is the prompt format file, Stheno.mjs. It goes in SimpleProxy's prompt-formats directory.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | import {
getLastChatMessage,
popLastAssistantMessage,
replaceTemplates,
} from "../src/utils.mjs";
export default ({ messages, config, generationConfig }) => {
const systemPrompt = ``;
const newConversation = `Start a new chat`;
const newExample = `Start a new chat`;
const context = ``;
const contextResponse = ``;
const characterBias = replaceTemplates(config.characterBias, config);
const impersonationPrompt = replaceTemplates(
config.impersonationPrompt,
config
);
const silentMessage = replaceTemplates(config.silentMessage, config);
let impersonationPromptFound = false;
let extensionPrompt = null;
const userName = () => ``;
const assistantName = () => ``;
const beforeSystem = "### Instruction: ";
const afterSystem = "";
const beforeUser = "### Input: ";
const afterUser = "";
const beforeAssistant = "### Response: ";
const afterAssistant = "";
let prompt = [];
if (systemPrompt) {
prompt.push({
role: "system",
metadata: { type: "system-prompt" },
prunable: false,
content: `${beforeSystem}${systemPrompt}${afterSystem}`,
});
}
for (const msg of messages) {
const { metadata } = msg;
let content = msg.content.trim();
if (metadata.type === "new-conversation") {
if (newConversation) {
prompt.push({
...msg,
prunable: false,
content: `${beforeSystem}${newConversation}${afterSystem}`,
});
}
} else if (metadata.type === "new-example-dialogue") {
if (newExample) {
prompt.push({
...msg,
prunable: false,
content: `${beforeSystem}${newExample}${afterSystem}`,
});
}
} else if (metadata.type === "context") {
prompt.push({
...msg,
prunable: false,
content: `${beforeSystem}${context}${content}${afterSystem}`,
});
if (contextResponse) {
prompt.push({
role: "assistant",
metadata: { type: "context-response" },
prunable: false,
content: `${beforeAssistant}${contextResponse}${afterAssistant}`,
});
}
} else if (metadata.type === "example-assistant") {
const keepFirst =
config.alwaysKeepFirstAssistantExample &&
metadata.exampleAssistantMsgIndex === 0;
prompt.push({
...msg,
prunable: !(config.keepExampleMessagesInPrompt || keepFirst),
content: `${beforeAssistant}${assistantName()}${content}${afterAssistant}`,
});
} else if (metadata.type === "example-user") {
prompt.push({
...msg,
prunable: !config.keepExampleMessagesInPrompt,
content: `${beforeUser}${userName()}${content}${afterUser}`,
});
} else if (metadata.type === "other" || metadata.type === "jailbreak") {
prompt.push({
...msg,
prunable: false,
content: `${beforeSystem}${content}${afterSystem}`,
});
} else if (metadata.type === "impersonation-prompt") {
impersonationPromptFound = true;
} else if (metadata.type === "extension-prompt") {
extensionPrompt = {
...msg,
prunable: false,
content: `${beforeSystem}${content}${afterSystem}`,
};
} else if (metadata.type === "assistant-msg") {
prompt.push({
...msg,
prunable: true,
content: `${beforeAssistant}${assistantName()}${content}${afterAssistant}`,
});
} else if (metadata.type === "user-msg") {
prompt.push({
...msg,
prunable: true,
content: `${beforeUser}${userName()}${content}${afterUser}`,
});
}
}
const last = getLastChatMessage(prompt);
if (impersonationPromptFound || last?.role === "user" || silentMessage) {
if (last?.role === "assistant" && silentMessage) {
prompt.push({
role: "user",
metadata: { type: "silent-message" },
prunable: false,
content: `${beforeUser}${userName()}${silentMessage}${afterUser}`,
});
}
if (impersonationPromptFound) {
prompt.push({
role: "system",
metadata: { type: "impersonation-prompt" },
prunable: false,
content: `${beforeSystem}${impersonationPrompt}${afterSystem}`,
});
}
prompt.push({
role: impersonationPromptFound ? "user" : "assistant",
metadata: { type: "reply-to-complete" },
prunable: false,
content: `${impersonationPromptFound ? beforeUser : beforeAssistant}${
impersonationPromptFound ? userName() : assistantName()
}${characterBias}`,
});
} else {
const msg = popLastAssistantMessage(prompt);
const end = msg.content.length - afterAssistant.length;
msg.content = msg.content.substring(0, end);
prompt.push(msg);
}
prompt.splice(prompt.length - 5, 0, {
role: "system",
metadata: { type: "superbig-injection-point" },
prunable: true,
content: "",
});
if (impersonationPromptFound) {
generationConfig.max_new_tokens = config.impersonationMaxNewTokens;
}
if (extensionPrompt) {
prompt.push(extensionPrompt);
}
return prompt;
};
|
Below is the Main prompt for SillyTavern, which you can get to by using SimpleProxy to give you a local version of the OpenAI API.
Below is the NSFW prompt. This isn't strictly necessary, but it will make ERP more graphic. You might want to take it out if you are using Stheno as a symbiote. (My own term for an assistant)
I hope this helps you.