LLM Router Monitor
English | 简体中文
Monitor LLM Routers and inference workers from one dashboard.
- Automatic Router detection and worker grouping by model.
- 15 per-model trend charts, rank details, and health reasons.
- English/Chinese, light/dark themes, and a self-contained HTML interface.
Install and run
Python 3.10+:
python -m pip install llm-router-monitor
rmon http://127.0.0.1:4000
Open localhost:8899. llm-router-monitor is equivalent to rmon; all options are listed in rmon --help.
| Option | Purpose |
|---|---|
--metrics-url URL |
Prometheus endpoint |
--admin-url URL |
Separate admin endpoint |
--worker URL |
Add a worker; repeat for multiple endpoints |
--router-type TYPE |
Override automatic detection |
--web-port PORT |
Dashboard port; default 8899, 0 for terminal only |
--interval SECONDS |
Collection interval; default 2 |
The dashboard binds to 0.0.0.0. Set ROUTER_API_KEY for Router authentication and WORKER_API_KEY for worker authentication. The positional URL takes precedence over --router-url and ROUTER_URL.
Supported Routers
Enable the Router's metrics endpoint or exporter before connecting.
| Router | Discovery and metrics |
|---|---|
| SGLang | /workers; rank health, load, and inference metrics |
| vLLM Production Stack | Worker discovery from Router metric labels |
| Standalone vLLM | Direct engine metrics |
| LiteLLM | /model/info and deployment metrics; enable the Prometheus callback |
| NVIDIA Dynamo | Model deployments and frontend metrics |
| Envoy | Admin /clusters?format=json and upstream metrics |
| NGINX Plus | Upstreams exposed by the Prometheus exporter |
| Traefik | Upstreams exposed by enabled health checks |
| NGINX OSS, HAProxy, Kong, Ray Serve | Proxy metrics; configure engines with --worker |
| Other proxies | Configure SGLang/vLLM engines with --worker |
Envoy and bare NGINX Plus addresses are discovered as HTTP endpoints. Use --worker for HTTPS or custom paths.
Envoy with a separate admin listener:
rmon http://127.0.0.1:8080 \
--admin-url http://127.0.0.1:9901 \
--metrics-url http://127.0.0.1:9901/stats/prometheus
Exporter with explicit workers:
rmon http://127.0.0.1:8080 \
--metrics-url http://127.0.0.1:9113/metrics \
--worker http://worker-a:8000 --worker http://worker-b:8000
Metrics
- TTFT/ITL use count-weighted counter deltas; cache hit uses a 60-second token-weighted window.
- Missing values remain missing. TTFT/ITL connect valid observations; other charts bridge gaps up to 30 seconds with dashed lines. Collection outages and unavailable models stay disconnected.
- Axes adapt to the data: nonnegative values, percentages within 0–100%, and integer count ticks.
- Settings saves the window, refresh interval, language, and theme. Enter minutes for the window and seconds for refresh; decimals are supported.
- The default window is 24 hours, starting no earlier than the first sample. History accumulates in memory until the monitor restarts.
| Endpoint | Response |
|---|---|
/data |
Router metadata, summaries, worker rows, and per-model metrics |
/history?n=100 |
Samples with at (Unix seconds) and by_model |
SGLang maintenance
These policies apply to SGLang-managed registrations only.
| Option | Default | Action |
|---|---|---|
--unregister-unavailable-after SECONDS |
1800 |
Unregister a host after all ranks stay unhealthy and idle, followed by a failed connection probe; 0 disables cleanup |
--keepalive |
Off | Send short inference requests to observed idle workers |
--auto-unregister |
Off | Remove registrations whose model differs from the serving model |
Recovery, re-registration, or lost registry visibility resets the cleanup timer. Keepalive backs off after failures. Worker processes continue running after deregistration.
To launch SGLang Router, install a compatible sglang_router runtime exposing RouterArgs, then run bash scripts/router.sh. Monitor it with rmon --host 127.0.0.1 (API 2730, metrics 29000).
Development
Keep runtime modules flat in router_monitor/:
| Responsibility | Modules |
|---|---|
| Entry and lifecycle | cli.py, config.py, router.py |
| Collection and metrics | collectors.py, sources.py, worker.py, metrics.py, http.py |
| State and maintenance | state.py, maintenance.py |
| Presentation | visualization.py, dashboard.py, templates/dashboard.html |
Shell entries live in scripts/; behavioral tests live in tests/. Frontend tests require Node.js.
python -m pip install -e '.[dev]'
python -m unittest discover -s tests
ruff check .
ruff format --check router_monitor tests
python -m build
Build outputs are written to dist/. Install a wheel with python -m pip install dist/llm_router_monitor-0.0.1-py3-none-any.whl.
Metadata
Release files for llm-router-monitor 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| llm_router_monitor-0.0.1.tar.gz | 485.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_router_monitor-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 775.9 kB
Release files / llm_router_monitor-0.0.1.tar.gz
| Download URL | llm_router_monitor-0.0.1.tar.gz |
|---|---|
| Size | 485.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b951935cecd4840e6d98747eeca7640984adf7d4fd0f58b21fca46e89a3b7b1
|
|
BLAKE2b-256 checksum How to use checksums |
d5c23e26a752bc869d545775ef51bdced81ea75157a97dcbfa2e4473e55e32a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / llm_router_monitor-0.0.1-py3-none-any.whl
| Download URL | llm_router_monitor-0.0.1-py3-none-any.whl |
|---|---|
| Size | 290.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8c92ec094729e7921b86c937b2d981aec22f50c5166ed82478d2fe0ef8824303
|
|
BLAKE2b-256 checksum How to use checksums |
51399cadc087c41ef79a6c87d96d33a7c26ead854b30350d56867bacdbe3a6c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for llm-router-monitor 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for llm_router_monitor-0.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.