gateway: fail-closed config validation before boot — unknown top-level key or unresolvable provider prefix refuses the start (ops-docs canonical copy shipped byte-identical)

This commit is contained in:
inference-bot committed 2026-11-11 03:55:18 +00:00
1 parent 64d7e5afc5
commit e21c24ea48
3 files changed
+280

No files matched your search

+14
View File
@@ -190,6 +190,20 @@ fi
# cannot happen through this path, and the shipped /app/code/config.yaml is
# the live catalog.
# --- Fail-closed config validation (2026-11-11) ---
# Validate the config that will actually be SERVED, before starting anything.
# A bad key must fail LOUD at the top of the boot log (the chat outage of
# 2026-10-31 showed what silent misconfiguration costs). The -f guard keeps a
# missing validator non-fatal (build patch did not apply); an INVALID config
# is fatal by design.
if [ -f /app/code/validate_config.py ]; then
echo "Validating gateway config (fail-closed)..."
if ! python3 /app/code/validate_config.py litellm "$CONFIG_FILE"; then
echo "FATAL: gateway config.yaml is invalid - refusing to start. Fix or remove the offending key named above." >&2
exit 1
fi
fi
# --- Start LiteLLM ---
echo "Starting LiteLLM on port 4000..."