Skip to content

Configuration Menu

Taleir of Deynai edited this page Sep 1, 2022 · 4 revisions

The Gist

The configuration menu allows you to configure the user-script, enabling or disabling the features that work for you and your scenario.

Accessing the Menu

The user-script uses Greasemonkey's GM.registerMenuCommand permission to register a command that will open the configuration menu.

How the user-script extension presents this menu command is up to the individual extension, but on Tampermonkey, you can access it from its icon on your browser's toolbar while NovelAI is loaded.

Finding the Configuration in Tampermonkey

Refer to your user-script extension's documentation to figure out how to find the configuration menu command or if it is even capable of presenting one.

Options

Here are the current options and a short explanation of their function:

  • Sourcing
    • Standardize Prefix/Suffix Handling (on by default) - When searching for key matches, vanilla NovelAI adds the prefix and suffix to lorebook entries but not to the story entry. Enabling this option will make sure the prefix and suffix are also added to the story so all entries behave the same way.
  • Activation
    • Integrate with Vanilla Searches (on by default) - In case NovelAI attempts to use the keys of an entry outside of the main context-builder, enabling this will try to catch that and make sure this user-script's search system is used instead. This makes sure the same caching system and searching behavior is used.
    • Search Comments (on by default) - Enables or disables the comment searching feature, which allows your keys to find matches in comments.
  • Sub-Context
    • Use Context-Groups (on by default) - Enables or disables the Context-Groups feature, which changes how sub-contexts work pretty drastically.
  • Selection
    • Weighted-Random Selection
      • Enable (on by default) - Enables or disables the weighted-random selection feature.
      • Use Story-Seeded Randomness (on by default) - When enabled, generates the context the same way on retries, as long as nothing else changed that might affect the randomness (like insertion positions of entries in your lorebook). Disable it if you want the context to reshuffle when you retry; you never know when you might've just gotten a bad roll!
  • Assembly
    • Shunting Mode - When an entry can't be inserted into another entry for whatever reason, it needs to be kicked out of it. This allows you to tweak how that happens.
      • "In Same Direction" - The default. Shunts in the direction indicated by the inserted entry's "insertion position" configuration; that is -1 or less places it before the entry and 0 or more places it after the entry.
      • "Nearest" - Shunts to the nearest boundary of the insertion target. So, if it was trying to insert near the start of the entry, it will be placed before it. Otherwise, it places it after it.
    • Early Satisfaction Threshold (10 by default) - When enough of the context has been assembled that there is this value or fewer tokens remaining to fill, the assembler will call it done there and end assembly early.
      • Trying to fill in those last few tokens can be very expensive with larger lorebooks and this value helps to tune for performance versus completeness. For every entry still waiting for their chance to be inserted, it must count the tokens of at least the minimum text possible given the entry's trim settings.
      • It is probable, though I did not confirm it, that any unused tokens will be used to expand the maximum AI response length instead. I suspect this because the value for AI response length gets subtracted from the token budget available to the context builder very early on.
  • Debugging
    • Enable Logging (off by default) - Enables debug logging.
      • Spams the browser's console with information on the entire context building process.
      • Enables performance telemetry of the context builder's pipeline. Chrome can give you a breakdown in one of its "Performance" recordings.
      • This will have a negative impact on performance, especially if you have the console open. Updating that in realtime is expensive.
    • Enable Performance Comparison (off by default) - Runs both the context builders of the user-script and vanilla NovelAI.
      • Reports the resulting contexts of each to the browser's console.
      • Tracks performance telemetry of each function individually.
      • Since this builds two contexts each time, it does slow things down a lot.
      • Best not to use it with debug logging enabled if you want to get decently comparable timings.

Clone this wiki locally