#!/bin/sh -e

OLLAMA_API_BASE=${OLLAMA_API_BASE:-"http://127.0.0.1:11434"}

curl --fail-early --fail-with-body --location --post301 --post302 --globoff \
  --show-error --remove-on-error --create-dirs --tcp-fastopen --parallel \
  --parallel-immediate --netrc-optional --styled-output --no-progress-meter \
  "${OLLAMA_API_BASE}/api/ps" "${OLLAMA_API_BASE}/api/tags" \
  | jq --exit-status --sort-keys '.'
