Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/just-cameron/letta-openwebui. A Letta fork of OpenWebUI
Something went wrong. Try again.
1.3 kB · 42 lines
Shell
12345678910111213141516171819202122232425262728293031323334353637383940414243#!/usr/bin/env bashset -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"TOKEN_FILE="$ROOT_DIR/.secrets/app-server-token"ENV_FILE="$ROOT_DIR/.env"
if [[ ! -s "$TOKEN_FILE" || ! -s "$ENV_FILE" ]]; then echo "Run ./scripts/setup.sh first." >&2 exit 1fi
set -a# shellcheck disable=SC1090source "$ENV_FILE"set +a
for command_name in curl python3; do if ! command -v "$command_name" >/dev/null 2>&1; then echo "Missing required command: $command_name" >&2 exit 1 fidone
models_json="$(curl -fsS --max-time 10 \ -H "Authorization: Bearer $(<"$TOKEN_FILE")" \ http://127.0.0.1:4500/v1/models)"
agent_count="$(python3 -c 'import json, sys; data=json.load(sys.stdin); print(len(data.get("data", [])))' <<<"$models_json")"if [[ "$agent_count" == "0" ]]; then echo "Letta App Server is running, but it reported no local agents." >&2 exit 1fi
webui_version="$(curl -fsS --max-time 10 \ "http://${OPENWEBUI_HOST:-127.0.0.1}:${OPENWEBUI_PORT:-3000}/api/version" \ | python3 -c 'import json, sys; print(json.load(sys.stdin)["version"])')"
printf 'Letta App Server: ready (%s agents)\n' "$agent_count"printf 'OpenWebUI: ready (v%s)\n' "$webui_version"printf 'Open: http://%s:%s\n' \ "${OPENWEBUI_HOST:-127.0.0.1}" "${OPENWEBUI_PORT:-3000}"