Repository navigation
refactor(cache): remove dead Cache._native_cache runtime path - #44785
Merged
Merged
Conversation
The native response-cache runtime attached through Cache._native_cache is unreachable since the V2 cache replaced it. Drop the Python branches and wrapper, the _ResponseCacheRuntime pyclass and its backend/activation/ semantic modules, the python-bridge deps only they used, and the tests and fixtures dedicated to that path. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
yujonglee-berri
approved these changes
Oct 6, 2026
Contributor
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.
Summary
Cache._native_cachehas had no assigner since #43601, and the V2 cache (litellm/_v2/cachepluspython-bridge/src/cache/native/v2.rsandNativeCacheHandle) replaced it. Everything reachable only through that slot is removedPython: the
_native_cacheattribute and its branches inget_cache,async_get_cache,add_cache,async_add_cacheandasync_add_cache_pipeline, the_native_response,_native_requestand_stamp_semantic_similarityhelpers,litellm/rust_bridge/response_cache.py, and the_ResponseCacheRuntimestub in_native.pyi. Python cache reads and writes keep going throughself.cache/dynamic_cache_objectexactly as beforeRust (
python-bridge/src/cache/):runtime.rs(_ResponseCacheRuntime,CacheBinding),future.rs,python/callback.rs, andnative/{activation,backend,config,embedder,facade,identity,request,semantic}.rs, plus the_ResponseCacheRuntimeregistration inlib.rs.native/v2.rsusedsuper::request::now(), so it now has its ownnow().selection.rs,python/{host,service}.rsandnative/v2.rsstayDeps dropped from
python-bridgeonly:litellm-cache-{azure-blob,s3,gcs,disk,redis-semantic,qdrant-semantic,valkey-semantic},qdrant-client,url, and thesha2dev-dependency. The crates themselves and their tests are unchangedTests:
tests/test_litellm_rust/cache/test_{redis,s3,gcs,azure_blob,disk,redis_semantic,valkey_semantic,qdrant_semantic,facade,rollout}.py,support/s3_stub.pywith its fixture, and theactivate_native/native_runtime/CacheTestResolverhelpers insupport/cache.pyVerified locally:
cargo clippy -p litellm-python-bridge --all-targets -- -D warningsclean,tests/unit/caching588 passed,tests/test_litellm_rust/cache+tests/unit/rust_bridge1286 passed withLITELLM_RUST=1on a rebuilt extension,make checkPASSLink to Devin session: https://app.devin.ai/sessions/2ace2cec0f4e485f8cad590dbf4a1473
Open in Devin Desktop: https://app.devin.ai/desktop/session/2ace2cec0f4e485f8cad590dbf4a1473?variant=devin
Requested by: @yujonglee-berri