mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-10-23 08:07:34 -06:00
[PR #228] feat: recognize the served model and the owning service in the COMMAND column #227
Labels
No labels
api
bug
bug
cli / tui
dependencies
documentation
documentation
documentation
duplicate
enhancement
exporter
invalid
pull-request
pynvml
question
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github-starred/nvitop#227
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/XuehaiPan/nvitop/pull/228
Author: @xusy-sz
Created: 9/21/2026
Status: 🔄 Open
Base:
main← Head:feat/model-service-recognition📝 Commits (2)
cfaebebfeat(api): recognize the served model and the owning service of processes1d4afacfeat(tui): show the full command line and the working directory in the process details📊 Changes
21 files changed (+1945 additions, -42 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
README.md(+25 -6)➕
docs/source/api/recognizer.rst(+40 -0)📝
docs/source/index.rst(+1 -0)📝
docs/source/spelling_wordlist.txt(+8 -0)📝
nvitop/__init__.py(+2 -0)📝
nvitop/api/__init__.py(+1 -0)📝
nvitop/api/process.py(+12 -6)➕
nvitop/api/recognizer.py(+597 -0)📝
nvitop/cli.py(+22 -0)📝
nvitop/tui/library/__init__.py(+10 -1)📝
nvitop/tui/library/process.py(+13 -2)📝
nvitop/tui/screens/metrics.py(+144 -27)📝
pyproject.toml(+5 -0)📝
setup.py(+3 -0)➕
tests/conftest.py(+28 -0)➕
tests/test_metrics_details.py(+175 -0)➕
tests/test_recognizer.py(+358 -0)➕
tests/test_recognizer_container.py(+178 -0)➕
tests/test_recognizer_service.py(+62 -0)...and 1 more files
📄 Description
Motivation
Inference engines rename their worker processes with
setproctitle: vLLM showsVLLM::EngineCore, and ollama's embedded vLLM workers do the same. On a shared GPU server this makes the process table uninformative — severalVLLM::EngineCorerows on one card, with no way to tell which model owns the memory without logging into the box and digging through/proc. A barepython main.pyis equally anonymous.This PR enriches the
COMMANDcolumn so the table answers "which model is this, whose service is this" at a glance.What it does
ENGINE::roleconvention show the model looked up on the parent chain:--served-model-name/--model/--model-id/--model_nameflags, the positional argument ofserve, HuggingFace cache paths (models--Org--Name), and Ollama blob paths resolved through the manifests of the model store. Works for vLLM, SGLang, ollama's vLLM workers, and other engines following the convention.main.py @ octopus-api.main.py @ vllm-svc:/workspace.--no-model-detect/NVITOP_NO_MODEL_DETECT=1.Before / after, from a real fleet (ollama's vLLM workers,
paddleocr genai_server --backend vllmin Docker, bare scripts):Design
command();nvitop.apikeeps the raw text, so library and exporter consumers are unaffected.Testing
tests/is new (pytest): 107 tests covering the recognizer boundary, the fallback contract, the switch, the platform guard, container cgroup fixtures (Docker cgroupfs/systemd, LXD, k8s ignored), and the detail view helpers. The layout helper is verified to fill the terminal height exactly.ruff check/ruff formatclean;mypyclean on the new module (no new errors project-wide).paddleocr genai_server --backend vllminside Docker, LXD services, and barepython main.pyscripts.Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.