Generic job daemon¶
flowedge-jobd runs bounded cooperative jobs as a managed local service. The first built-in route is
Mamba streaming; custom iterative, streaming, and speculative backends use the same JobService
contract in an embedding process.
Run the complete demo¶
cmake -S . -B build-relay -DCMAKE_BUILD_TYPE=Release \
-DFLOWEDGE_RELAY=ON
cmake --build build-relay --config Release -j
FLOWEDGE_BUILD_DIR="$PWD/build-relay" \
./scripts/job_demo.sh models/mamba_flow.safetensors
The script submits interactive and critical streams, drains and resumes one lane, validates traces and metrics, then shuts down through the control plane.
Run it manually¶
Terminal 1:
./build-relay/src/relay/flowedge-jobd \
--model models/mamba_flow.safetensors --create \
--workers 2 --threads 0 --max-tokens 512 \
--trace jobs.trace --metrics-prometheus jobs.prom
Terminal 2:
./build-relay/src/relay/flowedge-jobctl status
./build-relay/src/relay/flowedge-jobctl mamba \
--model models/mamba_flow.safetensors --tokens 1,2,3,4 \
--session 42 --generation 1 --class interactive
./build-relay/src/relay/flowedge-jobctl drain --worker 0
./build-relay/src/relay/flowedge-jobctl resume --worker 0
./build-relay/src/relay/flowedge-jobctl shutdown
flowedge-jobctl mamba loads model identity for diagnostics. Long-lived producers should retain
their route metadata and use JobClient directly.
Operations¶
Command |
Effect |
|---|---|
|
Queue, lane, QoS, failure, quarantine, and transport state |
|
Stop new dispatch to a lane; migrate compatible active state when possible |
|
Return a fully drained lane to service |
|
Clear a quarantined, drained lane and return it to service |
|
Publish an acknowledgement, then stop |
Data and administration use different SPSC ring pairs. A blocked data consumer therefore cannot prevent status or lane administration. Each pair still requires one producer and one consumer.
Production settings¶
Option |
Contract |
|---|---|
|
One mutable adapter instance and outer thread per lane |
|
Core background threads inside each lane |
|
Cancellation and migration boundary |
|
Calibrated deadline cost per token; |
|
Fixed safety margin added to predicted work |
|
Slots reserved from best-effort traffic; default |
|
Slots reserved from lower-class traffic; default |
|
Consecutive failures before quarantine; default |
|
NUMA-aware outer-worker placement |
Deadlines remain primary; service class breaks equal-deadline ties. Reserved slots prevent lower classes from consuming the whole queue. A quarantined lane must drain before explicit recovery. Lifecycle traces contain metadata, not model payloads. See Observability.