The store a router keeps its routing state in (cooldowns, fail counts, usage): in memory, plus Redis when the router's arguments name one. The host builds and owns it; a Rust core reads and writes it through cache steps.
(self, config: RouterConfig)
| 145 | litellm.suppress_debug_info = True |
| 146 | |
| 147 | def routing_cache(self, config: RouterConfig) -> "DualCache": |
| 148 | """The store a router keeps its routing state in (cooldowns, fail counts, usage): in memory, |
| 149 | plus Redis when the router's arguments name one. The host builds and owns it; a Rust core |
| 150 | reads and writes it through cache steps.""" |
| 151 | from litellm.caching.caching import DualCache, InMemoryCache |
| 152 | |
| 153 | return DualCache(redis_cache=redis_cache_for(config), in_memory_cache=InMemoryCache()) |
| 154 | |
| 155 | def router_usage(self, redis: "RedisStores") -> "RouterUsage": |
| 156 | """The per-minute tpm/rpm counters a router counts its deployments' calls in, on ``redis``.""" |
nothing calls this directly
no test coverage detected