AI Routing

AI models are nodes in the signal graph. Inference is signal flow. Models load onto hardware, process signals, and emit results — all through the same wiring as everything else. No special API. No framework. Just connections.

Loading and Running Models

Use mde() to load a model and @to pin it to specific hardware. AI Routing reads each device's component history and routes to optimal hardware automatically. The @ pin overrides when you know better.

.zpmodel loading
// load a model, run on specific hardware
frame -> detect @ mde("yolo-v8.zdx") @ goya(0) -> objects

// let the OS choose the best available hardware
frame -> detect @ mde("yolo-v8.zdx") -> objects

Hot-Swap Models

Models can be swapped at runtime without restarting the signal graph. The new model replaces the old one and the chain continues.

.zphot-swap
// swap model at runtime — no restart
detect.mde = "yolo-v9.zdx"

// the signal chain keeps flowing
// old model out, new model in
// zero downtime

Cascading Experts

Each stage in a pipeline can run on different hardware, optimized for that stage's workload. Preprocessing on FPGA, detection on one accelerator, classification on another, decision on CPU, action on GPIO.

.zpcascading experts
camera -> preprocess @ fpga(0)
       -> detect     @ goya(0)
       -> classify   @ goya(1)
       -> decide     @ cpu
       -> act        @ gpio

Hardware-Aware Routing

AI Routing reads each device's hardware telemetry and component history to make routing decisions. Grade-based routing sends high-value inference to high-grade chains and bulk inference to any chain above minimum.

.zpgrade-based routing
// route by grade — healthiest get more work
cards -> route(proportional: grade)

// tier by grade
grade -> gate(> 0.9)       -> tier_prime
grade -> gate(0.6 ~ 0.9)   -> tier_general
grade -> gate(0.3 ~ 0.6)   -> tier_light
grade -> gate(<= 0.3)      -> tier_rest

Grade

Continuous health score. Not boolean. Proportional. Everything downstream reacts proportionally — a card at 0.8 gets 80% of the load a perfect card gets. The fleet doesn't have outages. It has gradients.

.zpgrade
grade : weighted(
    thermal:   0.3,
    timing:    0.25,
    bandwidth: 0.25,
    aging:     0.1,
    errors:    0.1
) // outputs 0.0 to 1.0

// grade propagation through chain
camera(grade: 0.95) -> detect(grade: 0.7) -> decide(grade: 0.99)
// chain grade: min(0.95, 0.7, 0.99) = 0.7
// or: product(0.95, 0.7, 0.99) = 0.658
// policy is configurable per chain