A simple web-based tool to switch between different llama.cpp model configurations on a headless AI server, featuring a retro-futuristic terminal interface.
The tool manages llama.cpp configurations by manipulating symbolic links and interacting with systemd:
/etc/llama.cpp.d for .conf files. Each file should contain the environment variables for a specific model.llama.cpp is expected to read its parameters from /etc/llama.cpp.conf./etc/llama.cpp.conf to point to the selected file in /etc/llama.cpp.d.llama.cpp systemd service to apply the changes.llama.cpp service logs using journalctl.npm install required.subprocess.run with capture_output).sudo privileges (to modify /etc, restart system services, and read journalctl logs).systemd service named llama.cpp.Run the script with sudo:
sudo python3 main.py
By default, the server will be available at http://127.0.0.1:7330.
--host: Set the listening address (e.g., 0.0.0.0 for all interfaces). If a path is provided (e.g., /tmp/model.sock), it will listen on a Unix socket. (Default: 127.0.0.1)--port: Set the TCP port. (Default: 7330)main.py: The Python backend using http.server and subprocess.static/: Contains the frontend assets (HTML/CSS/JS).index.html: Preact-based application.style.css: Custom "CRT Terminal" styling and animations.