Extract dashboard into standalone ds4_dashboard module#400
Open
EdwQ wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracts the dashboard into a self-contained module