Skip to content

Binding routing and locality

A project binds to a model, and the two may not be on the same node, in the same cluster, or in the same cloud. Locality planning decides how the project reaches the model, and it produces a plan rather than opening a route.

Five plan kinds

Plan Means
Already local The model target is private and already beside the project
Model target expansion The model is expanded to where the project runs
Project relocation The project is relocated to where the model runs
Private fabric An approved private route across nodes
Reject No permitted plan reaches this model from this project

reject is a plan kind rather than an error, which matters: the planner always answers, and a binding that cannot be satisfied says so as a decision with a recorded reason.

Two route classes

same-placement-private-service      local, no fabric involved
xratu-managed-private-fabric        a managed private route between nodes

Neither exposes a model endpoint publicly. The fabric is a data-plane-managed mTLS tunnel between nodes, established under explicit control-plane assignments.

The planner prefers not moving anything

flowchart TB
  A["Is the model already local and private?"]
  B["Already local"]
  C["Can the model be expanded to the project?"]
  D["Model target expansion"]
  E["Can the project be relocated to the model?"]
  F["Project relocation"]
  G["Is a private fabric route approved?"]
  H["Private fabric"]
  I["Reject"]
  A -->|yes| B
  A -->|no| C
  C -->|yes| D
  C -->|no| E
  E -->|yes| F
  E -->|no| G
  G -->|yes| H
  G -->|no| I

The four placements

flowchart LR
  subgraph N1["NODE 1"]
    direction TB
    P["Project runtime"]
    ML["Model, already local"]
    MX["Model, expanded here"]
    P --- ML
    P --- MX
  end
  subgraph N2["NODE 2"]
    direction TB
    M["Model runtime"]
    PR["Project, relocated here"]
    PR --- M
  end
  P <-.->|"private fabric, mTLS"| M

Solid edges stay on one node and involve no fabric. The one dashed edge crosses nodes, and it exists only when the planner assigned a private fabric route.

Locality first, movement second, a cross-node route last. Each step is a recorded plan kind, so the answer to "why is this binding going over the fabric" is that the earlier options were unavailable, and the plan says which.

Plans become assignments

A locality plan produces binding route assignments under model.binding_route, carried on the ordinary assignment path. A fabric route exists because the control plane assigned it.

Two of the plan kinds produce their own contracts, because they move something: model target expansion and project relocation each have a versioned contract describing what is being moved and where.

What the project calls

A project reaches its model through a Service in the same cluster whatever the plan kind, so the call a project makes has one shape and the plan decides what stands behind it.

flowchart TB
  subgraph LOC["LOCAL, same-placement-private-service"]
    direction LR
    P1["Project runtime"]
    S1["Model's stable Service<br/>model.namespace.svc.cluster.local"]
    M1["Model runtime<br/>release route target"]
    P1 --> S1 --> M1
  end
  subgraph FAB["PRIVATE FABRIC, xratu_managed_private_fabric"]
    direction LR
    P2["Project runtime"]
    S2["Local binding Service<br/>mbind-token, project namespace"]
    G2["Import gateway, then<br/>export gateway on the model's node"]
    M2["Model runtime"]
    P2 --> S2 --> G2 --> M2
  end

A local plan covers a project and model that share a node or a cluster namespace, and the two plan kinds that make them share one: model target expansion and project relocation. The project calls the model's stable Service endpoint, http://<model>.<namespace>.svc.cluster.local, with xratu-models as the default namespace. The name belongs to the model rather than to a version, and the model's release route decides which version answers it. See Versioned release routes and bindings.

A fabric plan puts a Service named mbind-<token> in the project's own namespace, backed by the import gateway on the project's node and the export gateway on the model's node. The project calls that local Service exactly as it would call a model beside it.

The plan is versioned

model.binding_locality.plan.v1          the decision
model.binding_locality.assignments.v1   what it produces
model.binding_target.expand.v1          expanding a model target
project.binding_runtime.relocate.v1     relocating a project runtime

Versioning the plan separately from its assignments allows the record of what was decided to be read independently of what was dispatched for it.

What happens when the route is not ready

A binding whose route has not resolved holds the run rather than failing it. The dispatch guard is where that hold is applied, and it clears when the route resolves. See Dispatch guard.