Network Streaming¶
caliper.serve sends a script's live views over a WebSocket to a notebook widget or a browser tab, reducing each snapshot on the device and letting the latest snapshot win.
| Field | Value |
|---|---|
| ID | STR-05 |
| Status | Shipped |
| Scope | Core |
| Pillar | Live Data, Streaming and Recordings |
| Sprint | None |
| Depends On | Wire Protocol v3 (STR-02)Live Streaming ( STR-04) |
| Unblocks | Live Stream for MCP Agents (AGT-21)Web Viewer ( EMB-01)Fast Paths in the Documented Setup ( PLT-18)Catalog ( SPC-04)Hub ( STR-06)Notebooks ( STR-07)Data Views ( STR-08)caliper.scene ( STR-10)WebTransport ( STR-16)Security Review ( STR-17)Foxglove Bridge Source ( STR-38)Attaching from the App ( STR-43) |
| Docs | Network Streaming |
| Branches | None |
| Design | None |
Coverage Ledger¶
- Branch
sprint2-proto, 0 commits that main lacks (3 ahead of the merge base). Work on the measured cost of streaming moved into the docs, which reached main through a pull request (patch ids and subjects match). - Branch
sprint2-review-cpp, 0 commits that main lacks (4 ahead of the merge base). Work on network tests that wait on state instead of fixed sleeps, which reached main through a pull request (patch ids and subjects match). - Branch
sprint2-review-py, 0 commits that main lacks (7 ahead of the merge base). Work on a check that a stalled viewer makes no view call wait, which reached main through a pull request (patch ids and subjects match). - Branch
sprint2-spikedoc, 0 commits that main lacks (9 ahead of the merge base). Work on a strict build of the design pages in the Pages workflow, which reached main through a pull request (patch ids and subjects match). - design/roadmap.md, under Where things stand. Streaming to notebooks, browsers and the app, the hub, Caliper API v0 and caliper build are built.
- design/roadmap.md, under MCP. Use: watching training runs.
- design/roadmap.md, under Streaming and embedding. Built so far: embedding package, network streaming over protocol v3 with data views, caliper.serve(), notebook widgets, 3.1 controls, app and viewer attach by link, hub, browser views.
- design/roadmap.md, under Streaming and embedding. Streaming costs the training loop 1 to 2.5 % for one view, 3 to 4.6 % for three, at most 1 % with no viewer.
- design/streaming-and-embedding.md, under Data streaming. Data streaming is the only way Caliper reaches a browser; only snapshots of tensors travel.
- design/windows-parity.md, under Where Windows stands. The network stream, hub, Caliper API, caliper build, web viewer and notebook widget are built and tested on macOS; the WebSocket layer, hub and API are compiled, not tested on Windows.
design/windows-parity.mdon the branchsprint4-pr1-main2, under 3. Caliper LIB. caliper.serve() on Windows, verified with CUDA tensors (1 day).- Routes and Inspection, Routing. A view call is offered to every open route: the live session, the in-process core and the network server.
- Network Streaming Calls, Network Streaming. The Python calls that stream over a WebSocket.
- Network Streaming Calls, serve. serve starts the server in the producer script and prints the viewer link.
- Wire Protocol, Flow Control. Flow control keeps the latest snapshot and drops older ones.
- Notebook Training Runs. Watch a training run in a notebook with caliper.serve, widgets, controls and a browser tab.
- Stream Links. Attach to a stream by its link or the stream file.
- Network Streaming. Network streaming with one set of calls over three transports.
- Pull request #14. Pull request 14 (merged) delivers sprint 2: wire protocol v3 and 3.1, Caliper LIB serving, data views, browser views, the hub, the app attaching to a stream, interactive controls, Caliper API v0, macOS 14 target and CI for the browser views.
- Orchestrators' notes,
sprint2/PR.md. Caliper LIB: caliper.serve, caliper.widget, caliper.controls, caliper.connect, a native sender and a Python fallback. - Orchestrators' notes,
sprint2/PR.md. Measured cost of streaming on MPS: 98.2 percent of control for a 1024 square heatmap, with the cost goal of 3 percent met for single views and missed for all three views with two viewers (4.6 percent). - Orchestrators' notes,
sprint2/PR.md. Review defects fixed in sprint 2: quadratic JSON parsing, unbounded control queues (now 65,536 messages and 16 MiB), 4096 by 4096 heatmap refusal, and the session token in error text. - Orchestrators' notes,
sprint2/PR.md. Follow-up: a fresh per-tick cost breakdown and a new measurement of the Python sender.