Skip to main content

llamastat

nvtop for llama.cpp: a zero-infrastructure terminal dashboard for llama-server inference. Point it at a running server and watch slots, throughput, and context usage live.

llamastat


Why llamastat?

llama-server tells you what it is doing, but only in raw JSON. llamastat turns that into a live picture:

  • Per-slot activity: which slots are processing prompts, which are generating, and how full each context window is.
  • Throughput without --metrics: llamastat diffs slot token counters between polls, so you get generation and prompt tokens/s even on servers started without the Prometheus endpoint.
  • Zero infrastructure: no Prometheus, no Grafana, no agents. One pip install, one command, works over any HTTP reachable server (including an SSH port-forward to a production box).
  • Degrades gracefully: if the server flaps, is still loading the model, or has /slots disabled, llamastat shows what it can instead of crashing.

Sibling project: vllmstat does the same for vLLM.

Install

pip install llamastat

Usage

llamastat                          # local server on the default port
llamastat -u http://host:8080      # remote server
llamastat -u http://host:8080 -i 0.5
llamastat --once --json            # one snapshot as JSON, for scripting
llamastat --mock                   # synthetic data, no server needed

Key bindings

Key Action
q Quit
p Pause/resume polling
+ Poll faster (halve interval, min 0.1s)
- Poll slower (double interval, max 10s)

Flags

Flag Default Meaning
-u, --url http://localhost:8080 llama-server base URL
-i, --interval 1.0 poll interval in seconds
--api-key $LLAMACPP_API_KEY bearer token for servers started with --api-key
--metrics-path /metrics Prometheus metrics path
--once off poll once, print, exit
--json off with --once, print machine-readable JSON
--mock off run against synthetic data

What it shows

  • Header: model alias, quantization, parameter count, file size, context per slot, training context, server build, health.
  • Slots: one row per slot with phase (prompt/gen/idle), task id, prompt progress, generated tokens, per-slot tokens/s, and a context-usage bar.
  • Throughput: EWMA generation and prompt tokens/s with session peaks and totals, plus a braille history plot.
  • Requests: running/peak concurrency, completed tasks, aggregate context in use.
  • Server metrics: when the server was started with --metrics, llamastat also shows the server-side Prometheus counters (total tokens, deferred requests, context high-water mark, busy slots per decode). The panel hides itself otherwise.
  • Sampling defaults: temperature, top_p, top_k, min_p, max_tokens from /props.

llamastat only issues read-only GET requests (/health, /slots, /props, /v1/models, and optionally /metrics), so it is safe to point at a production server.

Requirements

  • Python 3.10+
  • A llama.cpp llama-server new enough to expose /slots (enabled by default; some deployments disable it, in which case llamastat falls back to header and metrics panels)

Development

git clone https://github.com/bryanvine/llamastat
cd llamastat
pip install -e ".[dev]"
pytest -q

See CONTRIBUTING.md.

License

Apache-2.0. See LICENSE.

Download files

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

Source Distribution

llamastat-0.1.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

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

llamastat-0.1.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file llamastat-0.1.0.tar.gz.

File metadata

  • Download URL: llamastat-0.1.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for llamastat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1dbb9ab94eb6123dc5d9fa5eecbea96b2c816a1347ed640fe84c790e43dda12
MD5 d2825291f4c6626258f7338473b559fa
BLAKE2b-256 4a7bf6e7fa2e8486dacf0c001c24b7fc76b6ba4fa39bbd24c0ad69e04ef53be4

See more details on using hashes here.

File details

Details for the file llamastat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llamastat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for llamastat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc7bb59f9477719ef393c1d71ae87360ae54a2150bea5f519cf2c7c7972b5469
MD5 30e112b8b5908bfde8f9bff2ec9a5152
BLAKE2b-256 52892e346641d76b8994596b31fdbd1534150040be40837328c140587daf9714

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page