﻿# LiteLLM validates fallback overrides before they reach router-core

Inspect actual fallback attempts for valid, ignored and rejected override forms; a successful HTTP response can still mean the configured policy won over client input.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-agent-litellm-fallback-override-validation-contract/
Language: en

The November 13 LiteLLM v1.111.0-dev.2 prerelease validates request-start fields and changes malformed fallback override handling. Standalone string overrides are ignored in favor of configured fallbacks; other invalid values receive a client error rather than an internal shape failure. Applications should test the effective fallback policy, because accepting a request does not establish that a caller-supplied override was applied.

## Use observable configured and requested routes

Create harmless primary and fallback endpoints with distinct markers. Configure one fallback list, then send a scalar string override and force primary failure. Observe which endpoint actually runs. This establishes the newly documented ignore behavior directly. Looking only at successful output could incorrectly convince the client its requested string was honored when the gateway deliberately retained the configured alternatives for that request.

## Null, empty and malformed are separate cases

Build a small matrix covering the supported list form, explicit null, empty list and genuinely invalid structures. Write expected outcomes before execution and compare errors with the existing application handler. An empty list can express an intentional policy, so normalization must not quietly turn it into the same behavior as an ignored scalar. Keep all provider calls synthetic while testing these routing choices.

## Bounded numeric coercion needs edge checks

Exercise max_fallbacks with the numeric representations the application emits and values outside the supported bound. Inspect actual attempt count under deterministic failure. A parsed integer is useful only if the loop respects it. The PR documents ordinary coercion rules rather than a strict JSON-integer-only contract, so deployment validation should name what it accepts instead of assuming a string numeral always produces an error.

## Keep retry and authorization policy intact

Compare retry handling and allowed deployment scope with the same correctly shaped requests before and after the upgrade. Input validation is not authorization to call a fallback model. Preserve provider access checks and bounded retries in the caller. A useful migration record shows effective policy, actual attempt sequence and intentional client errors, replacing a router shape crash with a comprehensible contract without claiming that every legacy malformed request now means what its sender intended.

## Sources

- [LiteLLM v1.111.0-dev.2 prerelease notes](https://github.com/BerriAI/litellm/releases/tag/v1.111.0-dev.2)
- [LiteLLM implementation and review #51502](https://github.com/BerriAI/litellm/pull/51502)

## Related reading

- [LiteLLM Proxy: when to operate your own model gateway](/journal/litellm-proxy-guide/)
- [LiteLLM virtual keys: separate access for each application](/journal/litellm-virtual-key-scopes/)
