File size: 469 Bytes
fbf3c28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
set -euo pipefail

PORT=${1:?port}
ALIAS=${2:?alias}

echo "[probe] models list:" >&2
curl -sS http://127.0.0.1:$PORT/v1/models | jq -r '.data[0].id' || true

echo "[probe] chat test:" >&2
curl -sS http://127.0.0.1:$PORT/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d "{\"model\":\"$ALIAS\",\"messages\":[{\"role\":\"user\",\"content\":\"Say hi\"}],\"max_tokens\":16}" \
 | jq -r '.choices[0].message.content // .error.message'