File: //etc/systemd/system/speaches.service
[Unit]
Description=Speaches OpenAI-compatible TTS server
After=network-online.target
[Service]
Type=simple
User=root
WorkingDirectory=/home/kiwerkzeuge.de/speaches
Environment="PATH=/home/kiwerkzeuge.de/speaches/.venv/bin:/usr/local/bin:/usr/bin:/bin"
Environment="LD_LIBRARY_PATH=/usr/local/lib/ollama/cuda_v12:/usr/local/cuda/lib64:/usr/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu"
Environment=UVICORN_HOST=127.0.0.1
Environment=UVICORN_PORT=8030
Environment=ENABLE_UI=false
Environment=HF_HUB_CACHE=/var/cache/speaches/huggingface
Environment=TTS_MODEL_TTL=300
ExecStart=/home/kiwerkzeuge.de/speaches/.venv/bin/uvicorn --factory speaches.main:create_app --host 127.0.0.1 --port 8030
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target