Repository navigation
docs: document fallback_budget_check and enforce_fallback_budget - #1493
Merged
ryan-crabbe-berri merged 2 commits intoSep 16, 2026
Merged
Conversation
Router gained `fallback_budget_check` (BerriAI/litellm#41379), the budget sibling of `fallback_access_check`: budget is enforced once during auth against the requested model group, while the fallback target is chosen afterwards inside the router, so a zero-cost model with a paid fallback bills with no budget gate. Adds the `router_settings` reference row, the `general_settings` reference row and yaml entry for `enforce_fallback_budget`, and an "Enforce Budget on Fallbacks" section mirroring "Enforce Key Model Access on Fallbacks". Relates to BerriAI/litellm#41344 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
4 of 6 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents
fallback_budget_check, added toRouter.__init__in BerriAI/litellm#41379.Why
Budget is enforced once during auth, against the model group the caller requested. The fallback target is chosen afterwards, inside the router, so on its own that check cannot see the group that actually bills. This bites hardest when the primary is priced at zero: a zero-cost model skips budget checks entirely, so without a second check the request is admitted, falls back to the paid model, and bills in full with no cap applied.
fallback_budget_checkis the budget sibling of the existingfallback_access_checkand is documented the same way. Unlikeenforce_fallback_model_access, it is on by default, because it closes a budget bypass rather than adding an optional restriction.enforce_fallback_budget: falseis the opt-out.Changes
docs/proxy/config_settings.md:fallback_budget_checkrow in therouter_settingsreference, next tofallback_access_checkdocs/proxy/config_settings.md:enforce_fallback_budgetrow in thegeneral_settingsreference, documented astrueby default, plus the matching yaml entrydocs/proxy/reliability.md: new "Enforce Budget on Fallbacks" section, mirroring "Enforce Key Model Access on Fallbacks", with the opt-out snippetNote on merge order
BerriAI/litellm#41379 cannot go green until this merges.
tests/documentation_tests/test_router_settings.pyreflects overRouter.__init__and requires every kwarg to appear in therouter_settings - Referencetable; CI checks this repo's default branch out intodocs/my-website, so the code PR'sdocumentationandcode-qualityjobs fail with:Verified locally with this branch checked out at
docs/my-website:test_env_keys.py,test_api_docs.pyandtest_circular_imports.pyalso pass.test_general_setting_keys.pyfails on 31 unrelated keys, identically at the code PR's merge base, so it is pre-existing drift and not from either PR.