TECHNOLOGY

LiteLLM removes Python RedisBatch and makes the pre-call flush boundary explicit

In this article
THE QUICK TAKE

Observe pre-call and post-call completion independently; flushing admission work is not evidence that final model usage has been settled.

LiteLLM v1.111.0-dev.2, released as a prerelease on November 13, removes the Python RedisBatch after request-path operations migrate to the native store. The old flush_all name becomes flush_pre_call because it flushes only that phase. The distinction matters when application instrumentation or extensions mistake completion of a pre-call batch for completion of final usage accounting after inference.

Record a timeline rather than one flush flag

Use a synthetic request that pauses at an owned provider fixture after admission. Record the native pre-call flush, provider entry, response completion and final accounting events separately. The request should still be visibly in flight after pre-call work finishes. This makes the phase distinction concrete and detects a monitoring adapter that marks the entire operation settled when it observes the first completed batch or the renamed method returning.

Extensions must use the supported boundary

Inspect application code that imports internal RedisBatch helpers or assumes flush_all exists. Migrate only against the interfaces actually supported by the chosen package. The PR deletes the class and dead reservation helper; retaining a shadow Python batch in an extension can reintroduce duplicate writes. Check one known increment through the real request path and compare its exact final amount rather than declaring compatibility from a successful import alone.

Failure and cancellation expose missing cleanup

Cancel a harmless request before provider entry and another after the pre-call phase. Add a provider failure control. Inspect the counters and owned cleanup events relevant to each case, without assuming all phases have identical actions. Removing a batch implementation should not leave reservations hanging or count an operation twice. Follow with an ordinary request to expose state left behind that would not be visible in the cancelled response itself.

Do not infer a distributed transaction

The release is an implementation consolidation with clearer phase naming. It does not state that a provider call, an external tool commit and every budget update become one transaction. A useful migration record shows ownership of request-path writes, the pre-call boundary, final accounting and failure cleanup. It gives operators evidence for the gateway lifecycle while preserving separate idempotency and reconciliation duties for business actions outside the native Redis store.

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