Skip to content

Extract dashboard into standalone ds4_dashboard module#400

Open
EdwQ wants to merge 1 commit into
antirez:mainfrom
EdwQ:dashboard-module
Open

Extract dashboard into standalone ds4_dashboard module#400
EdwQ wants to merge 1 commit into
antirez:mainfrom
EdwQ:dashboard-module

Conversation

@EdwQ

@EdwQ EdwQ commented Jun 12, 2026

Copy link
Copy Markdown

Extracts the dashboard into a self-contained module

This commit extracts the real-time web dashboard from ds4_server.c into
a self-contained ds4_dashboard module (ds4_dashboard.h + ds4_dashboard.c).

The module provides:
- A live HTML dashboard page served at /dashboard (or /)
- JSON endpoints for /metrics, /status, /config
- Real-time model status (idle/prefilling/thinking/generating)
- Prefill progress bar with ETA countdown
- Live generation output preview (last ~200 chars)
- Cumulative cache hit rate tracking
- Incremental prefill speed (uncached tokens only)
- Startup configuration display
- Persistent metrics saved to metrics.json in the KV disk directory

The module has zero internal dependencies - only POSIX socket I/O and
standard C. It can be reused by other projects embedding ds4-server's
HTTP interface.

ds4_server.c is minimally modified:
- Remove ~530 lines of inline dashboard code
- Add a void *dash handle to struct server
- Replace all s->metrics / s->status / HTTP endpoint code with
  calls to the ds4_dashboard API
- Initialize, persist, and free the dashboard at startup/shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant