Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseCode / SDK · ActionableHabr AI→ original

A LiteLLM gateway with two worker processes handles 130 requests per second, OmniRoute handles 36

A gateway to language models gives you one address instead of a dozen APIs, but it can become a bottleneck itself. Instead of a real model, we used an instant stub and compared the open-source LiteLLM and OmniRoute: with two worker processes, LiteLLM handles 130 regular requests per second, OmniRoute 36. On streaming responses with one core, OmniRoute leads: 25 versus 20. For tracking team spending, choose LiteLLM; for personal agents running on subscriptions, choose OmniRoute.

AI-processed from Habr AI; edited by Hamidun News
A LiteLLM gateway with two worker processes handles 130 requests per second, OmniRoute handles 36
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Out of the box, OmniRoute manages about 1 request/s because of its rate-limit protection
LiteLLM in Docker occupies one core--num_workers 2 is almost twice as fast
Overhead per request14 ms for LiteLLM, 30 ms for OmniRoute

Imagine that five services in your company call AI models from two different providers. Each one needs its own key, its own spending limit, and a fallback in case of failure. To avoid building all of this into every service, teams put a gateway in front: a single address compatible with the OpenAI API that decides where each request goes.

This convenience has a cost: the gateway becomes an extra link and a point of failure. Technical writer Ivan Bogdanov measured that cost for two popular open-source gateways, LiteLLM and OmniRoute. The headline number: LiteLLM with two worker processes handles 130 regular requests per second, while OmniRoute handles 36.

This is the gateway's own ceiling: the model in the test was replaced with a stub that responds instantly, so all the time is spent in the gateway. But this figure comes with a caveat, discussed below.

Two gateways for different tasks

LiteLLM is written in Python and FastAPI. A engineering team typically deploys it in front of all internal services: each service gets a key with a monthly dollar limit, and spending across all keys is collected in Postgres. This shows how much each department spends. Inside, there is a router with retries and fallback models.

OmniRoute is written in TypeScript and Next.js, runs on Node.js, and stores data in Redis and a local directory. It is aimed more at a single developer who works in Claude Code, Codex, or Cursor and wants to connect all of their subscriptions at once. When one provider runs out of quota, OmniRoute automatically sends the next request to another, and the agent keeps working without reconfiguration. For this, it offers "combos", chains of models with automatic switching. The project page claims more than 370 providers, from paid APIs to free tiers.

How we tested and what we found

Each gateway was given two cores on a separate virtual server. The stub returned 50 tokens, either as a single response or as fifty fragments of a streamed response (streaming). Load was applied in steps: 1, 10, 50, 100, and 200 concurrent clients, 30 seconds per step. Versions: LiteLLM 1.106.0 and OmniRoute 3.8.52.

An important caveat: the server running OmniRoute turned out to be about 1.5 times slower than the server running LiteLLM. Therefore, for identical hardware, the authors estimate OmniRoute's ceiling at roughly 56 regular and 37 streaming requests per second. Even with this adjustment, LiteLLM with two processes is ahead.

Results:

  • LiteLLM with one process: 71 regular and 20 streaming requests per second, overhead per request 14 ms, peak memory 0.9 GB.
  • LiteLLM with two processes: 130 and 38.5 requests per second, memory up to 2.1 GB.
  • OmniRoute with rate-limit protection disabled: 36 and 25 requests per second, overhead 30 ms, memory 1.2 GB.

LiteLLM handles a single request more cheaply, while OmniRoute handles each streaming fragment more cheaply: about 0.2 ms versus 0.6 ms. On a response from a live model of 500 tokens, the gateways will add about 0.3 and 0.1 seconds; against seconds of generation time, this is almost imperceptible.

Latency under overload can be estimated in advance: divide the number of clients by the throughput. For LiteLLM with one process, that is 200/18, about 11 seconds, and in the test half of the requests took longer than 10.6 seconds. The slowest requests (the worst 1%) on OmniRoute waited 30 and 35 seconds at 100 and 200 clients; on LiteLLM with one process, they waited 4.5 and 13.6 seconds.

Default settings traps

OmniRoute ships with rate-limit protection enabled. On the stub, it became a brake: the gateway passed about one request per second and started returning errors under load. If your own model or a paid API sits behind the gateway, disable the protection, or you will hit it instead of the model.

LiteLLM's trap is different. In Docker, it runs as a single Python process and occupies one core, no matter how many are allocated. The flag --num_workers 2 almost doubles throughput, from 71 to 130 requests per second, but each process keeps its own copy of the gateway in memory. Additionally, LiteLLM writes a spending log entry for every request, and with two processes Postgres reached nearly a full core at peak. On a four-core server, that is a lot, so the database may need to be moved to a separate machine. The authors found no equivalent of --num_workers for OmniRoute; it has to be scaled by running several instances behind a load balancer.

What to choose and the limitations

  • Spending tracking by department and many short requests: LiteLLM, with the number of processes matched to the number of cores.
  • A programming agent with long streaming and several subscriptions: OmniRoute.

The test's limitations are significant. The load is synthetic, the response is always 50 tokens, and the model is replaced with a stub. The hardware adjustment is rough. There are no independent benchmarks for OmniRoute, and the published LiteLLM figures come from its own developers. Fallback models, retries, and caching were not included in the measurements. It is best to run the tests on your own workload.

Story

Key Questions Answered

What are the key details on Two gateways for different tasks?

LiteLLM is written in Python and FastAPI. A engineering team typically deploys it in front of all internal services: each service gets a key with a monthly dollar limit, and spending across all keys is collected in Postgres. This shows how much each department spends. Inside, there is a router with retries and fallback models. OmniRoute is written in TypeScript and Next.js, runs on Node.js, and stores data in Redis and a local directory.

How we tested and what we found?

Each gateway was given two cores on a separate virtual server. The stub returned 50 tokens, either as a single response or as fifty fragments of a streamed response (streaming). Load was applied in steps: 1, 10, 50, 100, and 200 concurrent clients, 30 seconds per step. Versions: LiteLLM 1.106.0 and OmniRoute 3.8.52. An important caveat: the server running OmniRoute turned out to be about 1.5 times slower than the server running LiteLLM.

What are the key details on Default settings traps?

OmniRoute ships with rate-limit protection enabled. On the stub, it became a brake: the gateway passed about one request per second and started returning errors under load. If your own model or a paid API sits behind the gateway, disable the protection, or you will hit it instead of the model. LiteLLM's trap is different. In Docker, it runs as a single Python process and occupies one core, no matter how many are allocated.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — A LiteLLM gateway with two worker processes handles 130 requests per second, OmniRoute handles 36 https://news.hamidun.com/en/news/18322/a-litellm-gateway-with-two-worker-processes-handles-130-requ

What do you think?
Loading comments…