Repository navigation
Description
Problem or Motivation
The LiteLLM gateway config has warnings and old comments. Some log lines look like configuration errors, but they are not. Other comments describe LiteLLM behavior that changed. An operator who reads them gets a wrong model of the gateway.
1. Client error messages carry the internal fallback map. k8s/llm/gateway/config.yaml litellm_settings (lines 202-223) does not set expose_router_debug_in_errors. In LiteLLM 1.103.11 the default is True (litellm/__init__.py:221; its comment says that a future major release changes the default to False). router.py:7345, 7377, 7399 and 7431 append Received Model Group=..., Available Model Group Fallbacks=... and No fallback model group found for lookup_groups=<g>. Fallbacks=[<full map>] to ProxyException.message. Thus each client sees the model-group and fallback wiring, also through the tunnel.
- Loki, 7 days: 12
Router:ERRORlines with this text (deepseek-v4.1-flash-10178,claude-sonnet-5-52,typesafe/jev-1.142). - 3
POST /v1/chat/completions 500answers to roadmap-service pods carried it (2026-11-10T11:30:37Z, 2026-11-11T02:06:42Z and 2026-11-11T17:13:50Z). - Each event was a provider failure (an OpenRouter stream drop, an Anthropic 400 or a Jev 400), but the text reads like a gateway configuration error.
git grepfinds no code insrc,tests,k8sordocsthat parses these strings.
2. The trusted_proxy_ranges WARNING at each start. Loki, 7 days: 11 login_throttle.py:123 - trusted_proxy_ranges is not set or not a valid list of ranges... lines, one at each good start. general_settings (lines 279-313) does not set the key. Do not set it to the pod network:
login_throttle.py:302-309(_keys): the only counters are the pair (source group, username) and the source group. No counter uses the username alone.source_group(lines 243-250) keeps an IPv4 address as it is.network.pyresolve_client_iptrustsX-Forwarded-Forfrom each peer in the ranges.- The gateway has 3 inbound paths: Cloudflare to cloudflared to Traefik, the LAN NodePort, and direct pod calls. The Service
llm-gatewayis a NodePort withexternalTrafficPolicy: Cluster, so LAN clients reach LiteLLM from the SNAT node bridge address in the pod network (3,600 requests in 6 h). Traefik keeps incoming forwarded headers (k8s/ingress/traefik-values.yaml:20-21). - No CIDR holds only the proxies. If the gateway trusts the pod network CIDR, a NodePort client or any pod can forge
X-Forwarded-Forand get a new source for each attempt. That escapes the pair limit, which works today as a per-username limit, and also the new source limit.
Thus the WARNING is expected, but no comment says why.
3. deployment.yaml comments describe old LiteLLM behavior.
k8s/llm/gateway/deployment.yaml:79says that the pod waits for the database. No init container exists. LiteLLM v1 tries the database 4 times in about 5 s with no delay. On 2026-11-12, a new pod loggedRunning prisma migrate deployat 14:31:23.617, thenP1001at 24.767, 25.972, 27.213 and 28.454, and exited with code 1 at 14:31:30Z.- Lines 85-87 say that without
ENFORCE_PRISMA_MIGRATION_CHECK, LiteLLM goes on with an empty schema. Butproxy_cli.py:951-961hasdefault=True. config.yaml:223telemetry: falseanddeployment.yaml:97-98LITELLM_TELEMETRY: no code in litellm 1.103.11, litellm-proxy-extras 0.4.100.post2, litellm-enterprise 0.1.69.post2 orprod_entrypoint.shreads either one.
4. config.yaml comments are wrong or missing.
config.yaml:128says that for the hosted groups "No pool and no fallback names them". Butconfig.yaml:272makesdeepseek-v4.1-flash-1017the fallback ofclaude-sonnet-5-5, and 1,428 fallbacks used it in 7 days.- The Admin UI health column is empty:
/model_group/infogiveshealth_status: nullfor each group.background_health_checksdefaults to false (proxy_server.py:6408), andgeneral_settingssets no health key. Each Ollama tier serves 1 request (OLLAMA_NUM_PARALLEL "1",k8s/llm/profiles/ollama-profiles.yaml:148-149), and the health-check timeout is 60 s. No comment says that this is on purpose. /v1/modelsreturns 13 ids: the 12model_nameentries andembedding, the callable routing group ofconfig.yaml:237-241(router.py:1454-1494,11753-11778). No comment or README text explains the extra id.
Proposed Solution & Architectural Design
All changes are in k8s/llm/gateway/config.yaml and k8s/llm/gateway/deployment.yaml. Put them in one pull request, because each edit of config.yaml rolls the gateway (the configMapGenerator hashes the raw file). Merge it after the grace-period fix of the related issue below, so that the rollout does not cut open calls.
config.yamllitellm_settings(lines 202-223): addexpose_router_debug_in_errors: falsewith a one-line comment. The gateway log keeps the provider failure. Do this before build(k8s): move the LiteLLM gateway to v1.109 #5091, because a later major release changes this default anyway.config.yamlgeneral_settings(near line 280): keeptrusted_proxy_rangesunset. Add a comment that names the 3 inbound paths and says that the pair (source, username) limit stays on, so the start-up WARNING is expected. Set a value only after the NodePort path is gone and a range holds only the ingress proxies.deployment.yaml:77-89: rewrite line 79. The kubelet waits for the credentials object. LiteLLM tries the database 4 times in about 5 s and exits, and the kubelet restarts it with back-off. Rewrite lines 85-87: the variable pins the default of this version, and a failed migration ends the start with exit code 1.deployment.yaml:97-98andconfig.yaml:223: removeLITELLM_TELEMETRYandtelemetry: false, or mark them as a harmless guard that v1.103.11 does not read.config.yaml:127-129: name the hosted-only fallback chain.config.yamlgeneral_settings(lines 279-313): add a comment that background health checks stay off on purpose, because each tier has one slot and the hosted groups are billed. If the owner wants a health column, setbackground_health_check_model_groups: [qwen3-embedding:0.6b]only.config.yaml:237-241: next torouting_groups, add a comment thatembeddingis a callable alias ofqwen3-embedding:0.6b. Do not rename the group to amodel_name, because LiteLLM then logs ashadowedWARNING.
Related: #5301 (the grace-period fix), #5091 (the LiteLLM v1.109 upgrade).
Target Subsystem
Kubernetes: the LiteLLM gateway manifests (k8s/llm/gateway/).
Existing Tool Considered
LiteLLM already has the settings (expose_router_debug_in_errors, trusted_proxy_ranges, background_health_check_model_groups). The change is configuration and comments only, with no new code.
Acceptance Criteria
- After the rollout, Loki shows no client-facing error message that holds
Fallbacks=[. The gateway log still records the provider failure. -
trusted_proxy_rangesstays unset, and a comment ingeneral_settingsnames the 3 inbound paths and the reason for the WARNING. - The comments at
deployment.yaml:77-89match the behavior of LiteLLM 1.103.11.telemetry: falseandLITELLM_TELEMETRYare removed or marked as not read. -
config.yaml:128names the hosted fallback chain. Comments explain the empty health column and theembeddingid. - The gateway starts with no new WARNING line.
Activity
dan-petty commentedon Nov 13, 2026
Warnings and stale comments cause operator confusion but do not break the gateway.Both are chores on k8s/llm/gateway files, but #732 bumps the image version while this candidate sets a config flag and fixes comments.chore(k8s): quiet the gateway config warnings and correct its comments (
test(core): pin the absent LiteLLM telemetry keys (#5302)