mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-02 01:28:38 +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. |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| AGENTS.md | ||
| Cargo.toml | ||