Skip to content

docs: document fallback_budget_check and enforce_fallback_budget - #1493

Merged
ryan-crabbe-berri merged 2 commits into
BerriAI:mainfrom
runjivu:docs/fallback-budget-check
Sep 16, 2026
Merged

ryan-crabbe-berri merged 2 commits into
BerriAI:mainfrom
runjivu:docs/fallback-budget-check

Conversation

@runjivu

@runjivu runjivu commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Documents fallback_budget_check, added to Router.__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_check is the budget sibling of the existing fallback_access_check and is documented the same way. Unlike enforce_fallback_model_access, it is on by default, because it closes a budget bypass rather than adding an optional restriction. enforce_fallback_budget: false is the opt-out.

Changes

  • docs/proxy/config_settings.md: fallback_budget_check row in the router_settings reference, next to fallback_access_check
  • docs/proxy/config_settings.md: enforce_fallback_budget row in the general_settings reference, documented as true by default, plus the matching yaml entry
  • docs/proxy/reliability.md: new "Enforce Budget on Fallbacks" section, mirroring "Enforce Key Model Access on Fallbacks", with the opt-out snippet

Note on merge order

BerriAI/litellm#41379 cannot go green until this merges. tests/documentation_tests/test_router_settings.py reflects over Router.__init__ and requires every kwarg to appear in the router_settings - Reference table; CI checks this repo's default branch out into docs/my-website, so the code PR's documentation and code-quality jobs fail with:

Exception: Keys not documented in 'router settings - Reference': {'fallback_budget_check'}

Verified locally with this branch checked out at docs/my-website:

$ python ./tests/documentation_tests/test_router_settings.py
All keys are documented in 'router settings - Reference'.

test_env_keys.py, test_api_docs.py and test_circular_imports.py also pass. test_general_setting_keys.py fails on 31 unrelated keys, identically at the code PR's merge base, so it is pre-existing drift and not from either PR.

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>
@vercel

vercel Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
litellm Ready Ready Preview Sep 16, 2026 9:37pm UTC

Request Review

@ryan-crabbe-berri
ryan-crabbe-berri merged commit bc681b0 into BerriAI:main Sep 16, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
Preview — e6fb2bc7 Deployed Sep 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants