Repository navigation
fix(proxy): increase spend counter cache capacity - #40233
Open
wzj1228516103 wants to merge 1 commit into
Open
wzj1228516103 wants to merge 1 commit into
wzj1228516103 wants to merge 1 commit into
Conversation
Contributor
Greptile SummaryThe PR increases the dedicated in-memory spend-counter cache capacity from 200 to 10,000 entries while retaining existing cache behavior
Confidence Score: 5/5The PR appears safe to merge and the capacity change is bounded and covered by a focused regression test No actionable failure remains; the supplied cache preserves prior semantics while increasing the eviction threshold as intended
|
| Filename | Overview |
|---|---|
| litellm/proxy/proxy_server.py | Configures the dedicated spend-counter cache with a bounded 10,000-entry in-memory capacity |
| tests/test_litellm/proxy/test_proxy_server.py | Adds a focused regression test proving an early counter remains cached after inserting 300 scopes |
Reviews (1): Last reviewed commit: "fix(proxy): increase spend counter cache..." | Re-trigger Greptile
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
4 of 12 tasks
devin-ai-integration
Bot
changed the base branch from
litellm_internal_staging
to
main
September 23, 2026 14:39
This branch has not been 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.
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a proxy serving more than 200 active budget scopes repeatedly reloads warm spend counters
After: the same traffic keeps active spend counters available during the configured TTL
Relevant issues
Fixes #40221
Linear ticket
Pre-Submission checklist
link.exewhile building LiteLLM's Rust/PyO3 editable packageScreenshots / Proof of Fix
After (8cb42ca)
py -3.13 -m py_compile litellm/proxy/proxy_server.py tests/test_litellm/proxy/test_proxy_server.pycompleted successfullygit diff --checkcompleted successfullylink.exerequired for the editable Rust/PyO3 buildType
Bug Fix
Caveats
The cache remains bounded at 10,000 entries and keeps the existing TTL behavior
Final Attestation