File size: 2,632 Bytes
590b382 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | #!/usr/bin/env bash
# Quick verification script for a running Inkling-2-Mini Turbo (Helios flare) endpoint.
# Usage: bash scripts/verify_server.sh [http://127.0.0.1:8001/v1] [inkling-2-mini]
set -euo pipefail
BASE_URL="${1:-http://127.0.0.1:8001/v1}"
MODEL="${2:-inkling-2-mini}"
echo "==> 1. Checking /models on ${BASE_URL}"
curl -fsS "${BASE_URL}/models" | python3 -c '
import json, sys
d = json.load(sys.stdin)
ids = [m["id"] for m in d.get("data", [])]
assert ids, "No models returned"
print(" Models:", ids)
'
echo "==> 2. Checking short non-empty response with reasoning_effort=none at max_tokens=64"
curl -fsS "${BASE_URL}/chat/completions" \
-H 'Content-Type: application/json' \
-d "{
\"model\": \"${MODEL}\",
\"messages\": [{\"role\": \"user\", \"content\": \"Reply with exactly one word: ready\"}],
\"max_tokens\": 64,
\"reasoning_effort\": \"none\"
}" | python3 -c '
import json, sys
d = json.load(sys.stdin)
msg = d["choices"][0]["message"]
content = (msg.get("content") or "").strip()
assert content, f"Empty content: {d}"
print(" content:", repr(content), "usage:", d.get("usage"))
'
echo "==> 3. Checking explicit thinking_token_budget=64 (Helios TMLv0 patch)"
curl -fsS "${BASE_URL}/chat/completions" \
-H 'Content-Type: application/json' \
-d "{
\"model\": \"${MODEL}\",
\"messages\": [{\"role\": \"user\", \"content\": \"Compute 17 * 23 and give the final integer.\"}],
\"max_tokens\": 192,
\"thinking_token_budget\": 64
}" | python3 -c '
import json, sys
d = json.load(sys.stdin)
msg = d["choices"][0]["message"]
content = (msg.get("content") or "").strip()
assert "391" in content, f"Expected 391 in response, got: {content!r}"
print(" content:", repr(content), "finish_reason:", d["choices"][0]["finish_reason"])
'
echo "==> 4. Checking streaming SSE output"
curl -fsSN "${BASE_URL}/chat/completions" \
-H 'Content-Type: application/json' \
-d "{
\"model\": \"${MODEL}\",
\"messages\": [{\"role\": \"user\", \"content\": \"List the integers 1 through 5 separated by commas.\"}],
\"max_tokens\": 128,
\"reasoning_effort\": \"none\",
\"stream\": true
}" | python3 -c '
import json, sys
chunks = []
for line in sys.stdin:
if not line.startswith("data: "):
continue
payload = line[6:].strip()
if payload == "[DONE]":
break
obj = json.loads(payload)
delta = obj["choices"][0].get("delta", {})
if delta.get("content"):
chunks.append(delta["content"])
text = "".join(chunks).strip()
assert text, "Empty streamed content"
print(" streamed:", repr(text))
'
echo "ALL CHECKS PASSED."
|