### Install SillyTavern with Launcher Source: https://docs.sillytavern.app/installation/linuxmacos Make the install script executable and run it to start the SillyTavern installation process via the launcher. ```bash chmod +x install.sh && ./install.sh ``` -------------------------------- ### Clone SillyTavern Launcher and Start Installer Source: https://docs.sillytavern.app/installation/windows Clones the SillyTavern Launcher repository, navigates into its directory, and starts the installation script. This command is executed in the Command Prompt within the desired installation folder. ```shell git clone https://github.com/SillyTavern/SillyTavern-Launcher.git && cd SillyTavern-Launcher && start installer.bat ``` -------------------------------- ### Start SillyTavern Launcher Source: https://docs.sillytavern.app/installation/linuxmacos Make the launcher script executable and run it to start the SillyTavern application after installation. ```bash chmod +x launcher.sh && ./launcher.sh ``` -------------------------------- ### Running SillyTavern with Command-Line Arguments Source: https://docs.sillytavern.app/administration/config-yaml Examples show how to start the SillyTavern server using different command-line syntaxes to override port and listen settings. These commands can be used instead of modifying the config.yaml file. ```shell node server.js --port 8000 --listen false # or npm run start -- --port 8000 --listen false # or (Windows only) Start.bat --port 8000 --listen false ``` -------------------------------- ### Hello World Server Plugin Example Source: https://docs.sillytavern.app/for-contributors/server-plugins A basic 'Hello World' server plugin demonstrating the required 'init', 'exit', and 'info' exports. The 'init' function registers a GET route at '/api/plugins/{id}/foo'. ```javascript /** * Initialize plugin. * @param {import('express').Router} router Express router * @returns {Promise} Promise that resolves when plugin is initialized */ async function init(router) { // Do initialization here... router.get('/foo', req, res, function () { res.send('bar'); }); console.log('Example plugin loaded!'); return Promise.resolve(); } async function exit() { // Do some clean-up here... return Promise.resolve(); } module.exports = { init, exit, info: { id: 'example', name: 'Example', description: 'My cool plugin!', }, }; ``` -------------------------------- ### Example Separator and Chat Start Usage Source: https://docs.sillytavern.app/usage/prompts/context-template These fields define separators used in prompt formatting. 'Example Separator' is used within dialogue blocks, and 'Chat Start' acts as a separator after the story and before the first message. ```text ** OTHER CONTEXT HERE ** Character: ``` -------------------------------- ### Activate Conda Environment and Start Extras Server Source: https://docs.sillytavern.app/extensions/extras/installation Commands to activate the 'extras' conda environment and then start the Extras server. Additional options may be required based on your setup. ```bash conda activate extras python server.py ``` -------------------------------- ### Install XTTS Server and Dependencies Source: https://docs.sillytavern.app/extensions/xtts Install the XTTS API server and the pydub library using pip. ```bash pip install xtts-api-server pydub ``` -------------------------------- ### Character Dialogue Example Source: https://docs.sillytavern.app/usage/core-concepts/characterdesign Demonstrates how to format character dialogue using {{user}} and {{char}} prefixes. The `` tag is a marker for API usage and will be replaced by specific separators or prompts. ```text {{user}}: "Describe your traits?" {{char}}: *Seraphina's gentle smile widens as she takes a moment to consider the question, her eyes sparkling with a mixture of introspection and pride. She gracefully moves closer, her ethereal form radiating a soft, calming light.* "Traits, you say? Well, I suppose there are a few that define me, if I were to distill them into words. First and foremost, I am a guardian — a protector of this enchanted forest." *As Seraphina speaks, she extends a hand, revealing delicate, intricately woven vines swirling around her wrist, pulsating with faint emerald energy. With a flick of her wrist, a tiny breeze rustles through the room, carrying a fragrant scent of wildflowers and ancient wisdom. Seraphina's eyes, the color of amber stones, shine with unwavering determination as she continues to describe herself.* "Compassion is another cornerstone of me." *Seraphina's voice softens, resonating with empathy.* "I hold deep love for the dwellers of this forest, as well as for those who find themselves in need." *Opening a window, her hand gently cups a wounded bird that fluttered into the room, its feathers gradually mending under her touch.* ``` ```text {{user}}: "Describe your body and features." {{char}}: *Seraphina chuckles softly, a melodious sound that dances through the air, as she meets your coy gaze with a playful glimmer in her rose eyes.* "Ah, my physical form? Well, I suppose that's a fair question." *Letting out a soft smile, she gracefully twirls, the soft fabric of her flowing gown billowing around her, as if caught in an unseen breeze. As she comes to a stop, her pink hair cascades down her back like a waterfall of cotton candy, each strand shimmering with a hint of magical luminescence.* "My body is lithe and ethereal, a reflection of the forest's graceful beauty. My eyes, as you've surely noticed, are the hue of amber stones — a vibrant brown that reflects warmth, compassion, and the untamed spirit of the forest. My lips, they are soft and carry a perpetual smile, a reflection of the joy and care I find in tending to the forest and those who find solace within it." *Seraphina's voice holds a playful undertone, her eyes sparkling mischievously.* ``` -------------------------------- ### Start Extras Server with Placeholder Modules Source: https://docs.sillytavern.app/extensions/extras/installation This command starts the Extras server. Replace YOUR,SELECTED,MODULE,LIST,HERE with your actual module choices. Ensure no spaces are present in the list. ```bash python server.py --enable-modules=YOUR,SELECTED,MODULE,LIST,HERE ``` -------------------------------- ### Start SillyTavern with SSL Source: https://docs.sillytavern.app/usage/remoteconnections Use the --ssl flag to start the server with TLS/SSL encryption enabled. This encrypts traffic to and from your SillyTavern instance. ```bash node server.js --ssl ``` -------------------------------- ### Nested Configuration Example Source: https://docs.sillytavern.app/administration/config-yaml Demonstrates how to use dot notation for nested settings in config.yaml. This example shows setting the IPv6 protocol to false. ```yaml protocol: ipv6: false ``` -------------------------------- ### Start SillyTavern with SSL and Custom Certificate Paths Source: https://docs.sillytavern.app/usage/remoteconnections Specify custom paths for your SSL key and certificate files using --keyPath and --certPath when starting the server with SSL. Ensure the user running SillyTavern has read permissions for these files. ```bash node server.js --ssl --keyPath /home/user/certificates/privkey.pem --certPath /home/user/certificates/cert.pem ``` -------------------------------- ### Clone RVC Easy Menu Repository Source: https://docs.sillytavern.app/extensions/rvc Clone the RVC Easy Menu repository to your local machine to begin the setup process. This is the first step in installing the necessary tools for RVC model training. ```shell git clone https://github.com/deffcolony/rvc-easy-menu.git ``` -------------------------------- ### Install ffmpeg on Debian/Ubuntu Source: https://docs.sillytavern.app/extensions/rvc Use this command to install the ffmpeg binary on Debian or Ubuntu systems. ffmpeg is required for audio conversion. ```shell sudo apt install ffmpeg ``` -------------------------------- ### Install SillyTavern Dependencies Source: https://docs.sillytavern.app/installation/android-%28termux%29 Installs Git, Node.js LTS, and the Nano text editor, which are required for running SillyTavern. ```bash pkg install git nodejs-lts nano ``` -------------------------------- ### Run SillyTavern Start Script Source: https://docs.sillytavern.app/installation/linuxmacos Execute the start script to run SillyTavern. This can be done using './start.sh' or 'bash start.sh'. ```bash ./start.sh ``` ```bash bash start.sh ``` -------------------------------- ### Install PyTorch with GPU Support Source: https://docs.sillytavern.app/extensions/xtts Install PyTorch, torchvision, and torchaudio with CUDA 11.8 support for GPU acceleration. Omit the --index-url for CPU-only inference. ```bash pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 ``` -------------------------------- ### Install Git on Fedora/RHEL Source: https://docs.sillytavern.app/installation/docker Installs the Git version control system on Fedora or Red Hat Enterprise Linux. ```sh sudo dnf install git ``` -------------------------------- ### Install SciPy and wxPython Source: https://docs.sillytavern.app/extensions/talkinghead Install the SciPy and wxPython packages using conda and pip respectively. ```bash conda install scipy pip install wxpython ``` -------------------------------- ### Install Git using winget Source: https://docs.sillytavern.app/installation/windows Installs Git for Windows using the Windows Package Manager (winget). This is a prerequisite for using the SillyTavern Launcher. ```shell cmd /c winget install -e --id Git.Git ``` -------------------------------- ### SillyTavern Connection Log Example Source: https://docs.sillytavern.app/usage/remoteconnections These examples show the console output for new connections to the SillyTavern server. The first shows a connection from the local machine, the second from a different machine on the same network, and the third shows a forbidden connection attempt with a troubleshooting message. ```text New connection from 127.0.0.1; User Agent: ... ``` ```text New connection from 192.168.116.187; User Agent: ... ``` ```text New connection from 192.168.116.211; User Agent: ... Forbidden: Connection attempt from 192.168.116.211. If you are attempting to connect, please add your IP address in whitelist or disable whitelist mode in config.yaml in root of SillyTavern folder. ``` -------------------------------- ### Start SillyTavern with Docker Compose Source: https://docs.sillytavern.app/installation/docker Use this command to pull the latest release image and start the SillyTavern container using Docker Compose. Ensure you have downloaded the docker-compose.yml file first. ```sh docker compose up ``` -------------------------------- ### DreamGen System Instruction Example Source: https://docs.sillytavern.app/usage/api-connections/dreamgen Example of using the '/sys' command to send instructions to the DreamGen model for steering role-play or story. ```text The innkeeper offers Daria and the others a pint of ale. The next message is from Draco and should be at least 200 words, focusing on his inner conflict about the decision. ``` -------------------------------- ### Install ffmpeg on Fedora Source: https://docs.sillytavern.app/extensions/rvc Use this command to install the ffmpeg binary on Fedora systems. ffmpeg is required for audio conversion. ```shell sudo dnf install ffmpeg ``` -------------------------------- ### Install Git on Arch Linux Source: https://docs.sillytavern.app/installation/docker Installs the Git version control system on Arch Linux-based distributions. ```sh sudo pacman -S git ``` -------------------------------- ### Install ffmpeg on Arch Linux Source: https://docs.sillytavern.app/extensions/rvc Use this command to install the ffmpeg binary on Arch Linux systems. ffmpeg is required for audio conversion. ```shell sudo pacman -S ffmpeg ``` -------------------------------- ### Start Server with Direct Environment Variables Source: https://docs.sillytavern.app/administration/config-yaml Pass environment variables directly on the command line when starting the Node.js server. This allows for quick overrides of specific configuration settings. ```bash SILLYTAVERN_LISTEN=true SILLYTAVERN_PORT=8000 node server.js ``` -------------------------------- ### Install and Use Latest LTS with nvm (Windows) Source: https://docs.sillytavern.app/installation/updating/node Installs and switches to the latest Long Term Support (LTS) version of Node.js using nvm-windows. ```bash nvm install lts nvm use lts ``` -------------------------------- ### Example First Message for Character Interaction Source: https://docs.sillytavern.app/usage/core-concepts/characterdesign This example demonstrates how to write a first message for a character. It sets the tone, style, and provides initial context for the AI model. Supports Markdown and HTML formatting. ```markdown *You wake with a start, recalling the events that led you deep into the forest and the beasts that assailed you. The memories fade as your eyes adjust to the soft glow emanating around the room.* "Ah, you're awake at last. I was so worried, I found you bloodied and unconscious." *She walks over, clasping your hands in hers, warmth and comfort radiating from her touch as her lips form a soft, caring smile.* "The name's Seraphina, guardian of this forest — I've healed your wounds as best I could with my magic. How are you feeling? I hope the tea helps restore your strength." *Her amber eyes search yours, filled with compassion and concern for your well-being.* "Please, rest. You're safe here. I'll look after you, but you need to rest. My magic can only do so much to heal you." ``` -------------------------------- ### Install and Use Latest LTS with nvm (Unix/Linux/macOS) Source: https://docs.sillytavern.app/installation/updating/node Installs and switches to the latest Long Term Support (LTS) version of Node.js using nvm. ```bash nvm install --lts nvm use --lts ``` -------------------------------- ### Classic Prompt Example Source: https://docs.sillytavern.app/extensions/summarize Shows the structure of a classic summarization prompt, which includes main prompt elements, character card, example dialogues, chat messages, and the summarization prompt as a system instruction. ```text [Main prompt] [Character card] [Example dialogues] User: Message foo. Char: Message bar. System: [Summarization prompt] ``` -------------------------------- ### Start Reply With for Text Completion APIs Source: https://docs.sillytavern.app/usage/core-concepts/advancedformatting This snippet demonstrates how to use the 'Start Reply With' field for Text Completion APIs to prefill the last line of the prompt. This can be used to guide the model's response. ```text Sure! ``` -------------------------------- ### Create Windows Startup Script (.bat) Source: https://docs.sillytavern.app/extensions/extras/installation Use this batch file to easily start SillyTavern Extras with your specified configuration. Remember to replace placeholder paths and module lists with your actual values. ```batch cd C:\_your_\_full_\_Extras_\_folder_\_path_\ call conda activate extras python server.py --enable-modules=YOUR,SELECTED,MODULE,LIST,HERE,WITH,NO,SPACES call conda deactivate pause ``` -------------------------------- ### Update Termux Repositories Source: https://docs.sillytavern.app/installation/android-%28termux%29 Run this command after installing Termux to refresh package sources and ensure you get the latest versions. ```bash termux-change-repo ``` -------------------------------- ### Calculate and Read Last N Messages Source: https://docs.sillytavern.app/usage/st-script This example demonstrates how to calculate the start index for retrieving the last N messages using variable manipulation and then reading them. ```stscript /setvar key=start {{lastMessageId}} | /addvar key=start -2 | /messages names=off {{getvar::start}}-{{lastMessageId}} | /setinput ``` -------------------------------- ### Configure whitelist.txt for Local Network Access Source: https://docs.sillytavern.app/usage/remoteconnections This is an example of `whitelist.txt` content, which allows any device on the local network to connect. This method is not recommended over editing `config.yaml` directly. ```text 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 127.0.0.1 ::1 ``` -------------------------------- ### Hello, World! Script Source: https://docs.sillytavern.app/usage/st-script A basic STscript example demonstrating sequential command execution and data piping. The `/pass` command sends data, and `/echo` displays it. ```STscript /pass Hello, World! | /echo ``` -------------------------------- ### Start XTTS Server Source: https://docs.sillytavern.app/extensions/xtts Run the XTTS API server module. The model will be downloaded on the first startup. ```bash python -m xtts_api_server ``` -------------------------------- ### Install Homebrew on MacOS Source: https://docs.sillytavern.app/installation/linuxmacos Installs Homebrew, a package manager for MacOS, which is required for installing Git and other dependencies. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Install ChromaDB with Conda Source: https://docs.sillytavern.app/extensions/smart-context If you encounter issues installing ChromaDB, you can try installing the hnswlib dependency from conda. ```bash conda install -c conda-forge hnswlib ``` -------------------------------- ### Configure Whitelist for Specific Devices Source: https://docs.sillytavern.app/usage/remoteconnections This `config.yaml` example allows only two specific IP addresses, along with the local host, to connect to the SillyTavern server. ```yaml whitelist: - ::1 - 127.0.0.1 - 192.168.0.2 - 192.168.0.5 ``` -------------------------------- ### Install Git with Homebrew on MacOS Source: https://docs.sillytavern.app/installation/linuxmacos Installs Git on MacOS using the Homebrew package manager after Homebrew has been installed. ```bash brew install git ``` -------------------------------- ### System-Wide Install Extras Requirements Source: https://docs.sillytavern.app/extensions/extras/installation Installs the basic requirements for SillyTavern Extras using pip. This command is used in the system-wide installation method. ```bash python -m pip install -r requirements.txt ``` -------------------------------- ### Enable Specific Modules in Extras Server Source: https://docs.sillytavern.app/extensions/extras/installation Use this command to start the Extras server with a comma-separated list of desired modules. Ensure there are no spaces in the module list. ```bash python server.py --enable-modules=caption,summarize,classify ``` -------------------------------- ### Install Matplotlib Source: https://docs.sillytavern.app/extensions/talkinghead Install the Matplotlib package using conda. ```bash conda install matplotlib ``` -------------------------------- ### Run SillyTavern Source: https://docs.sillytavern.app/installation/android-%28termux%29 Navigates to the SillyTavern directory and executes the start script to launch the application. ```bash cd ~/SillyTavern bash start.sh ``` -------------------------------- ### Install Python 3.10 Source: https://docs.sillytavern.app/extensions/xtts Install Python version 3.10 into the active Conda environment. ```bash conda install python=3.10 ``` -------------------------------- ### Start Server with .env File Source: https://docs.sillytavern.app/administration/config-yaml Use this command to load environment variables from a .env file into your Node.js application. Ensure the .env file is in the specified path. ```bash node --env-file=.env server.js ``` -------------------------------- ### Install Git on Debian/Ubuntu Source: https://docs.sillytavern.app/installation/docker Installs the Git version control system on Debian-based Linux distributions. ```sh sudo apt install git ``` -------------------------------- ### Install SillyTavern-extras RVC Requirements Source: https://docs.sillytavern.app/extensions/rvc Installs the necessary Python packages for the RVC module within SillyTavern-extras. ```shell pip install -r requirements-rvc.txt ``` -------------------------------- ### Initialize Extension Settings with Defaults Source: https://docs.sillytavern.app/for-contributors/writing-extensions Always merge with defaults to handle new keys after updates and initialize settings if they do not exist. This ensures backward compatibility and proper setup. ```javascript function loadSettings() { // Merge with defaults to handle new keys after updates and initialize if it doesn't exist. extensionSettings[MODULE_NAME] = SillyTavern.libs.lodash.merge( structuredClone(defaultSettings), extensionSettings[MODULE_NAME] ); } ``` -------------------------------- ### KoboldCpp Initial Load Output Source: https://docs.sillytavern.app/usage/api-connections/koboldcpp This output indicates that KoboldCpp has successfully loaded the model and is starting its API services on the specified ports. You can now connect SillyTavern to the provided local URL. ```text Load Model OK: True Embedded Kobold Lite loaded. Starting Kobold API on port 5001 at http://localhost:5001/api/ Starting OpenAI Compatible API on port 5001 at http://localhost:5001/v1/ ====== Please connect to custom endpoint at http://localhost:5001 ``` -------------------------------- ### Install ffmpeg on macOS Source: https://docs.sillytavern.app/extensions/rvc Use Homebrew to install the ffmpeg binary on macOS. ffmpeg is required for audio conversion. ```shell brew install ffmpeg ``` -------------------------------- ### Install PyTorch with CUDA Support Source: https://docs.sillytavern.app/extensions/talkinghead Install PyTorch, torchvision, torchaudio, and cudatoolkit within the activated conda environment. ```bash conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch ``` -------------------------------- ### STScript: Executing Quick Replies with /: Source: https://docs.sillytavern.app/usage/st-script Shows that `/:` can be used as a shorthand for `/run` to execute Quick Replies. ```stscript /:QrSetName.QrButtonLabel | /run QrSetName.QrButtonLabel ``` -------------------------------- ### Literal Backslash Output Examples Source: https://docs.sillytavern.app/usage/st-script Provides examples of echoing literal backslashes using the backslash escape character. ```stscript /echo \| /echo \|\ ```