Skip to content

Instantly share code, notes, and snippets.

@mrseanryan
Last active January 22, 2024 16:38
Show Gist options
  • Save mrseanryan/6bf26b78c6af43fe38d322533c8e10b5 to your computer and use it in GitHub Desktop.
Save mrseanryan/6bf26b78c6af43fe38d322533c8e10b5 to your computer and use it in GitHub Desktop.
AWS EC2 script to install text-generation-webui as a Ubuntu service
#!/bin/bash -e
GPU_GB=${1:-24}
OUT_FILE=/etc/systemd/system/llmtextgen.service
if [ -e $OUT_FILE ]
then
echo LLM servic 'llmtextgen.service' already installed - exiting.
exit 0;
fi
echo Downloading script to /home/ubuntu/start-llm.sh
curl https://gist.githubusercontent.com/mrseanryan/2dcdb8182c05d1ea116e6bd0b772ba3d/raw > /home/ubuntu/start-llm.sh
sed -i "s/24/$GPU_GB/g" start-llm.sh
echo Downloading service definition to $OUT_FILE
curl https://gist.githubusercontent.com/mrseanryan/dd1e945316c1b0c4a763aa65eccd3fb8/raw > $OUT_FILE
echo Reloading services
systemctl daemon-reload
echo Enabling the new service
sudo systemctl enable llmtextgen.service
sudo systemctl start llmtextgen.service
echo Service status:
sudo systemctl status llmtextgen.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment