diff --git a/scripts/daily-infra-report.py b/scripts/daily-infra-report.py index 15200c5..a2b52be 100755 --- a/scripts/daily-infra-report.py +++ b/scripts/daily-infra-report.py @@ -35,7 +35,7 @@ try: with open(LITELLM_KEY_FILE) as f: SYNTHETIC_API_KEY = f.read().strip() except: - SYNTHETIC_API_KEY = "sk-U_ydi3B-wfGU-_xESkoU1Q" + SYNTHETIC_API_KEY = None # Fail loudly: report "no-key-file" in check NOW = datetime.datetime.now() DATE_STR = NOW.strftime("%Y-%m-%d") @@ -253,9 +253,13 @@ def collect(): report["litellm"]["checks"].append({"name": "oidc-auth", "status": "pass" if auth_code in ("200","302") else "fail", "code": auth_code}) # Check 5: Synthetic API call through LiteLLM - api_check = http_get(f"{LITELLM_PUBLIC}/v1/models", auth=SYNTHETIC_API_KEY) - report["litellm"]["api_models"] = api_check - report["litellm"]["checks"].append({"name": "api-endpoint", "status": "pass" if api_check == "200" else "fail", "code": api_check}) + if SYNTHETIC_API_KEY is None: + report["litellm"]["api_models"] = None + report["litellm"]["checks"].append({"name": "api-endpoint", "status": "fail", "code": "no-key-file"}) + else: + api_check = http_get(f"{LITELLM_PUBLIC}/v1/models", auth=SYNTHETIC_API_KEY) + report["litellm"]["api_models"] = api_check + report["litellm"]["checks"].append({"name": "api-endpoint", "status": "pass" if api_check == "200" else "fail", "code": api_check}) # ── NFS Mounts ── nfs = ssh("192.168.68.7", "df -h /media/storage /media/mediastore 2>/dev/null | tail -n +2")