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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sgtop-0.1.7.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sgtop-0.1.7-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file sgtop-0.1.7.tar.gz.

File metadata

  • Download URL: sgtop-0.1.7.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sgtop-0.1.7.tar.gz
Algorithm Hash digest
SHA256 045571074a156da49e87c4bacf297ae3ccb3a38fcbce4231ef8e49af1dd0ee36
MD5 fe44831baaeef0ea488454ccf7afc231
BLAKE2b-256 a36742df6c62e0d07371e66760ec65b02743493a753b6639d388057a3ba2c01e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sgtop-0.1.7.tar.gz:

Publisher: publish.yml on HarrytheOrange/sgtop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sgtop-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: sgtop-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sgtop-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 22ae631cb7d5a029927ecef4daf68f22b9539cc5b88531381c4a697c383066cc
MD5 38194404ee86b03cd1d78528efa61fad
BLAKE2b-256 5f47b641d1020e8b8696c4e300a76bd5ebc90e37cc24a7758d3334e0cb838761

See more details on using hashes here.

Provenance

The following attestation bundles were made for sgtop-0.1.7-py3-none-any.whl:

Publisher: publish.yml on HarrytheOrange/sgtop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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