Systemd Service
LLaMA Server Service Configuration
This section explains how to set up a systemd service for running the LLaMA server, which provides local LLM inference capabilities.
sudo emacs /etc/systemd/system/llama.service
sudo systemctl daemon-reload
sudo systemctl enable llama.service
journalctl -u llama.service
[Unit]
Description=Llama Script
[Service]
ExecStart=/home/lzw/Projects/llama.cpp/build/bin/llama-server -m /home/lzw/Projects/llama.cpp/models/DeepSeek-R1-Distill-Qwen-14B-Q5_K_M.gguf --port 8000 --ctx-size 2048 --batch-size 512 --n-gpu-layers 49 --threads 8 --parallel 1
WorkingDirectory=/home/lzw/Projects/llama.cpp
StandardOutput=append:/home/lzw/llama.log
StandardError=append:/home/lzw/llama.err
Restart=always
User=lzw
[Install]
WantedBy=default.target
Open WebUI Service Configuration
This section explains how to set up a systemd service for running Open WebUI, which provides a web interface for interacting with LLM models.
[Unit]
Description=Open Web UI Service
[Service]
ExecStart=/home/lzw/.local/bin/open-webui serve
WorkingDirectory=/home/lzw
StandardOutput=append:/home/lzw/open-webui.log
StandardError=append:/home/lzw/open-webui.err
Restart=always
User=lzw
[Install]
WantedBy=default.target
sudo systemctl enable openwebui.service
sudo systemctl daemon-reload
sudo systemctl start openwebui.service
Clash Service Configuration
This section explains how to set up a systemd service for running Clash, a rule-based proxy tool.
[Unit]
Description=Clash Service
[Service]
ExecStart=/home/lzw/clash-linux-386-v1.17.0/clash-linux-386
WorkingDirectory=/home/lzw/clash-linux-386-v1.17.0
StandardOutput=append:/home/lzw/clash.log
StandardError=append:/home/lzw/clash.err
Restart=always
User=lzw
[Install]
WantedBy=default.target
# Create the service file
sudo emacs /etc/systemd/system/clash.service
# Reload systemd daemon
sudo systemctl daemon-reload
# Enable and start the service
sudo systemctl enable clash.service
sudo systemctl start clash.service
sudo systemctl restart clash.service
# Check status
sudo systemctl status clash.service