Skip to main content

Module infer_proxy

Module infer_proxy 

Source
Expand description

Stable inference address, proxy and resolution (card mesh-placement-19; ADR-101 section 5).

  • table: the PlacementTable, role to serving node, fed by the card-18 adapters (local) and infer.<role> ServiceAdvertisements of admitted peers (remote). Resolution for in-process consumers (base_url_for_role, wired to clawft_llm::PlacementResolver).
  • listener: InferProxy, the loopback endpoint proxy that keeps 127.0.0.1:<role port> stable while the instance moves.
  • mesh_forward / wire: forwarding over the authenticated mesh (frame types InferRequest / InferResponse).
  • http / upstream: the HTTP edge and the loopback client.

The proxy is not a general proxy. It binds loopback only, takes the destination from the placement table and never from the request, allows GET and POST on an inference path allowlist, refuses a non-loopback Host and a cross-origin Origin, and bounds sizes and times (ProxyLimits). Mesh forwarding reaches only admitted, verified peers and only roles a node chose to expose.

Re-exports§

pub use types::ChainAudit;
pub use hub::InferHub;
pub use listener::ExposureAuth;
pub use listener::ExposurePermit;
pub use listener::InferProxy;
pub use listener::OccupiedPolicy;
pub use listener::ProxyStats;
pub use listener::Started;
pub use listener::check_bind;
pub use mesh_forward::InferPeer;
pub use mesh_forward::ServeGate;
pub use mesh_forward::ServePolicy;
pub use mesh_forward::Served;
pub use mesh_forward::forward_remote;
pub use mesh_forward::serve_infer;
pub use table::DEFAULT_ADVERT_TTL;
pub use table::MeshLocal;
pub use table::PlacementTable;
pub use table::SERVICE_PREFIX;
pub use table::SyncOutcome;
pub use types::MeshDialer;
pub use types::Method;
pub use types::ProxyAudit;
pub use types::ProxyError;
pub use types::ProxyLimits;
pub use types::ProxyRequest;
pub use types::ResponseSink;
pub use types::Target;
pub use upstream::Upstream;

Modules§

http
Minimal HTTP/1.1 for the loopback listener, and the request allowlist.
hub
The mesh side of the stable inference address in a daemon that owns its mesh connections (collapsed or legacy mode): adverts and forwarded requests travel as control messages on INFER_TOPIC, handed to the hub with the connection’s own PeerCtx.
listener
The loopback listener that keeps 127.0.0.1:<role port> stable.
mesh_forward
Forwarding over the mesh: the consumer side (forward_remote) and the serving side (serve_infer).
mesh_policy
What a peer may ask of a local model server over the mesh.
table
The placement table: which node serves infer.<role> right now.
types
Shared types of the stable inference address (card mesh-placement-19).
upstream
Forwarding to a loopback inference server.
wire
Mesh wire format of a forwarded inference request (frame types InferRequest 0x10 and InferResponse 0x11).