-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
feat: standardize rate limit errors with category, rate_limit_type, model, and llm_provider fields #27687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mateo-berri
merged 59 commits into
litellm_internal_staging
from
litellm_standardize_rate_limit_errors-5fb4
Jun 7, 2026
Merged
feat: standardize rate limit errors with category, rate_limit_type, model, and llm_provider fields #27687
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
150616c
feat(exceptions): add RateLimitErrorCategory + headers/detail fields …
cursoragent 8360519
feat(proxy): add ProxyRateLimitError unifying RateLimitError + HTTPEx…
cursoragent 39a9968
refactor(proxy/hooks): raise ProxyRateLimitError from budget + iterat…
cursoragent 96af712
refactor(proxy/hooks): raise ProxyRateLimitError from parallel-reques…
cursoragent be5b496
refactor(proxy/hooks): raise ProxyRateLimitError from dynamic rate li…
cursoragent f74c9f1
refactor(proxy/hooks): raise ProxyRateLimitError from batch rate limiter
cursoragent 8f7bdf5
test(rate-limit): pin down unified rate-limit error contract
cursoragent 5f9ab59
feat(logging): expose rate-limit category via StandardLoggingPayload
cursoragent 82f535d
test(rate-limit): assert StandardLoggingPayload carries the category
cursoragent 0e42744
fix(types): silence mypy [misc] on intentional dual-base attr overlap
cursoragent 5a10a75
test(rate-limit): add direct hook-invocation tests to lift patch cove…
cursoragent 113783e
fix: guard rate_limit_category extraction with isinstance check
cursoragent 997f24b
test(rate-limit): cover remaining hook raise sites for codecov
cursoragent d0202b8
fix: use computed error_message in ProxyRateLimitError detail
cursoragent 4e5abe1
fix(parallel-request-limiter): drop None from detail; annotate raise_…
cursoragent 2074848
fix(proxy/hooks): drop literal 'None' from raise_rate_limit_error detail
cursoragent a136c59
fix(types): demote TypedDict floating string to a # comment
cursoragent 4b3d31c
security(exceptions): do not auto-copy vendor response headers to e.h…
cursoragent bcf1989
test(rate-limit): regression guards for review-pass fixes
cursoragent 9778f94
feat(rate-limit): add orthogonal RateLimitType (requests/tokens/concu…
cursoragent 48dcd10
feat(proxy/hooks): wire rate_limit_type onto every limiter raise site
cursoragent f926f0a
test(rate-limit): cover RateLimitType enum, hook wiring, and Standard…
cursoragent 1947ea9
test(rate-limit): cover _coerce_message branches and v1 dimension det…
cursoragent 921cd06
feat(proxy/hooks): add ProxyHTTPRateLimitError + provider resolver
cursoragent 66976f7
fix(proxy/hooks): populate llm_provider on parallel-request 429s
cursoragent e5d5515
fix(proxy/hooks): populate llm_provider on dynamic-rate-limit 429s
cursoragent 127d854
fix(proxy/hooks): populate llm_provider on batch-rate-limit 429s
cursoragent c2af427
fix(proxy/hooks): populate llm_provider on budget/iterations 429s
cursoragent e8ebd2e
test(proxy/hooks): pin provider field on internal rate-limit 429s
cursoragent 24e80ba
perf(proxy/hooks): defer provider resolution to over-limit branches
cursoragent 06e53d3
fix: use error_message in raise_rate_limit_error to avoid literal 'No…
cursoragent 21ccf56
Consolidate rate_limiter_utils imports in dynamic_rate_limiter
cursoragent af811ec
fix(proxy): set num_retries/max_retries on ProxyHTTPRateLimitError
cursoragent d00ad1d
fix(mypy): silence base-class status_code conflict on ProxyHTTPRateLi…
cursoragent af49dbe
fix: annotate batch limiter _raise_rate_limit_error as NoReturn
cursoragent 26abed5
feat(prometheus): rate-limit category/type labels + exception_class b…
mateo-berri e2370b2
merge: fold #27707 (provider/llm_provider on internal rate-limit erro…
cursoragent a748209
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 7e8a077
fix(bugbot): simplify rate-limit label coercion + guard None detail
mateo-berri 807d1b2
fix(rate-limit): surface unified category/type fields on BudgetExceed…
mateo-berri f2d3243
fix(rate-limit): validate enum membership at duck-typed read sites + …
mateo-berri 7747ad0
fix(rate-limit): resolve router model_name aliases to real provider (…
mateo-berri 2621f36
fix(bugbot): preserve "BudgetExceededError" Prometheus label
mateo-berri f3907ea
test: fix invalid 'rpm' rate_limit_type in v3 limiter test mocks
cursoragent 57682ee
fix(bugbot): hoist provider resolver + opt-in prom rate-limit labels
mateo-berri 984f75d
fix: stabilize prometheus label sets and drop redundant model normali…
cursoragent 9c5ff9d
perf(dynamic_rate_limiter): only resolve provider when rate limit hit
cursoragent 5452c2f
test(prometheus): clear cached metric labels after toggling rate-limi…
cursoragent f2d0827
test: fix CI failures from prom label cache + flaky time-window asser…
mateo-berri 11aa696
Merge origin/litellm_internal_staging into litellm_standardize_rate_l…
cursoragent 276714b
feat(otel-v2): surface rate_limit_category + rate_limit_type on faile…
cursoragent 11f78d8
test: align prometheus user-budget + logs quick-select tests with mer…
mateo-berri ff2c03b
Merge branch 'litellm_internal_staging' into litellm_standardize_rate…
mateo-berri e04e4c2
refactor(otel/v2): drop rate-limit decomposition from the LLM-call span
mateo-berri 9c92921
fix(batch_rate_limiter): map max_parallel_requests to concurrent_requ…
cursoragent 443563c
refactor(prometheus): drop transitive fastapi import from _get_except…
mateo-berri a10610f
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 2bb03bf
Merge remote-tracking branch 'origin/litellm_internal_staging' into l…
mateo-berri 1ebf785
chore(ui): sync schema.d.ts with unified rate-limit error spec
mateo-berri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.