This project sets up a secure, isolated server for Whisper.cpp using nix-shell and systemd using bash.
- whisper.cpp server https://github.com/ggerganov/whisper.cpp/tree/master/examples/server
-
Clone
whisper.cpp
:git clone https://github.com/ggerganov/whisper.cpp/tree/master
-
Clone this repository into the root of
whisper.cpp
:cd whisper.cpp git clone https://github.com/bigFin/whisper.cpp-server-nix-systemd
-
Run
setup.sh
to configure the server:cd whisper.cpp-server-nix-systemd ./setup.sh
-
Test the server with
quickstart.sh
:./quickstart.sh
- Isolated execution via nix-shell
- Minimal-privilege whispercpp user
- Preconfigured
.env
file for server settings
- setup.sh: Installs dependencies, creates whispercpp user, and sets up the systemd service.
- quickstart.sh: Restarts the server, checks its status, and tests it with a sample audio file.
- .env: Configurable server parameters (e.g., port, model path).
- Nix package manager (multi-user installation)
- Systemd
Edit .env
to adjust server parameters like port, model path, or log locations.
WHISPERCPP_PORT=8080
WHISPERCPP_MODEL=../models/ggml-base.en.bin
WHISPERCPP_LOG_FILE=logs/whispercpp.log
WHISPERCPP_AUDIO_TMP_DIR=tmp/audio
To restart the server:
sudo systemctl restart whispercpp.service
To check server logs:
sudo journalctl -u whispercpp.service
To uninstall:
./uninstall.sh