Skip to main content

sgtop

Linux macOS Usage PyPI Python License Contributors

A btop-style terminal dashboard for a live SGLang deployment. Not affiliated with the SGLang project — just a small, read-only tool that never touches your inference traffic.

sgtop screenshot

nvtop will tell you a GPU is at 98% utilization. It won't tell you whether your sglang server can actually take more concurrent requests, whether one data-parallel replica is sitting idle while another is drowning, or what your real time-to-first-token looks like. That's what this is for: concurrency vs. the capacity sglang actually computed at startup, KV-cache headroom per replica, and (with --enable-metrics) rolling TTFT/E2E/queue-time percentiles.

Install

pipx install sgtop

Pure standard library, no dependencies, Python ≥ 3.9. pip install --user sgtop works too if you don't have pipx.

Quick start

Point it at a running sglang instance — that's it, nothing else to run:

sgtop --host <sglang-host> --port 30000

Leave out --port entirely and it'll probe a handful of common ports for you. For the LATENCY panel (TTFT / end-to-end / queue-time / cache-hit-rate), start sglang with --enable-metrics; without it you still get concurrency, KV-cache usage, and decode throughput straight off sglang's own API. Prometheus histograms are cumulative counters, so sgtop diffs consecutive scrapes itself to give you an actual rolling 5-minute p50/p90/p99, not a number that just drifts toward whatever your first few requests looked like.

Run sgtop right on the sglang box (or ssh in and run it there) and the GPU panel fills in for free — it shells out to the local nvidia-smi, i.e. whatever's on the machine sgtop itself is running on. Watching a remote instance from somewhere without GPUs of its own just leaves that panel empty, correctly.

The optional sidecar

The one thing sglang's own API genuinely can't give you is a recent-errors line — that needs its log file, which isn't exposed over HTTP at all. For that there's sgtop-server, a small sidecar you can run on the sglang box that also tails its log:

python -m sglang.launch_server --model-path ... --enable-metrics > server.log 2>&1 &
sgtop-server --log server.log --service-port 30000 --port 30001 &
sgtop --port 30001    # or --mode proxy to skip auto-detection

It also serves a plain HTML version of the same data at http://<host>:30001/. Everything else — concurrency, KV-cache, latency — works exactly the same with or without it.

q quits. That's the whole interface.

Watching a fleet of servers

If you've got several machines on the same LAN each running their own sglang, --fleet gives you one screen with a card per server instead of running sgtop four times in four terminals:

sgtop --fleet 'A=10.0.0.1:30001,B=10.0.0.2:30001,C=10.0.0.3:30001,D=10.0.0.4:30001'

--fleet also takes a file path instead of an inline string, one name=host:port per line, # comments allowed — handy once you've got more than two or three boxes.

Each entry is auto-probed the same way single-host mode is, so a plain sglang instance (direct mode) and a sgtop-server sidecar (proxy mode) can be mixed freely in the same fleet. The catch is the same as single-host mode: direct mode only ever shows local GPU stats, i.e. whichever machine sgtop itself is running on, so a genuinely remote box in direct mode shows GPU n/a in its card. To get a real GPU panel and an error count per remote server, run sgtop-server there too and point the fleet entry at its port instead of sglang's own — everything else (concurrency, decode throughput, cache-hit) works either way.

License

MIT

Metadata

Release files for sgtop 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sgtop 0.1.7
File Size Uploaded Provenance
sgtop-0.1.7.tar.gz 32.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sgtop 0.1.7
File Interpreter ABI Platform
sgtop-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 67.3 kB

Release files / sgtop-0.1.7.tar.gz

Download URL sgtop-0.1.7.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
045571074a156da49e87c4bacf297ae3ccb3a38fcbce4231ef8e49af1dd0ee36
BLAKE2b-256 checksum
How to use checksums
a36742df6c62e0d07371e66760ec65b02743493a753b6639d388057a3ba2c01e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 7, 2026.

Transparency log

Release files / sgtop-0.1.7-py3-none-any.whl

Download URL sgtop-0.1.7-py3-none-any.whl
Size 34.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22ae631cb7d5a029927ecef4daf68f22b9539cc5b88531381c4a697c383066cc
BLAKE2b-256 checksum
How to use checksums
5f47b641d1020e8b8696c4e300a76bd5ebc90e37cc24a7758d3334e0cb838761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 7, 2026.

Transparency log

Security for sgtop 0.1.7

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.

Select from 2 files

Attestation for sgtop-0.1.7.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 Sep 7, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page