mirror of
https://github.com/exo-explore/exo.git
synced 2025-12-23 14:17:58 -05:00
* 8000 -> 52415 * dont grab the api port for placement --------- Co-authored-by: rltakashige <rl.takashige@gmail.com>
25 lines
621 B
Bash
Executable File
25 lines
621 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo "Usage: $0 <hostname> <query>"
|
|
exit 1
|
|
fi
|
|
|
|
HOST="$1"
|
|
shift
|
|
QUERY="$*"
|
|
|
|
curl -sN -X POST "http://$HOST:52415/v1/chat/completions" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{
|
|
\"model\": \"mlx-community/Kimi-K2-Thinking\",
|
|
\"stream\": true,
|
|
\"messages\": [{ \"role\": \"user\", \"content\": \"$QUERY\"}]
|
|
}" |
|
|
grep --line-buffered '^data:' |
|
|
grep --line-buffered -v 'data: \[DONE\]' |
|
|
cut -d' ' -f2- |
|
|
jq -r --unbuffered '.choices[].delta.content // empty' |
|
|
awk '{ORS=""; print; fflush()} END {print "\n"}'
|