sgtop
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.
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.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sgtop-0.1.6.tar.gz.
File metadata
- Download URL: sgtop-0.1.6.tar.gz
- Upload date:
- Size: 27.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54a7c92398269c191360af5f33b604855333f3fa7b59dfb5cce29633b8985530
|
|
| MD5 |
3676f504c46691fcca99bc4befae2a21
|
|
| BLAKE2b-256 |
c3172aa3bbe1c8890df0e96eee123ec60a33c7d86f3839ce66f5d1a9c5b8330e
|
Provenance
The following attestation bundles were made for sgtop-0.1.6.tar.gz:
Publisher:
publish.yml on HarrytheOrange/sgtop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sgtop-0.1.6.tar.gz -
Subject digest:
54a7c92398269c191360af5f33b604855333f3fa7b59dfb5cce29633b8985530 - Sigstore transparency entry: 2746277146
- Sigstore integration time:
-
Permalink:
HarrytheOrange/sgtop@cab11a38b1d1d4458dc2a4b7923e7fb672cf1167 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/HarrytheOrange
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cab11a38b1d1d4458dc2a4b7923e7fb672cf1167 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sgtop-0.1.6-py3-none-any.whl.
File metadata
- Download URL: sgtop-0.1.6-py3-none-any.whl
- Upload date:
- Size: 29.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9edce23aa08574010c2812fa8cd358c1cebce22c56659409f7e0f89534f28871
|
|
| MD5 |
3d6de3593cfb9c3cd39f47c3be182aea
|
|
| BLAKE2b-256 |
b4de69b6926f9a9a0a8572df531362e15951e63ddef780b7686ac47358e032e1
|
Provenance
The following attestation bundles were made for sgtop-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on HarrytheOrange/sgtop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sgtop-0.1.6-py3-none-any.whl -
Subject digest:
9edce23aa08574010c2812fa8cd358c1cebce22c56659409f7e0f89534f28871 - Sigstore transparency entry: 2746277173
- Sigstore integration time:
-
Permalink:
HarrytheOrange/sgtop@cab11a38b1d1d4458dc2a4b7923e7fb672cf1167 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/HarrytheOrange
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cab11a38b1d1d4458dc2a4b7923e7fb672cf1167 -
Trigger Event:
push
-
Statement type: