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: BaseHTTPRequestHandler

Request handler serving the panel’s static assets and JSON API.

Bound to a single ServerSupervisor instance (injected onto the supervisor class attribute by serve_panel(), since ThreadingHTTPServer instantiates a fresh handler per request). See do_GET() and do_POST() for the route table.

supervisor: ServerSupervisor
log_message(fmt, *args)[source]

Suppress the base class’s stderr access log; server logs go to the UI instead.

Return type:

None

Parameters:
do_GET()[source]

Serve a GET request; see _handle_get() for the route table.

Return type:

None

do_POST()[source]

Serve a POST request; see _handle_post() for the route table.

Return type:

None

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) on port, optionally opens the panel URL in the default browser, and serves until Ctrl-C. Always stops any running supervised veloxquant serve child and closes the HTTP server on exit, so interrupting the panel never leaves an orphaned inference server holding a port.

Return type:

None

Parameters: