### Install SillyTavern Launcher (Linux) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/LinuxMacOS.md Make the install script executable and run it to start the installation process for Linux users. ```bash chmod +x install.sh && ./install.sh ``` -------------------------------- ### Clone SillyTavern Launcher and Start Installation Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Windows.md This command clones the SillyTavern Launcher repository, navigates into its directory, and then starts the installation script. This is part of the SillyTavern Launcher installation method. ```shell git clone https://github.com/SillyTavern/SillyTavern-Launcher.git && cd SillyTavern-Launcher && start installer.bat ``` -------------------------------- ### Hello World Plugin Example Source: https://github.com/sillytavern/sillytavern-docs/blob/main/For_Contributors/Server-Plugins.md 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!', }, }; ``` -------------------------------- ### Start SillyTavern Launcher (Linux) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/LinuxMacOS.md Make the launcher script executable and run it to start the installed SillyTavern application on Linux. ```bash chmod +x launcher.sh && ./launcher.sh ``` -------------------------------- ### YAML Configuration Example Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/config-yaml.md Example of nested settings in config.yaml using dot notation for hierarchy. ```yaml protocol: ipv6: false ``` -------------------------------- ### Install Extras Requirements (System-Wide) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Installation.md Install the basic requirements for SillyTavern Extras using pip for a system-wide installation. Run this from the cloned Extras directory. ```bash python -m pip install -r requirements.txt ``` -------------------------------- ### Navigate and Start SillyTavern Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/LinuxMacOS.md Commands to navigate into the SillyTavern directory and start the application using the start script. ```bash cd SillyTavern ``` ```bash ./start.sh ``` ```bash bash start.sh ``` -------------------------------- ### Install XTTS API Server and Dependencies Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/XTTS.md Installs the XTTS API server and the pydub library, which is required for audio manipulation. ```bash pip install xtts-api-server pydub ``` -------------------------------- ### Secure Extras API with API Key Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Installation.md To password-protect the Extras API, create an `api_key.txt` file in your Extras install folder with your chosen password and start extras with the `--secure` command-line argument. ```shell python extras.py --secure ``` -------------------------------- ### Install Homebrew and Git (MacOS) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/LinuxMacOS.md Installs Homebrew package manager and then Git on MacOS systems. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ```bash brew install git ``` -------------------------------- ### Start SillyTavern with SSL and custom certificate paths Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/remote-connections.md Specify custom paths for your SSL key and certificate files using `--keyPath` and `--certPath` when starting the server with the `--ssl` flag. This is useful if your certificates are not in the default `certs` folder. ```bash node server.js --ssl --keyPath /home/user/certificates/privkey.pem --certPath /home/user/certificates/cert.pem ``` -------------------------------- ### Example of /ask Command Source: https://github.com/sillytavern/sillytavern-docs/blob/main/For_Contributors/st-script.md A specific example of using the /ask command to query a character named Alice about her favorite color. ```stscript /ask name=Alice What is your favorite color? ``` -------------------------------- ### Example Character First Message Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Usage/Characters/characterdesign.md This example demonstrates how to format a character's first message, including narrative actions and dialogue. It supports Markdown and HTML formatting. ```txt *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 ffmpeg on Fedora Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/RVC.md Use this command to install ffmpeg on Fedora. ffmpeg is required for audio conversion. ```shell sudo dnf install ffmpeg ``` -------------------------------- ### Install SillyTavern Dependencies Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Android.md Installs Git, Node.js LTS, and Nano text editor required for SillyTavern. ```bash pkg install git nodejs-lts nano ``` -------------------------------- ### Install Extras Requirements (Basic) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Installation.md Install the basic requirements for SillyTavern Extras using pip. This command should be run from within the cloned Extras directory. ```bash pip install -r requirements.txt ``` -------------------------------- ### Start SillyTavern with SSL enabled Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/remote-connections.md Use the `--ssl` flag to start the server with TLS/SSL encryption. This encrypts traffic between the client and server. Ensure certificate files are readable by the SillyTavern user. ```bash node server.js --ssl ``` -------------------------------- ### Start SillyTavern with Docker Compose Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Docker.md Use this command to pull the latest release image and start SillyTavern using Docker Compose. Ensure you have downloaded the docker-compose.yml file first. ```sh docker compose up ``` -------------------------------- ### Install Git using winget Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Windows.md This command installs Git for Windows using the Windows Package Manager (winget). It is a prerequisite for using the SillyTavern Launcher. ```shell cmd /c winget install -e --id Git.Git ``` -------------------------------- ### Install SciPy and wxPython Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Talkinghead.md Install the SciPy and wxPython libraries using conda and pip respectively. These are required for the application's functionality. ```bash conda install scipy ``` ```bash pip install wxpython ``` -------------------------------- ### Install ffmpeg on Debian/Ubuntu Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/RVC.md Use this command to install ffmpeg on Debian or Ubuntu-based Linux distributions. ffmpeg is required for audio conversion. ```shell sudo apt install ffmpeg ``` -------------------------------- ### Run SillyTavern Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Android.md Navigates to the SillyTavern directory and executes the start script. ```bash cd ~/SillyTavern bash start.sh ``` -------------------------------- ### Install Git on Debian-based systems Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Docker.md Use this command to install Git on Debian, Ubuntu, Pop! OS, and similar distributions. ```shell sudo apt install git ``` -------------------------------- ### Install Git on macOS using Homebrew Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Docker.md Install Git on macOS using the Homebrew package manager. This is a prerequisite for cloning the repository. ```shell brew install git ``` -------------------------------- ### Install Git on Fedora/RHEL-based systems Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Docker.md Use this command to install Git on Fedora, Red Hat Enterprise Linux, and similar distributions. ```shell sudo dnf install git ``` -------------------------------- ### DreamGen Style Prompt Example Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Usage/API_Connections/DreamGen.md Include a 'Style' section in your card or system prompt to describe the desired writing style. Refer to the documentation for more examples. ```txt ## Style ``` -------------------------------- ### Start rvc-python API Server Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/RVC.md Run this command to start the rvc-python API server. Specify the port, whether to listen on all interfaces, and the model directory. ```shell python -m rvc_python api -p 5050 -l -md models_path ``` -------------------------------- ### Install PyTorch with GPU Acceleration Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/XTTS.md Installs PyTorch, torchvision, and torchaudio with support for CUDA 11.8 for GPU acceleration. For CPU-only inference, remove the '--index-url' part. ```bash pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 ``` -------------------------------- ### Navigate to Extras Directory Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Installation.md Change the current directory to the cloned SillyTavern-extras repository. This is necessary to install its requirements. ```bash cd SillyTavern-extras ``` -------------------------------- ### Clone SillyTavern Launcher Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/LinuxMacOS.md Clone the SillyTavern Launcher repository to begin the installation process. ```bash git clone https://github.com/SillyTavern/SillyTavern-Launcher.git ``` -------------------------------- ### Handlebars Template File Example Source: https://github.com/sillytavern/sillytavern-docs/blob/main/For_Contributors/Writing-Extensions.md An example of an HTML template file using Handlebars syntax for dynamic content and localization attributes. This file would be placed in your extension's directory and rendered by `renderExtensionTemplateAsync`. ```html
{{title}}
``` -------------------------------- ### Get Last N Messages using /setvar and /addvar Source: https://github.com/sillytavern/sillytavern-docs/blob/main/For_Contributors/st-script.md This example demonstrates how to retrieve the last N messages by calculating the start index using variable manipulation. It uses `/setvar` and `/addvar` to determine the range before calling `/messages`. ```stscript /setvar key=start {{lastMessageId}} | /addvar key=start -2 | /messages names=off {{getvar::start}}-{{lastMessageId}} | /setinput ``` -------------------------------- ### Start Extras Server with Modules Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Installation.md Launch the Extras server using a Python command, specifying desired modules with the --enable-modules flag. Ensure there are no spaces in the module list. ```bash python server.py --enable-modules=caption,summarize,classify ``` ```bash python server.py --enable-modules=YOUR,SELECTED,MODULE,LIST,HERE ``` ```bash python server.py ``` -------------------------------- ### Example Whitelist Configuration (Local Network) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/remote-connections.md Configure the `whitelist` in `config.yaml` to allow any device on a common local network range to connect. Ensure `::1` and `127.0.0.1` are included for local access. ```yaml whitelist: - ::1 - 127.0.0.1 - 10.0.0.0/8 - 172.16.0.0/12 - 192.168.0.0/16 ``` -------------------------------- ### Clone RVC Easy Menu Repository Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/RVC.md Clone the RVC Easy Menu repository to your local machine. This tool simplifies RVC installation and setup on Windows. ```shell git clone https://github.com/deffcolony/rvc-easy-menu.git ``` -------------------------------- ### Start Reply With for Text Completion APIs Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Usage/Prompts/advancedformatting.md Use this prefix to prefill the last line of the prompt, guiding the model to continue from a specific point. Useful for enforcing content or nudging towards specific reasoning patterns. ```text Sure! ``` -------------------------------- ### Timed Effects Example Configuration Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Usage/worldinfo.md Illustrates the sequence of timed effects based on a configuration of sticky=3, cooldown=2, and delay=2. ```txt Message 0: delay Message 1: entry activated Message 2: sticky Message 3: sticky Message 4: sticky Message 5: cooldown Message 6: cooldown Message 7: entry can be activated again ``` -------------------------------- ### Load LLaVA Model and Projections with KoboldCpp Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/captioning.md Command-line example for loading a LLaVA model and its multimodal projections using KoboldCpp. Ensure the paths to the model and mmproj files are correct. ```shell ./koboldcpp \ --model="models/llava-v1.5-7b-Q4_K.gguf" \ --mmproj="models/ llava-v1.5-7b-mmproj-Q4_0.gguf" \ ... other flags ... ``` -------------------------------- ### Install Python 3.10 in Conda Environment Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/XTTS.md Installs Python version 3.10 into the active Conda environment. Confirm the installation when prompted. ```bash conda install python=3.10 ``` -------------------------------- ### Example Whitelist Configuration (All IPv4) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/remote-connections.md Configure the `whitelist` in `config.yaml` to allow all IPv4 devices to connect. Use with caution and ensure other security measures are in place. ```yaml whitelist: - 0.0.0.0/0 ``` -------------------------------- ### Example whitelist.txt Configuration Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/remote-connections.md Add allowed IP addresses and CIDR ranges to the `whitelist.txt` file, one per line. This method is not recommended over `config.yaml` configuration. ```text 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 127.0.0.1 ::1 ``` -------------------------------- ### Installing hnswlib via Conda Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Smart-Context.md If you encounter build errors when installing ChromaDB, try installing the hnswlib package from conda-forge. This is a common solution for dependency issues. ```bash conda install -c conda-forge hnswlib ``` -------------------------------- ### Executing Quick Replies with /: Source: https://github.com/sillytavern/sillytavern-docs/blob/main/For_Contributors/st-script.md Demonstrates using `/:` as a shorthand for `/run` to execute Quick Replies. ```stscript /:QrSetName.QrButtonLabel | /run QrSetName.QrButtonLabel ``` -------------------------------- ### Example: Breaking out of /times loop Source: https://github.com/sillytavern/sillytavern-docs/blob/main/For_Contributors/st-script.md This example demonstrates breaking out of a /times loop when a condition is met. ```stscript /times 10 {: /echo {{timesIndex}} /delay 500 | /if left={{timesIndex}} rule=gt right=3 {: /break :} :} ``` -------------------------------- ### Create Windows Batch File for Extras Startup Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Installation.md A sample batch file script for Windows to activate the conda environment, start the Extras server with specified modules, and deactivate the environment. Remember to replace placeholders with your actual paths and module lists. ```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 ``` -------------------------------- ### Install RVC Requirements Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/RVC.md Install the necessary Python packages for RVC functionality. Ensure you are in the correct directory. ```shell pip install -r requirements-rvc.txt ``` -------------------------------- ### Install ffmpeg on macOS Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/RVC.md Use Homebrew to install ffmpeg on macOS. ffmpeg is required for audio conversion. ```shell brew install ffmpeg ``` -------------------------------- ### Initialize a Server Plugin (Node.js) Source: https://context7.com/sillytavern/sillytavern-docs/llms.txt Server plugins extend SillyTavern with Node.js capabilities. Enable them in config.yaml. This example shows how to define routes for status checks and data processing. ```javascript // plugins/my-plugin/index.js (CommonJS) /** * @param {import('express').Router} router * @returns {Promise} */ async function init(router) { // Route available at: GET /api/plugins/my-plugin/status router.get('/status', (req, res) => { res.json({ ok: true, timestamp: Date.now() }); }); // Route available at: POST /api/plugins/my-plugin/process router.post('/process', async (req, res) => { try { const { text } = req.body; const result = await runNativeProcessing(text); // e.g. call a Python script res.json({ result }); } catch (err) { res.status(500).json({ error: err.message }); } }); console.log('[my-plugin] Initialized'); return Promise.resolve(); } async function exit() { await cleanupResources(); return Promise.resolve(); } module.exports = { init, exit, info: { id: 'my-plugin', name: 'My Plugin', description: 'Adds native processing capabilities', }, }; ``` ```yaml # config.yaml — required to enable plugins enableServerPlugins: true ``` -------------------------------- ### Install Matplotlib Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Talkinghead.md Install the Matplotlib library using conda. This is used for plotting and visualization within the application. ```bash conda install matplotlib ``` -------------------------------- ### Update Termux Packages Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Android.md Run this command after installing Termux to update its package lists and installed packages. ```bash pkg update && pkg upgrade ``` -------------------------------- ### Install Extras Requirements (Coqui TTS) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Installation.md Install requirements for Coqui TTS for SillyTavern Extras. This option is not recommended. ```bash pip install -r requirements-coqui.txt ``` -------------------------------- ### Start XTTS API Server Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/XTTS.md Launches the XTTS API server. The model will be downloaded on the first run. It defaults to http://localhost:8020. ```bash python -m xtts_api_server ``` -------------------------------- ### Start SillyTavern Docker Containers Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Installation/Docker.md Run this command within the SillyTavern/docker directory to start the SillyTavern services in detached mode. ```shell docker compose up -d ``` -------------------------------- ### Example Whitelist Configuration (Subnet) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/remote-connections.md Configure the `whitelist` in `config.yaml` to allow any device within a specific subnet (e.g., `192.168.0.*`) to connect. ```yaml whitelist: - ::1 - 127.0.0.1 - 192.168.0.* ``` -------------------------------- ### Install ffmpeg on Arch Linux Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/RVC.md Use this command to install ffmpeg on Arch Linux. ffmpeg is required for audio conversion. ```shell sudo pacman -S ffmpeg ``` -------------------------------- ### Example: Using /break within a closure Source: https://github.com/sillytavern/sillytavern-docs/blob/main/For_Contributors/st-script.md This example shows how /break can be used within a closure defined by /let and executed by /:. ```stscript /let x {: iterations=2 /if left={{var::iterations}} rule=gt right=10 {: /break too many iterations! | :} /times {{var::iterations}} {: /delay 500 | /echo {{timesIndex}} | :} :} /:x iterations=30 | /echo the final result is: {{pipe}} ``` -------------------------------- ### Override config.yaml with Command-Line Arguments Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/config-yaml.md Demonstrates how to override config.yaml settings using command-line arguments when starting the server. ```shell node server.js --port 8000 --listen false ``` ```shell npm run start -- --port 8000 --listen false ``` ```shell Start.bat --port 8000 --listen false ``` -------------------------------- ### Example Whitelist Configuration (Specific IPs) Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Administration/remote-connections.md Configure the `whitelist` in `config.yaml` to allow only specific IP addresses to connect to your SillyTavern server. ```yaml whitelist: - ::1 - 127.0.0.1 - 192.168.0.2 - 192.168.0.5 ``` -------------------------------- ### Install Talkinghead Module Dependency Source: https://github.com/sillytavern/sillytavern-docs/blob/main/extensions/Extras/Installation.md On Linux, if you encounter an error importing the 'talkinghead' module, install the 'wxpython' package using pip. ```bash pip install wxpython ``` -------------------------------- ### KoboldCpp Initial Load Output Source: https://github.com/sillytavern/sillytavern-docs/blob/main/Usage/API_Connections/koboldcpp.md This output indicates that KoboldCpp has successfully loaded the model and is ready to accept API connections on the specified ports. Ensure your SillyTavern API URL matches the provided localhost address. ```txt 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 ```