LemonTop is a read-only, btop-style terminal monitor for
Lemonade Server. It combines Lemonade request
statistics and live inference logs with Linux host telemetry, AMD GPU/APU sysfs
counters, GTT/VRAM usage, and recent journalctl events.
The app makes no system configuration changes. It does not load/unload models, restart services, or modify Lemonade.
- Lemonade health, API latency, loaded model/backend when reported
- Last-request output throughput, prompt throughput, TTFT, and token counts
- Phase-aware live inference activity: generic processing, prompt ingestion, token generation, and context-limit failures when recognizable log records are available
- Live prompt progress, token counts, speed, elapsed time, and ETA, followed by generated-token counts and rolling output speed
- Context and KV-cache indicators when exposed by the active backend
- Active/queued requests when exposed by the server
- CPU, load average, RAM, swap, disk I/O, and network I/O
- AMD GPU utilization, GTT, fixed VRAM, temperature, power, and clock via sysfs
- NPU utilization when Lemonade reports it
- Model-storage usage from Lemonade system information
- Recent
lemond.servicejournal entries
Every optional metric displays — when unavailable. Older Lemonade releases
without /v1/system-stats continue to work using local system sources.
Python 3.10 or newer is required. On Ubuntu, one command does everything —
prerequisites, clone, venv, and lemontop on your PATH:
curl -fsSL https://raw.githubusercontent.com/cbigeagle/LemonTop/main/install.sh | bashSee INSTALL-linux.md for the manual steps, permissions, and troubleshooting.
Manual install:
cd /path/to/LemonTop
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .Run it:
lemontopOr without installing the console command:
PYTHONPATH=src python -m lemontopReview the complete interface without a live Lemonade server:
lemontop --demoThe default server is http://localhost:13305.
lemontop --server http://localhost:13305
lemontop --refresh 0.5
lemontop --service lemond.service
lemontop --no-logsEquivalent environment variables:
| Variable | Default | Purpose |
|---|---|---|
LEMONTOP_SERVER |
http://localhost:13305 |
Lemonade root URL |
LEMONTOP_REFRESH |
1.0 |
Poll interval in seconds |
LEMONTOP_TIMEOUT |
0.8 |
Per-request timeout |
LEMONTOP_SERVICE |
lemond.service |
systemd unit for logs |
LemonTop tries both the compatibility prefix /api/v1 and the current /v1
prefix for health, stats, system-stats, and system-info. The prefix that
answers first is reused for later polls, so only one request per endpoint is
sent once the server is identified.
When Lemonade advertises a log WebSocket in its health response, LemonTop
subscribes to it and extracts phase-aware inference telemetry in real time. It
tracks generic request processing, llama.cpp prompt processing and generation,
and context checkpoint/limit records. On the Lemonade host, recent journal lines
provide a fallback if the stream is absent or reconnecting. The inference panel
shows only values present in the backend logs; unavailable details remain —.
--no-logs disables both log sources and therefore the enhanced activity view.
| Key | Action |
|---|---|
q |
Quit |
p |
Pause/resume updates |
r |
Refresh now |
l |
Focus event log |
t |
Focus request table |
? |
Show key help |
Normal user access is enough for Lemonade and host metrics. Journal entries may
require membership in systemd-journal (or equivalent local policy):
sudo usermod -aG systemd-journal "$USER"Log out and back in after changing group membership. This is optional; LemonTop continues without journal access.
AMD metrics are read from:
/sys/class/drm/card*/device/
Availability and permissions vary by kernel/driver. LemonTop does not require
amd-smi; server-provided telemetry and Linux sysfs are preferred.
After installation:
python tests/test_smoke.py
lemontop --demoThe tests launch the Textual app in headless test mode and verify the status
line, request table, event-log tailing, and metric formatting. They also run
under pytest tests/ if you have it installed.
- Lemonade's stats endpoint documents performance for the last request, not a durable request ledger. The live collector keeps a small in-memory history of changed stats observed while LemonTop is running. Because the endpoint carries no request id, two identical back-to-back requests are indistinguishable and collapse into a single row.
- Journal events require Linux with
journalctlonPATH; elsewhere the event panel stays empty rather than reporting an error every second. - Only the first AMD card under
/sys/class/drm/card*is read. On a system with an APU plus a discrete GPU, the second device is not shown. - Context size, KV-cache size, prompt throughput, queue depth, and loaded-model details depend on the Lemonade version/backend and may not be reported.
- Detailed live activity and context metrics depend on the active backend's log
format. LemonTop recognizes current llama.cpp prompt-processing, generation,
context-checkpoint, and context-size records plus Lemonade's normalized
progress records. Other modalities may expose only generic
PROCESSING. - GTT use is read from amdgpu sysfs where supported. Some kernels expose only the configured total or provide counters with different semantics.
- No history is persisted between LemonTop runs.
- Remote monitoring shows remote Lemonade data but local CPU/RAM/sysfs and journal data from the machine where LemonTop itself is running. For a coherent view, run LemonTop on the Lemonade host over SSH.