Skip to content
项目

关于

A top for local LLMs: memory, paging, GPU and tokens/s for oMLX, Ollama, llama.cpp, vLLM and more

人工智能与机器学习

这些数字如何统计

实测星标增长

24小时
+1
7天
+4
15天
+9
1个月
+16

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

mlxtop

The top for local LLMs, on macOS, Linux and Windows, for 17 inference engines.

See whether memory, paging or the GPU is what's slowing your model down.

Release CI License: MIT Platforms

mlxtop Overview on a Mac Studio running oMLX through Splash

Install · Quick start · Engines · Why mlxtop · User guide · Changelog

mlxtop is one monitor for local inference wherever you run it: Apple Silicon Macs, Linux machines with NVIDIA or AMD cards, and Windows PCs. It began as a Mac tool for MLX, hence the name, and now reads 17 inference engines, among them Ollama, llama.cpp, vLLM, LM Studio, Strata and oMLX.

When a local model slows down, the cause is usually the machine: memory pressure, swapping, a full GPU or a throttled card. mlxtop shows those readings next to the engine's own numbers, such as tokens per second, prefill progress, queued requests and cache reuse, so you can see which one changed when the model slowed.

  • Every platform: macOS, Linux (x86_64 and ARM64) and Windows, with Apple, NVIDIA and AMD GPUs. One binary, no sudo.
  • 17 inference engines: Ollama, llama.cpp, vLLM, LM Studio, LocalAI, Strata, Jan, SGLang, oMLX, KoboldCpp, Magnitude, MLX-LM, Splash and more, detected automatically.
  • Live inference: generation and prefill speed, prompt sizes, cached tokens, queues and prefill progress from the engine itself, never estimated from CPU or GPU use.
  • Memory first: what RAM holds (wired, app, compressed, cache), OS pressure, compression and paging, each judged against its warning rate.
  • A plain verdict: a single line reads ✓ Healthy, or names the problem, such as heavy paging, a model partly on the CPU, a full card or heat throttling.
  • Local and read-only: no account, no usage tracking. It never sends prompts or touches your models or engine settings.

New in 3.5.0: Basalt and Magnitude support, and every engine adapter checked against its engine's current release. Release notes →

Install

Homebrew (macOS and Linux):

brew install maximpri/tap/mlxtop

Install script (macOS on Apple Silicon, Linux x86_64 and ARM64), installs to ~/.local/bin without sudo:

curl -fsSL https://raw.githubusercontent.com/maximpri/mlxtop/main/scripts/install.sh | sh

Windows (x86_64, PowerShell, no administrator rights needed):

irm https://raw.githubusercontent.com/maximpri/mlxtop/main/scripts/install.ps1 | iex

Both scripts verify the download's SHA-256 checksum, which detects a damaged download; it comes from the same release, so it is not a signature. Linux builds are static binaries with no runtime dependencies. You can also download a macOS installer (.dmg, unsigned) or an archive from the latest release.

To update, run mlxtop update (--rc for release candidates), or brew upgrade maximpri/tap/mlxtop if you installed with Homebrew. From 3.3.0, update with the install script or Homebrew instead, or check what mlxtop update installed.

Build from source

You'll need Rust 1.88 or newer:

git clone https://github.com/maximpri/mlxtop.git
cd mlxtop
cargo install --path . --locked

Quick start

mlxtop            # open the dashboard
mlxtop --once     # print a text report and exit (works over SSH)
mlxtop stream     # one line of JSON per sample, for scripts (--once --json for one)
mlxtop serve      # /metrics for Prometheus at 127.0.0.1:10063, loopback only
mlxtop doctor     # check the engine connection and which readings are available

Memory and GPU readings appear straight away, even with no model loaded. Start your engine, send it a prompt, and watch Overview while it answers. The dashboard needs a terminal of at least 72×24; smaller, it shows the verdict and a note.

Not seeing tokens per second? Run mlxtop doctor, or press d in the dashboard: it lists what your engine reports and how to turn on the rest.

View What it shows
1 · Overview The verdict, memory, compression, paging, prompt load, generation, prefill, GPU, cache, queue and recent events
2 · Processes Model processes and the CPU, memory and page-ins each one uses
3 · Journal Requests and resource changes during the session
4 · Settings Every config option, edited in place and applied without a restart
Key Action
1–4 / Tab Switch view
Arrows / click, Enter / double-click Select a chart, enlarge or restore it
+ - / wheel Zoom chart history
p / Space Pause sampling
[ ] Select a GPU card
d Diagnostics and setup help for the current engine
? / q Help / quit (Esc asks first)

The user guide explains every chart, its thresholds and where each reading comes from.

Supported inference engines

mlxtop finds a running engine by its process and reads its local API. The machine's memory, paging and GPU are shown for every engine; the table is what each engine adds.

Engine Speed Queue Cache reuse Engine memory Also shows
oMLX live ✓ ✓ ✓ Requests with prefill progress; follows oMLX serving through Splash
Splash live ✓ ✓ ✓ Prefill progress, DFlash acceptance, first-token time
mlx-serve, sushi live ✓ ✓ ✓ Each running request's own speed (mlx-serve needs --metrics)
llama.cpp live ✓ ✓ — Active slots; queue, cache and averages need --metrics
vLLM live ✓ ✓ — KV-cache room, preemptions, draft tokens per pass, first-token time
SGLang live ✓ ✓ — KV-cache room, retractions, where the scheduler's time goes
TensorFold live ✓ ✓ ✓ Draft tokens per pass, preemptions, refused requests
Strata live ✓ ✓ ✓ KV-cache occupancy, first-token time
Basalt live ✓ ✓ ✓ First-token time; loading, asleep and unloaded models
KoboldCpp last request ✓ — — Model name, the last request's token counts
Ollama after — after ✓ Loaded models, CPU/GPU placement, quantization, context size
LM Studio after — after — Loaded instances, quantization, context size, parallel requests
MLX-LM, LocalAI, Jan, GPT4All, Magnitude after — after — Model catalogue

live is the speed while a request runs. after is the speed and cached tokens of each finished request, recorded by the usage recorder or the included Python helper. mlxtop monitors one server at a time; see provider endpoints for ports, custom URLs and authentication, and the user guide for each engine's details.

Platforms

macOS (Apple Silicon) Linux (x86_64, ARM64) Windows (x86_64)
Memory pressure Native MemAvailable and PSI Commit charge
Compression ✓ — —
Paging ✓ ✓ Not available from Windows
GPU Apple GPU NVIDIA via nvidia-smi, AMD via amdgpu sysfs NVIDIA via nvidia-smi

macOS 11 or later is required. Intel Macs aren't supported.

Why mlxtop

Hardware monitors show the machine. mlxtop also reads the inference engine, so it can tell a slow model from a busy machine.

mlxtop asitop nvtop nvitop btop
Runs on macOS, Linux, Windows Apple Silicon Macs Linux; macOS experimental Linux, Windows Linux, macOS, BSD
Watches The machine and the inference engine CPU, GPU, memory, power GPUs of most vendors and their processes NVIDIA GPUs and their processes CPU, memory, disks, network, GPU
Tokens per second, queue and cache from the engine ✓ — — — —
Names what slowed the model ✓ — — — —
Works without sudo ✓ — ✓ ✓ ✓

Those are good monitors, and mlxtop doesn't replace them for general system work. For local inference it is the only one of these that reads the engine.

Configuration

mlxtop works without configuration. To change the refresh rate, history length, oMLX endpoint, alarms or warning thresholds, press 4 for Settings: changes apply at once and are saved to ~/.config/mlxtop/config.json. You can also edit that file by hand:

{
  "interval": 2,
  "omx": { "host": "127.0.0.1", "port": 8000 }
}

Every field and default is listed in the configuration reference.

Limits

  • GPU activity covers the whole system, not a single model.
  • Polling is sampled, so a request that starts and finishes between two samples can be missed.
  • mlxtop shows what changed when a model slowed down; it can't prove the cause.
  • History is kept for the current session only.

Privacy

mlxtop reads system counters, process information and your engine's local APIs. It doesn't track how you use it, doesn't upload anything, and by default sends provider credentials only to endpoints on your own machine. Its local diagnostic log never contains prompts, model output or API keys. See data sources and privacy and the security policy.

Contributing

Bug reports, documentation fixes and new engine adapters are welcome. Please read CONTRIBUTING.md first, and open an issue before starting a large change. When you report a bug, include the output of mlxtop --version and mlxtop doctor, plus your OS and engine.

mlxtop was developed with the Duet coding agent.

Credits

External contributions are credited here, with thanks.

  • Samuel Reed (@STRML) — the mlx-serve runtime support, per-request decode speeds, prefill progress with time left, sushi gauge support, the Journal recording overhaul, and runtimes on this machine's own LAN or Thunderbolt addresses counted as local (#15, #37, #38, #43, #44, #65).
  • David (@sandbranch) — AMD GPU monitoring on Linux from amdgpu sysfs, and live llama.cpp generation rate and slot readings (#40, #41, #42).
  • Minoru Mizutani (@mmizutani) — the TensorFold runtime support (#45).
  • Sumit Chaudhary (@EduardoSaverin) — the configuration file support (#1).
  • Prashant (@prashant11235) — Linux monitoring via nvidia-smi (#2).

License

MIT. Dependencies keep their own licenses. mlxtop is an independent project and isn't affiliated with Apple.

探索相关项目

加载中…