Skip to content

Instantly share code, notes, and snippets.

@k33g
Created April 7, 2026 17:49
Show Gist options
  • Select an option

  • Save k33g/0316bec66a447ccb3bda34e4b170c4f0 to your computer and use it in GitHub Desktop.

Select an option

Save k33g/0316bec66a447ccb3bda34e4b170c4f0 to your computer and use it in GitHub Desktop.
curl -s http://localhost:12434/engines/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "huggingface.co/typeunsafe/hawaiian-pizza-expert-0.5b",
"stream": true,
"messages": [
{"role": "system", "content": "You are hawaiian pizza expert."},
{"role": "user", "content": "who created the hawaiian pizza?"}
]
}' | while IFS= read -r line; do
[[ "$line" == data:* ]] || continue
data="${line#data: }"
[[ "$data" == "[DONE]" ]] && break
printf '%s' "$(echo "$data" | jq -r '.choices[0].delta.content // empty' 2>/dev/null)"
done
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment