TECHNOLOGY

LiteLLM moves router usage accounting onto one native counter family

In this article
THE QUICK TAKE

Check mixed-worker counter continuity, deployment versus router scope and numeric overflow refusals; a native migration must preserve admission meaning.

The November 13 LiteLLM v1.111.0-dev.2 prerelease moves remaining router_usage accounting paths to the native store. Per-deployment counters and global router counters retain distinct scopes while sharing the migrated implementation. The operational question is accounting continuity: a rolling deployment must not split counts between old and new workers or turn an oversized reservation into a negative value that admits more traffic.

Use old and new workers against shared counts

Run controlled old and new workers against the same owned Redis fixture and alternate known usage between them. The implementation retains keys, values and expiry semantics for rolling compatibility. Check each worker’s next admission decision rather than merely reading a key once. A mixed rollout can appear healthy while traffic is divided into separate allowance pools if one writer or reader accidentally uses a new naming convention.

Deployment and global scope cannot be conflated

Configure two synthetic deployments in one router and choose distinct limits for deployment and global_router scopes. Exhaust one deployment without exhausting the router, then exhaust the aggregate separately. Compare routing decisions and relevant counters. The migration introduces an explicit deployment scope next to the global scope; a single-model fixture cannot reveal accidental sharing or separation of those two identities because their totals happen to move together.

Reservation fields need numeric boundary tests

Use synthetic values around the native counter range and an above-limit reservation. The PR reports a 429 before counting a disallowed reservation and prevents an in-memory overflow from wrapping negative. These are accounting safety boundaries, not realistic token-volume benchmarks. Confirm unchanged counters after refusal and a normal accepted request afterward. This establishes that the fix rejects the extreme input without corrupting the allowance for ordinary traffic.

Prefetch completion still needs settlement

Trigger an owned prefetch that routing later does not consume, and inspect completion or reservation release under a controlled refusal. The migration preserves that settlement behavior while moving pre-call and post-call work to native pipelines. A useful adoption record combines mixed-version continuity, scope separation, numeric refusal and abandoned-prefetch cleanup. It demonstrates consistent accounting without claiming that a Rust implementation alone establishes atomicity across every application or provider side effect.

Sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles