litellm/litellm-rust/crates/redis-client
Yujong Lee f135feeccd feat(redis): move the spend counter keyspace onto the Rust store
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.
2026-11-05 13:26:28 +09:00
..
src feat(redis): move the spend counter keyspace onto the Rust store 2026-11-05 13:26:28 +09:00
tests feat(redis-client): publish and resubscribing subscribe for pub/sub 2026-11-05 13:21:56 +09:00
AGENTS.md feat(redis-client): publish and resubscribing subscribe for pub/sub 2026-11-05 13:21:56 +09:00
Cargo.toml feat(redis): rotating cloud credentials for Redis 2026-11-05 13:21:52 +09:00