sglang-router
High-performance Rust-based load balancer for SGLang with multiple routing algorithms and prefill-decode disaggregation support
Decision gist · record as of 2026-08-14
Yes, if you are deploying distributed SGLang inference at scale and need sophisticated load balancing, prefill-decode disaggregation, or multi-model orchestration. The package is in the top 15000 on PyPI, has no known vulnerabilities, and offers production-grade observability and reliability features. The aging maintenance status (211 days since last release) is a minor concern for a specialized infrastructure tool but warrants monitoring for security updates. Not recommended for simple single-worker or non-SGLang deployments.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Rust toolchain (rustc, cargo) if building from source; system OpenSSL development headers (libssl-dev or openssl-devel) for development builds.
- Pre-built wheels bypass Rust compilation for standard platforms.
- Medium install friction due to Rust compilation requirements and system dependencies (libssl-dev or openssl-devel).
License · maintenance · safety
Apache-2.0 (permissive) — Licensed under Apache-2.0 (permissive), allowing commercial use, modification, and redistribution with minimal restrictions. No notable licensing constraints for most use cases.
last release 2026-01-15 (211 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 680,213 downloads/mo, #5,366 on PyPI
Alternatives
Verify before relying
pip install sglang-router
python3 -m sglang_router.launch_router \
--worker-urls http://worker1:8000 http://worker2:8000 \
--policy cache_aware- Performance benchmarks comparing different load-balancing strategies under realistic LLM workloads.
- Kubernetes integration maturity and production deployment patterns.
- Compatibility with non-SGLang model serving backends beyond OpenAI-compatible proxying.
- Scaling limits and performance characteristics at very large worker fleet sizes.
What it is and what it does
sglang-router is a Rust-based gateway that orchestrates distributed inference workloads across fleets of SGLang model workers. It sits between clients and worker nodes, routing requests using pluggable strategies (random, round_robin, cache_aware, power_of_two, bucket), managing prefill-decode disaggregation for efficient batching, and exposing OpenAI-compatible REST endpoints. The gateway handles reliability concerns—retries with backoff, circuit breakers, token-bucket rate limiting, and request queuing—while maintaining observability through Prometheus metrics and OpenTelemetry tracing.
The package is designed for large-scale LLM deployments where traffic needs to be balanced across heterogeneous worker pools, models need to be served concurrently, and inference stages (prefill and decode) can be separated for independent scaling. It integrates with SGLang's serving runtime deeply, including native Rust tokenization, reasoning parsing, and tool-call execution, while also supporting external OpenAI-compatible backends. Runtime dependencies (fastapi, uvicorn, aiohttp, orjson, setproctitle) enable the Python launcher and async HTTP handling.
Use it for
- Route inference requests across multiple SGLang workers with cache-aware load balancing to minimize redundant computation.
- Separate prefill and decode stages across dedicated worker pools to optimize throughput and latency independently.
- Proxy OpenAI API requests to multiple remote vendors while maintaining streaming semantics and conversation state.
- Monitor and control multi-model inference deployments with per-model policies, circuit breakers, and dynamic worker discovery.
- Serve reasoning-capable models with native tokenization and tool-call parsing via gRPC.
- Centralize conversation history and state management across model fleets with pluggable storage backends.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are deploying distributed SGLang inference at scale and need sophisticated load balancing, prefill-decode disaggregation, or multi-model orchestration.
The package is in the top 15000 on PyPI, has no known vulnerabilities, and offers production-grade observability and reliability features. The aging maintenance status (211 days since last release) is a minor concern for a specialized infrastructure tool but warrants monitoring for security updates. Not recommended for simple single-worker or non-SGLang deployments.
Install
sglang-router on PyPI
Before you install
Medium install friction due to Rust compilation requirements and system dependencies (libssl-dev or openssl-devel). The package provides pre-built wheels for Python 3.8+ across major platforms (x86_64, ARM64, macOS, Linux, Windows), reducing friction for standard environments. Maintenance status is aging—last release was 211 days ago—so expect slower updates.
Requires Rust toolchain (rustc, cargo) if building from source; system OpenSSL development headers (libssl-dev or openssl-devel) for development builds. Pre-built wheels bypass Rust compilation for standard platforms.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial use, modification, and redistribution with minimal restrictions. No notable licensing constraints for most use cases.
Quickstart
pip install sglang-router
python3 -m sglang_router.launch_router \
--worker-urls http://worker1:8000 http://worker2:8000 \
--policy cache_aware
Verify before relying
- Performance benchmarks comparing different load-balancing strategies under realistic LLM workloads.
- Kubernetes integration maturity and production deployment patterns.
- Compatibility with non-SGLang model serving backends beyond OpenAI-compatible proxying.
- Scaling limits and performance characteristics at very large worker fleet sizes.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 5 packagessetproctitleaiohttporjsonuvicornfastapi |
| Maintenance | Aging 211 days since the last release |
| First released | |
| Downloads | 680,213 / month, #5,366 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Rust |
Evidence: sglang_router-0.3.2-cp38-abi3-macosx_10_12_x86_64.whl; sglang_router-0.3.2-cp38-abi3-macosx_11_0_arm64.whl; sglang_router-0.3.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; sglang_router-0.3.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; sglang_router-0.3.2-cp38-abi3-musllinux_1_1_aarch64.whl; sglang_router-0.3.2-cp38-abi3-musllinux_1_1_x86_64.whl; sglang_router-0.3.2-cp38-abi3-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “llm model gateway routing”
- sglang-routerA high-performance Rust-based load balancer and gateway for routing…
- litellmLiteLLM provides a unified Python interface to call 100+ LLM…
- unclecode-litellmUnified Python interface to call many LLM providers (OpenAI,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework that enables you to define and call remote procedures across network boundaries using protocol buffers for serialization.
Install it if you need RPC communication in a distributed system or are integrating with existing gRPC services.
execnet lets you spawn and communicate with Python interpreters across local processes, remote hosts, and different platforms, using a simple API for task distribution and inter-process messaging.
However, the aging maintenance status (275 days since last release) means you should verify it meets your concurrency and performance needs before committing to a…
Cloudpickle extends Python's standard pickle module to serialize lambda functions, interactively-defined functions and classes, and other constructs that the default pickle cannot handle, making it suitable for cluster computing and remote code execution.
Install it if you need to serialize lambda functions, interactively-defined code, or non-standard Python constructs for cluster computing or distributed execution.
Provides a unified, open()-compatible Python API for streaming large files from remote storage (S3, GCS, Azure, HDFS, SFTP, HTTP) and local filesystems, with transparent compression support.
Install it if you work with large files on cloud storage or remote systems and want to avoid writing boilerplate around multiple SDKs.
Portalocker provides cross-platform file locking with support for exclusive and shared locks, plus Redis-based distributed locks and process-aware PID file locking.
Install it if you need file or process coordination; the optional extras (pywin32, redis) are only required for specific lock types.
Ray is a distributed computing framework that scales Python applications from a single machine to multi-node clusters, providing abstractions for parallel tasks, stateful actors, and shared objects.
See also vllm-router · sanic-routing · sglang · vllm · vllm-sr · mooncake-transfer-engine · vllm-tpu · smg-grpc-servicer · semantic-router · pybgpkit-parser