veloxquant_mlx.ui.server module¶
Control-plane HTTP server for the VeloxQuant panel (#34).
Serves the static panel and a small JSON API the page drives. Stdlib only — the panel must not add a runtime dependency to the core package.
Security: this API spawns processes, so it binds loopback unconditionally.
That is deliberately not configurable, and is separate from the inference
server’s own --host, which the user may set to 0.0.0.0.
- veloxquant_mlx.ui.server.CONTROL_HOST = '127.0.0.1'¶
The panel’s own bind address. Loopback only — see module docstring.
- veloxquant_mlx.ui.server.MAX_BODY_BYTES = 1048576¶
Largest request body accepted. The API’s payloads are a few hundred bytes.
- class veloxquant_mlx.ui.server.PanelHandler(request, client_address, server)[source]¶
Bases:
BaseHTTPRequestHandlerRequest handler serving the panel’s static assets and JSON API.
Bound to a single
ServerSupervisorinstance (injected onto thesupervisorclass attribute byserve_panel(), sinceThreadingHTTPServerinstantiates a fresh handler per request). Seedo_GET()anddo_POST()for the route table.- supervisor: ServerSupervisor¶
- veloxquant_mlx.ui.server.serve_panel(port=7860, open_browser=True)[source]¶
Start the control panel’s HTTP server and block until interrupted.
Binds
CONTROL_HOST(loopback only, unconditionally — see module docstring) onport, optionally opens the panel URL in the default browser, and serves untilCtrl-C. Always stops any running supervisedveloxquant servechild and closes the HTTP server on exit, so interrupting the panel never leaves an orphaned inference server holding a port.