← back to HERMES
scripts/smoke.sh
20 lines
#!/usr/bin/env bash
# smoke.sh — verify Hermes 3 is loaded and responsive
set -euo pipefail
MODEL="${HERMES_MODEL:-hermes3:8b}"
HOST="${OLLAMA_HOST:-http://127.0.0.1:11434}"
echo "→ ollama tags include $MODEL?"
curl -s "$HOST/api/tags" | jq -e --arg m "$MODEL" '.models[] | select(.name==$m) | .name' \
|| { echo "FAIL: $MODEL not pulled. Run: ollama pull $MODEL" >&2; exit 1; }
echo "→ inference test (5-token reply)"
RESP=$(curl -sS "$HOST/api/chat" \
-H 'Content-Type: application/json' \
-d "$(jq -n --arg m "$MODEL" \
'{model:$m, stream:false, options:{num_predict:20},
messages:[{role:"user",content:"Say hello in five words."}]}')" \
| jq -r '.message.content')
echo " reply: $RESP"
[[ -n "$RESP" ]] && echo "✓ smoke test passed" || { echo "FAIL: empty reply" >&2; exit 1; }