How to Install SillyTavern on a 768MB Racknerd VPS
My VPS configuration parameters
Racknerd-LADC02
CPU 1
Disk Space 10 GB
Memory 768 MB
Swap 768 MB
Operating System Debian 12 64 bit
If you have never bought a VPS before, see the specific operation process here (supports Alipay alipay)
Doesn't require too many resources; even with a self-used VPN ladder running, you can play SillyTavern at the same time.
Before installation:
root@rn-ladc02:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 336M 0 336M 0% /dev
tmpfs 71M 456K 71M 1% /run
/dev/vda1 9.1G 1.5G 7.2G 17% /
tmpfs 355M 0 355M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 71M 0 71M 0% /run/user/0
After installation:
root@rn-ladc02:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 336M 0 336M 0% /dev
tmpfs 71M 476K 71M 1% /run
/dev/vda1 9.1G 2.5G 6.1G 29% /
tmpfs 355M 0 355M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 71M 0 71M 0% /run/user/0
2. Memory usage
Before installation:
root@rn-ladc02:~# free -h
total used free shared buff/cache available
Mem: 709Mi 336Mi 52Mi 1.9Mi 434Mi 372Mi
Swap: 767Mi 3.5Mi 764Mi
After installation and running:
root@rn-ladc02:~# free -h
total used free shared buff/cache available
Mem: 709Mi 446Mi 66Mi 1.8Mi 316Mi 262Mi
Swap: 767Mi 126Mi 641Mi
3. Installation
Install node.js
apt update
apt install nodejs -y
Install SillyTavern
apt install git -y
git clone https://github.com/SillyTavern/SillyTavern -b release
cd SillyTavern
./start.sh
It will ask if you want to install npm and node.js
Answer y (I know this is strange; node.js and npm were clearly installed earlier. Ignore that, just answer y)
When you see logs like the following, it means SillyTavern can run.
First, stop SillyTavern. Ctrl + C
Next, we'll handle how to make your computer/phone able to access this SillyTavern.
I will use the https method, which requires you to have your own domain.
4. Caddy reverse proxy
You need to have a domain name, and set up DNS resolution to point to your VPS's IP.
Install caddy
(If you used my script to set up a ladder and already installed caddy, skip this step)
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg --yes
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
Edit Caddyfile
nano /etc/caddy/Caddyfile(If you used my script to set up a ladder and already installed caddy, just append a section to the end of the Caddyfile)
Your domain
{
reverse_proxy localhost:8000 {
header_up Host {upstream_hostport}
}
}
The 8000 is because SillyTavern listens on port 8000 by default.
Restart the caddy service
systemctl restart caddy
Now use your own browser to access https://your domain
You should see a page like this
This page is displayed by SillyTavern, which means your caddy configuration is correct.In order to use SillyTavern properly, we need to do some further configuration.
5. Modify the SillyTavern config file
nano ~/SillyTavern/config.yaml
(If you did not install SillyTavern in the user directory earlier, find the config file location yourself)
Modify the 4 configuration items shown in the image below, with the values as shown.
Set the username and password to whatever you like.
sed -i '/^listen:/s/.*/listen: true/' ~/SillyTavern/config.yaml
sed -i '/^enableForwardedWhitelist:/s/.*/enableForwardedWhitelist: false/' ~/SillyTavern/config.yaml
sed -i '/^basicAuthMode: /s/.*/basicAuthMode: true/' ~/SillyTavern/config.yaml
sed -i '/^ username:/s/.*/ username: 你喜欢的用户名/' ~/SillyTavern/config.yaml
sed -i '/^ password:/s/.*/ password: 你喜欢的密码/' ~/SillyTavern/config.yaml
sed -i '/^ username:/s/.*/ username: 你喜欢的用户名/' ~/SillyTavern/config.yaml
sed -i '/^ password:/s/.*/ password: 你喜欢的密码/' ~/SillyTavern/config.yaml
Restart SillyTavern
~/SillyTavern/start.sh
Now use your browser to visit https://your domain
A page like this should be displayed
Log in with the username and password you just set.
Then you can see the SillyTavern interface.
6. SillyTavern Settings
Set the language to Chinese
Set your own name
Your name will be displayed in the chat list afterwards.
Save.
Set the API
For API, select Chat Completion
For Chat Completion Source, select Google AI Studio
You can apply for a free API key from Google.
7. Apply for a Google AI Studio API key
Open a new page and visit https://aistudio.google.com/
Log in to your Google account
Choose to apply for an API key
Copy this content and paste it into the API key field from the previous step.
8. Test whether the API works properly
If you see a green light and the command line shows results like this, the API is connected and working properly.
You can check the "Auto-connect to last server" option.
9. Start telling stories with the AI.
Click "Character" and select the character created by default in the tavern.
Enter "Can you speak Chinese?" in the dialog box.
Then you can start telling Chinese stories with the AI. For example,
10. Run start.sh in the background
If you don't want the tavern to shut down when you disconnect from SSH, you need to find a way to run start.sh in the background.
I choose to use screen
Install
apt install screen -y
Open a new screen
screen
Run start.sh
~/SillyTavern/start.sh
This way, even if your SSH connection drops, the tavern will not stop running.
For more usage of screen, such as resuming a previously opened screen on the next SSH connection, please Google it yourself or ask GPT.
========
========
Please see the PDF of the story I told with the AI.
I think the word choice and phrasing at the micro level are quite rich, and the overall structure and design are roughly at the level of a children's bedtime story. Or at the level of children collaborating to tell a story.
========