#!/usr/bin/env bash set -euo pipefail MODEL="$(find /opt/models -name '*.gguf' | head -n1)" if [ -z "$MODEL" ]; then echo "FATAL: no .gguf found in /opt/models" >&2 exit 1 fi echo ">> starting llama-server with $MODEL" /app/llama-server \ -m "$MODEL" \ --host 127.0.0.1 \ --port 8081 \ -c 4096 \ -t "$(nproc)" \ --jinja & echo ">> waiting for llama-server health ..." until curl -sf http://127.0.0.1:8081/health > /dev/null; do sleep 2 done echo ">> llama-server is up, starting Gradio" exec python3 app.py