mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-01 01:18:34 +00:00
Every spend:* reader and writer (auth budget checks, reservations and lease renewal, post-call increments, reseed, resets, key/team/user/tag endpoints, shadow eval) now goes through litellm/redis/stores/spend_counters.py, backed by litellm-redis-store's spend_counters module. Keys, value bytes (json.dumps for SET, str() for the set-max script), TTLs and the set-max Lua script match what main writes, pinned by matching inline cases in the Rust and Python tests. The auth budget read rides the request's native pre-call batch through a native flush hook, so it leaves in the same pipeline as the armed cooldown read, and post-call increments ride the native post-call batch. The auth-cache invalidation subscriber forwards spend:* broadcasts to the native memory tier. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> The spend store sends the commands main does. One MGET for a batched read, INCRBYFLOAT with EXPIRE on its own pipeline for increment_many, async_set_max as a plain EVAL, and the reset job's deletes as multi-key DEL in chunks of 1000. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _event_loop_reuse.py | ||
| test_azure_blob_cache.py | ||
| test_cache_preset_key.py | ||
| test_caching.py | ||
| test_caching_handler.py | ||
| test_check_and_fix_namespace_none_guard.py | ||
| test_dual_cache.py | ||
| test_embedding_router.py | ||
| test_evicted_client_closer.py | ||
| test_gcs_cache.py | ||
| test_in_memory_cache.py | ||
| test_llm_caching_handler.py | ||
| test_llm_client_cache_e2e.py | ||
| test_qdrant_semantic_cache.py | ||
| test_redis_batch.py | ||
| test_redis_cache.py | ||
| test_redis_cluster_cache.py | ||
| test_redis_cluster_node_isolation.py | ||
| test_redis_connection_pool.py | ||
| test_redis_semantic_cache.py | ||
| test_request_redis_batch_post_call.py | ||
| test_request_redis_batch_pre_call.py | ||
| test_responses_stream_cache_keys.py | ||
| test_s3_cache.py | ||
| test_unit_test_caching.py | ||
| test_valkey_semantic_cache.py | ||