Skip to main content

Diagnostic tool for vLLM inference servers

Project description

vLLM Doctor

Package version Supported Python versions

Diagnose vLLM server bottlenecks from live metrics.

vllm-doctor demo

vLLM Doctor reads vLLM server metrics and turns them into diagnostic findings: what looks unhealthy, why it may be happening, and which vLLM settings are worth checking first.

vllm-doctor http://localhost:8000/metrics

vLLM Doctor is not a dashboard replacement or benchmark runner. It is a fast server-side diagnostic snapshot for a single vLLM server or Prometheus target.

Why not just a dashboard?

Dashboards show metrics. vLLM Doctor explains server-side inference behavior.

Dashboards vLLM Doctor
Shows raw metrics
Explains what's wrong
Recommends vLLM configs
Requires setup
Works on a single server

How does this relate to GuideLLM?

GuideLLM is a good fit for generating workloads and measuring endpoint behavior. vLLM Doctor is a good fit for explaining server-side symptoms from vLLM metrics.

Used together, GuideLLM can create or replay load while vLLM Doctor helps explain bottlenecks such as queue pressure, KV cache pressure, high TTFT, or high TPOT.

Installation

With pip:

pip install vllm-doctor

With uv:

uv tool install vllm-doctor

Quickstart

Direct scrape:

vllm-doctor http://localhost:8000/metrics

Prometheus:

vllm-doctor http://localhost:9090

Run with Docker

A prebuilt image is published to GitHub Container Registry:

docker run --rm ghcr.io/aminalaee/vllm-doctor <url>

<url> is your vLLM /metrics or Prometheus endpoint — the same argument the CLI takes — reachable from inside the container.

Options:

Usage: vllm-doctor [OPTIONS] URL

Arguments:
  URL                         vLLM /metrics or Prometheus URL to diagnose.  [required]

Options:
  -s, --since    TEXT         Time window (e.g. '1h', '30m', 'now').  [default: now]
  -m, --model    TEXT         Filter metrics by model_name label (for a target serving several models).
  -w, --watch                 Refresh continuously every 5s (pipe through `watch -n N` for a different interval).
  -o, --output   [text|json]  Output format.  [default: text]
  -v, --verbose               Show additional diagnostic detail.
  -c, --config   PATH         Path to config file (default: vllm-doctor.toml).
      --version               Show version and exit.
      --help                  Show this message and exit.

Example verbose output

─────────────────────────────────── vLLM Doctor  ·  Health: CRITICAL  ·  Since: now ────────────────────────────────────

╭─  KV cache pressure  [high confidence] ─────────────────────────────────────────────────────────────────────────────╮
│   GPU KV cache usage: 94% (threshold: 90%)  ·  Waiting requests: 7 (blocked by full cache)                           │
│                                                                                                                      │
│    Reduce max_num_seqs to limit concurrent sequences                                                                │
│    Reduce max_num_batched_tokens to cap memory per step                                                             │
│    Increase gpu_memory_utilization if GPU memory headroom exists                                                    │
│    Route long-context requests to a dedicated replica                                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─  High time to first token (TTFT)  [high confidence] ───────────────────────────────────────────────────────────────╮
│   TTFT p95: 3.200s  ·  TPOT p95: 0.050s  ·  Waiting requests: 7                                                      │
│                                                                                                                      │
│    Enable or tune chunked prefill (--enable-chunked-prefill)                                                        │
│    Reduce max prompt length or filter long requests                                                                 │
│    Inspect queue depth  consider adding replicas                                                                   │
│    Separate long-context traffic to dedicated instances                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─  Replica imbalance  [high confidence] ─────────────────────────────────────────────────────────────────────────────╮
│   meta-llama/Llama-3.1-8B: running vllm-1=10 vs vllm-0=2; cache 94% vs 41%; waiting vllm-1=7 vs vllm-0=0             │
│                                                                                                                      │
│    Check the load balancer / service routing and session affinity settings                                          │
│    Verify readiness probes  an unready replica receives no traffic                                                 │
│    Compare per-replica latency and restart any unhealthy replica                                                    │
│    Confirm newly added replicas are registered with the load balancer                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─  Queue pressure  [low confidence] ─────────────────────────────────────────────────────────────────────────────────╮
│   Waiting requests: 7 (threshold: 5)                                                                                 │
│                                                                                                                      │
│    Add replicas or increase concurrency limits                                                                      │
│    Inspect autoscaling thresholds                                                                                   │
│    Separate long-context traffic to a dedicated replica                                                             │
│    Reduce incoming request rate                                                                                     │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

  KV Cache Pressure           critical    [high]
  High TTFT                   warning     [high]
  Replica Imbalance           warning     [high]
  Queue Pressure              warning     [low]
  Queue Latency               ok
  Preemption Pressure         ok
  Low Throughput              ok
  Error Rate                  ok
  High TPOT                   ok
  Prefix Cache Efficiency     ok

─────────────────────────────────────────────────── Observed Metrics ───────────────────────────────────────────────────

  Summary
  Requests Running                               12
  Requests Waiting                                7
  GPU Cache Usage          ███████████████████░ 94%
  Prefill Tokens/s                            390.0
  Decode Tokens/s                             252.0
  Requests Success                              114
  Requests Error                                  0
  Requests Aborted                                0
  TTFT p95 (s)                                3.200
  TPOT p95 (s)                                0.050
  Queue Time p95 (s)                          0.800
  Preemptions Total                               0
  Prefix Cache Hit Rate                         50%

─────────────────────────────────────────────── Observed Metrics per pod ───────────────────────────────────────────────

                       vllm-1    vllm-0
  Requests Running         10         2
  Requests Waiting          7         0
  GPU Cache Usage         94%       41%
  Prefill Tokens/s       80.0     310.0
  Decode Tokens/s        42.0     210.0
  Requests Success         30        84
  Requests Error            0         0
  Requests Aborted          0         0
  Preemptions Total         0         0

Documentation

Read the full documentation: https://aminalaee.github.io/vllm-doctor

Project details


Download files

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

Source Distribution

vllm_doctor-0.5.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

vllm_doctor-0.5.0-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

Details for the file vllm_doctor-0.5.0.tar.gz.

File metadata

  • Download URL: vllm_doctor-0.5.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vllm_doctor-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b5c38bd115d1d10c9f32f4e2486330edbb5fb2323ca4ac142055c7a11dd26650
MD5 f5a8adce4e3cf887ae673735956fa79c
BLAKE2b-256 e2e1ff7b3d40bf836b1cbdb94462c887b8f76fdfeaeb58b970d5ea9ca8994a1d

See more details on using hashes here.

File details

Details for the file vllm_doctor-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: vllm_doctor-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 38.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for vllm_doctor-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba359eafccc55f9cb9bf1b670c2cd8fdba62b1e2dbcfe7fbb76cae186c1f4d5c
MD5 b76a711b8ae764293df5090367d4acc0
BLAKE2b-256 f60a1e095af755e8015b02f16148657f82ec127b4d0dd8fa9a1b61773b1a7d88

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 Pingdom Monitoring Sentry Error logging StatusPage Status page