Skip to content

How-ToOS

How to Monitor GPU Stats in llama-swap

llama-swap's Performance page can show CPU, RAM and GPU stats while your local AI models run. Here's how to update to v278, check which monitors it uses, pick your own, set up mixed AMD and NVIDIA GPUs, and stop it keeping an idle graphics card awake.

By , Systems & Technical Editor

4 min read

How to Monitor GPU Stats in llama-swap

If you use llama-swap to load and swap local AI models, its built-in Performance page can show your CPU, RAM and graphics card stats while models run, without opening a separate monitoring tool. Version 278 rewrote this system, so here's how to update, check what llama-swap is reading, choose your own monitors, handle PCs with more than one GPU and stop it keeping an idle graphics card awake.

What you'll need

  • llama-swap v278 or newer. Pre-built downloads for Windows, Linux, macOS and FreeBSD are on the project's GitHub releases page. On Windows you can also use the community-maintained WinGet package: winget install llama-swap, or winget upgrade llama-swap if it's already installed.

  • A working config file. If you haven't set llama-swap up yet, start with our guide to hot-swapping local LLMs with llama-swap.

  • GPU drivers. For NVIDIA cards, nvidia-smi comes with the NVIDIA driver. On Linux, AMD cards need no extra tools, because llama-swap's sysfs monitor reads stats straight from the kernel.

Step 1: Start llama-swap and open the Performance page

Start llama-swap as usual, for example:

llama-swap --config config.yaml --listen localhost:8080

Open the web interface at http://localhost:8080/ui in your browser and go to the Performance page. With no extra configuration, llama-swap auto-detects its monitors, so most setups need nothing else.

Step 2: Check which monitors are running

Auto mode always runs sysmon (CPU, RAM, swap, load and network) plus every GPU monitor it can find, in this order of preference:

Operating system

Monitors, preferred first

Windows

sysmon, nvidia-smi, d3dkmt

Linux

sysmon, xpu-smi, sysfs, nvidia-smi, rocm-smi, lactd

macOS

sysmon, mactop, ioreg

Watch llama-swap's log when it starts. After the first three readings, it stops any monitor that adds nothing new, and logs lines such as performance: running monitors: sysmon, sysfs so you can see what's left.

On Windows, the d3dkmt monitor reads GPUs from any vendor through the display driver, and nvidia-smi takes over for NVIDIA cards. Note that d3dkmt doesn't report power draw, so an AMD or Intel GPU on Windows won't show a power chart.

Step 3: Choose your own monitors (optional)

To control exactly what runs, add a performance section to your config file. Each entry has use and optional settings:

performance:
  every: 5s
  monitors:
    - use: sysmon
    - use: nvidia-smi
      settings:
        every: 15s

every sets how often a reading is stored, and it can't be lower than 5s; a shorter value fails config validation. Each monitor can have its own every, and nvidia-smi, rocm-smi, xpu-smi and mactop also accept a path if the tool isn't where llama-swap expects. An unknown monitor or setting stops the config from loading, so check spellings carefully. If you'd like help writing the section, llama-swap's release notes suggest asking its built-in help agent.

Step 4: Set up a PC with mixed GPUs

If your PC has, say, an AMD and an NVIDIA card, list a monitor for each. llama-swap matches cards by PCI address, so the two are never merged even if both tools call their card GPU 0. When two monitors in your own list report the same value for the same card, the one listed later wins, so put your preferred source last. (Auto mode works the other way round, preferring the first.)

Step 5: Decide whether to pause monitoring when idle

By default, GPU monitors pause when no model is starting, loaded or stopping, because polling a GPU can stop it entering a low-power state. llama-swap's documentation puts the cost at around 7-15W on some laptops and ROCm hosts. While paused, the Performance page dims the last GPU readings rather than showing them as current.

If you want to keep watching temperatures with nothing loaded, turn the pause off globally or for one monitor:

performance:
  monitors:
    - use: sysmon
    - use: nvidia-smi
      settings:
        disableIdlePause: true

To keep CPU and RAM stats but drop GPU stats entirely, list only sysmon. To turn monitoring off completely, set disabled: true under performance; that hides the Performance page and makes the /metrics endpoint return an error.

Troubleshooting

  • A chart is missing or shows nothing. The tool didn't report that value, and llama-swap leaves missing values out rather than showing 0. Add another monitor that does report it.

  • A monitor you listed isn't working. Its tool is probably missing. llama-swap logs a warning and keeps retrying while the other monitors carry on.

  • Running in Docker. The vendor tools must be inside the image and the GPU passed through to the container, or the monitor reports nothing.

  • Prometheus dashboards broke after updating. v278 changed the metric definitions on /metrics, so update your queries.

For one-off checks outside llama-swap, see our guides to checking VRAM usage on Windows, logging GPU usage with nvidia-smi and monitoring an AMD GPU with amd-smi. For terminal monitors, see nvtop vs nvitop, and for what changed in this release, our llama-swap v278 news story.

The bottom line

For most people, llama-swap's Performance page works out of the box: update to v278 or newer, open /ui and let auto mode pick the monitors. Add a performance section to your config only if you want to choose monitors yourself, combine AMD and NVIDIA cards, or keep polling an idle GPU, and leave the idle pause on otherwise so your graphics card can drop into a low-power state.

Sources

  1. 01llama-swap performance monitoring guide (GitHub)
  2. 02llama-swap example configuration (GitHub)
  3. 03llama-swap v278 release notes (GitHub)
  4. 04llama-swap README (GitHub)

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

nvtop vs nvitop: Which Terminal GPU Monitor Is Best for Local AI?

Versus

nvtop vs nvitop: Which Terminal GPU Monitor Is Best for Local AI?

nvtop and nvitop are free terminal tools for watching GPU use and VRAM while you run local AI. nvtop covers AMD, Intel and NVIDIA GPUs plus NPUs on Linux, while nvitop focuses on NVIDIA cards and runs natively on Windows. We compare hardware support, setup and features.

Callum Reid4 min