How notatestuser/ds4-control works
DS4 Control is a macOS menu-bar app for choosing and downloading DeepSeek V4/V4.1 models, supervising a local ds4-server, chatting with it, launching coding agents, and viewing system resources. The main workflow runs from the popup’s model selection through feasibility checks, resumable download, and server startup; chat then streams requests to the server. Metrics are sampled independently for the popup widgets. The graph follows README statements and shown source-index references; some implementation details, especially agent launching and settings wiring, were not excerpted.
Main entry points: SupervisorService.swift Server supervisor · PopupView.swift Control popup · MetricsManager.swift Metrics sampler · HFDownloader.swift Model downloader
Components 26
Menu Bar UI
- Control popup
Sources/DS4Control/Views/PopupView.swift - Settings
Sources/DS4Control/Views/SettingsView.swift - Chat window
Sources/DS4Control/Views/ChatView.swift - Markdown rendering
Sources/DS4Control/Views/MarkdownText.swift - Window activation
Sources/DS4Control/WindowChrome.swift
App Control
- App composition
Sources/DS4Control/DS4ControlApp.swift - Preferences state
Sources/DS4Control/AppState.swift
Models And Downloads
- Model variants
Sources/DS4Control/Model/Variant.swift - RAM feasibility
Sources/DS4Control/Model/Feasibility.swift - Model downloader
Sources/DS4Control/Services/HFDownloader.swift - Range fetching
Sources/DS4Control/Services/ChunkFetcher.swift - Resume bitmap
Sources/DS4Control/Services/ChunkBitmap.swift - GGUF assembly
Sources/DS4Control/Services/GGUFJoiner.swift
Server And Chat
- Server state
Sources/DS4Control/Model/ServerState.swift - Server supervisor
Sources/DS4Control/Services/SupervisorService.swift - Chat conversation
Sources/DS4Control/ViewModels/ChatViewModel.swift - Chat streaming
Sources/DS4Control/Services/ChatService.swift - Coding agents
Sources/DS4Control/Services/AgentLauncher.swift
Resource Metrics
- Metrics sampler
Sources/DS4Control/Metrics/MetricsManager.swift - CPU sampling
Sources/DS4Control/Metrics/CPUCollector.swift - Memory sampling
Sources/DS4Control/Metrics/MemoryCollector.swift - GPU sampling
Sources/DS4Control/Metrics/GPUCollector.swift - Power sampling
Sources/DS4Control/Metrics/PowerCollector.swift
Other components
- Mac user
- Hugging Face
- Local ds4-server
Connections 28
- Mac user → Control popup: controls
README.md - App composition → Control popup: presents
Sources/DS4Control/DS4ControlApp.swift - App composition → Settings: opens
Sources/DS4Control/DS4ControlApp.swift - App composition → Chat window: opens
Sources/DS4Control/DS4ControlApp.swift - Control popup → Preferences state: reads preferences
Sources/DS4Control/Views/PopupView.swift - Control popup → Server supervisor: controls server
Sources/DS4Control/Views/PopupView.swift - Control popup → Metrics sampler: shows samples
Sources/DS4Control/Views/PopupView.swift - Preferences state → Model variants: selects
Sources/DS4Control/AppState.swift - Server supervisor → RAM feasibility: checks launch
Sources/DS4Control/Services/SupervisorService.swift - Server supervisor → Model variants: uses selection
Sources/DS4Control/Services/SupervisorService.swift - Server supervisor → Model downloader: downloads weights
README.md - Model downloader → Hugging Face: fetches ranges
Sources/DS4Control/Services/HFDownloader.swift - Model downloader → Range fetching: dispatches chunks
Sources/DS4Control/Services/HFDownloader.swift - Model downloader → Resume bitmap: tracks progress
Sources/DS4Control/Services/HFDownloader.swift - Server supervisor → GGUF assembly: assembles files
Sources/DS4Control/Services/SupervisorService.swift - Server supervisor → Local ds4-server: starts and monitors
README.md - Server supervisor → Server state: publishes state
Sources/DS4Control/Services/SupervisorService.swift - Chat window → Chat conversation: drives conversation
Sources/DS4Control/Views/ChatView.swift - Chat window → Markdown rendering: renders messages
Sources/DS4Control/Views/ChatView.swift - Chat conversation → Chat streaming: requests stream
- Chat streaming → Local ds4-server: streams completions
README.md - Metrics sampler → CPU sampling: samples
Sources/DS4Control/Metrics/MetricsManager.swift - Metrics sampler → Memory sampling: samples
Sources/DS4Control/Metrics/MetricsManager.swift - Metrics sampler → GPU sampling: samples
Sources/DS4Control/Metrics/MetricsManager.swift - Metrics sampler → Power sampling: samples
Sources/DS4Control/Metrics/MetricsManager.swift - Control popup → Coding agents: launches agents
Sources/DS4Control/Views/PopupView.swift - Mac user → Settings: configures
README.md - Settings → Window activation: activates window
Sources/DS4Control/Views/SettingsView.swift