#!/usr/bin/env bash # 探测 Dify api 容器能否访问 Higress→LiteLLM(改模型供应商 API Base 前必跑) set -euo pipefail KEY="${LITELLM_MASTER_KEY:-sk-litellm-bocheng-207}" API_CTN="${DIFY_API_CONTAINER:-docker-api-1}" for base in \ "http://192.168.110.207:18080/llm/v1" \ "http://192.168.200.8:18080/llm/v1" \ "http://172.17.0.1:18080/llm/v1" \ "http://host.docker.internal:18080/llm/v1" do echo "=== $base ===" docker exec "$API_CTN" curl -sS -m 5 \ -H "Authorization: Bearer $KEY" \ "$base/models" 2>&1 | head -c 180 || true echo done