#!/usr/bin/env bash set -euo pipefail export PATH="$HOME/.local/bin:${PATH}" MODEL_REPO="empero-ai/Qwythos-9B-Claude-Mythos-5-1M-GGUF" MODEL_FILE="Qwythos-9B-Claude-Mythos-5-1M-MTP-Q4_K_M.gguf" MODEL_DIR="${MODEL_DIR:-/tmp/models}" MODEL_PATH="${MODEL_DIR}/${MODEL_FILE}" # Install the prebuilt llama.cpp binary. On this free CPU tier the installer # probes the hardware and downloads the optimized CPU build. if ! command -v llama >/dev/null 2>&1; then echo "==> Installing prebuilt llama.cpp via llama.app ..." curl -LsSf https://llama.app/install.sh | sh fi # Fetch the GGUF model at runtime (no token needed, the model is public). mkdir -p "${MODEL_DIR}" if [ ! -s "${MODEL_PATH}" ]; then echo "==> Downloading ${MODEL_FILE} ..." curl -fL --retry 3 --retry-delay 5 \ -o "${MODEL_PATH}" \ "https://huggingface.co/${MODEL_REPO}/resolve/main/${MODEL_FILE}" fi echo "==> Launching llama serve (web UI on :8080) ..." exec llama serve \ -m "${MODEL_PATH}" \ --spec-type draft-mtp \ --spec-draft-n-max 6 \ -c 16384 \ --host 0.0.0.0 \ --port 8080