LiteLLM Rust Gateway Benchmarked: Fast and Tiny, but Not Yet a Python Proxy Replacement
Why We Brought This Tool Into Our Lab We did not bring LiteLLM into the lab because another millisecond matters on a 12-second reasoning request. We brought it in because gateway overhead becomes operationally expensive when traffic consists of embeddings, classifiers, guardrail calls, short agent turns, and other fast requests issued at high concurrency. p99 added latency by gateway LiteLLM Rust…
The research team examined the LiteLLM Rust Gateway benchmark to understand its performance and potential as a replacement for an existing Python proxy. While the Rust version showed impressive speed, adding just 0.7 milliseconds at the 99th percentile, the Python proxy took 257.7 milliseconds. However, these figures only reflect the forwarding path and do not include essential features like logging, persistence, and spend tracking that are crucial in real-world deployments.
The team also noted that the Rust gateway could be integrated in two ways: as a standalone service handling all routing and network operations, or as a hybrid mode where the Python server manages the bulk of the work but offloads the network operations to the Rust core. Despite these impressive numbers, the benchmark did not consider the broader gateway workload, such as provider queueing, internet variance, rate limits, or model generation time.
To get a more accurate picture, the team suggested creating a mock environment that isolates the Rust gateway from these external factors. They proposed a Docker Compose setup where a lightweight Python mock server runs alongside the LiteLLM Rust proxy, allowing for a controlled test environment that better reflects real-world conditions.
Ultimately, the benchmarker emphasized that while Rust can forward JSON faster than Python, it's not yet a complete replacement for an existing Python gateway due to the absence of critical features and the narrowly focused benchmarking approach.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.