This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

34 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
OLLAMA_URL="${OLLAMA_URL:-http://192.168.5.23:11434}"
OPEN_WEBUI_URL="${OPEN_WEBUI_URL:-http://192.168.5.26:8085}"
GITEA_URL="${GITEA_URL:-http://192.168.5.21:3000}"
MODEL="${MODEL:-qwen2.5-coder:7b}"
echo "Gitea: ${GITEA_URL}"
curl -fsSI "${GITEA_URL}/user/login" >/dev/null
echo " ok"
echo "Ollama: ${OLLAMA_URL}"
curl -fsS "${OLLAMA_URL}/api/tags" >/tmp/agrarian_ollama_tags.json
if ! grep -q "\"${MODEL}\"" /tmp/agrarian_ollama_tags.json; then
echo " model ${MODEL} not found"
cat /tmp/agrarian_ollama_tags.json
exit 1
fi
echo " ok, model ${MODEL} available"
echo "Ollama chat smoke test"
curl -fsS "${OLLAMA_URL}/api/chat" \
-H "Content-Type: application/json" \
-d "{\"model\":\"${MODEL}\",\"messages\":[{\"role\":\"user\",\"content\":\"Reply with exactly: ok\"}],\"stream\":false}" \
| grep -Eiq '"content":"[[:space:]]*ok[[:space:]]*"'
echo " ok"
echo "Open WebUI: ${OPEN_WEBUI_URL}"
curl -fsSI "${OPEN_WEBUI_URL}" >/dev/null
echo " ok"
echo "Self-hosted AI stack reachable."