Skip to main content

Crate tilo_model_client

Crate tilo_model_client 

Source
Expand description

Model RPC over capabilities supplied by an authenticated host.

Modules§

failure
transport
Transport-neutral asynchronous RPC to the model gateway, over the descriptor its launcher hands an app. Install this transport in the host’s ModelBackend, not a process global.
validation

Structs§

FaceImage
One deliberately small photograph reference supplied to the dedicated local face runtime. photo_id is an app address, not a pathname; the runtime never receives an identity label or an instruction from Photos.
Frame
PlanTrace
Correlates the model turns of one agent decision.
Response
SubjectMatte
How much of each pixel of a Request::SegmentSubject picture is its subject, and what found it.
VisionImage
The only encoded-preview media types accepted by the local vision RPC. Keeping this vocabulary closed means a caller cannot ask the trusted gateway to fetch a URL or interpret an arbitrary document as an image.

Enums§

ClientError
Request
A request that can cross the sandbox boundary. A server also authenticates the launcher-provided app preamble. No request carries a provider key: this computer keeps none.
TraceEvent
The closed vocabulary of agent timing marks.

Constants§

EVENT_TOOL_CALL
The only streaming event kind: one completed provider tool call, as {"id":..,"name":..,"arguments":<JSON string>} in Response::output.
EVENT_TOOL_CALL_DELTA
An intermediate streaming event requested with deltas: raw argument text appended to the tool call in progress, as {"index":u32,"id":str|null,"name":str,"delta":str} in Response::output. Every delta of a call precedes its tool_call.
FRAMING
Every gateway request and response: a little-endian u32 length, then JSON.
MAX_DELTA_EVENTS
The most tool_call_delta frames one streamed turn may carry; bounded separately from MAX_STREAM_EVENTS. A gateway stops sending deltas at this count (the completed tool_call events still follow).
MAX_STREAM_EVENTS
The most intermediate frames one streamed turn may carry.
NO_SEGMENTATION_MODEL
The message the gateway refuses Request::SegmentSubject with when no segmentation model is installed, so a caller can offer to set one up.
RPC_VERSION
SERVICE_FD_ENV
SERVICE_NAME
Stable ownership namespace used by origin-bound provider credentials.
STOP_POLL
How often a stoppable stream asks whether its caller still wants it.

Functions§

analyze_image
Request a fixed-schema visual analysis through the launcher-issued gateway descriptor. This operation can only be authorized for Photos by the gateway; callers cannot provide a URL, arbitrary prompt, or timeout.
analyze_image_on
analyze_image on the connection descriptor, for a host that holds the model gateway’s descriptor itself rather than through the launcher’s environment (the session’s own services).
available
Whether this process has the launcher-issued service descriptor. This does not probe or connect to a pathname socket, so the sandbox cannot substitute a different same-UID service.
cluster_faces
Run the dedicated local face model against one bounded batch. This is not a generic multimodal request and cannot be redirected to a hosted model.
cluster_faces_on
cluster_faces on the connection descriptor; see analyze_image_on.
complete_streaming
Complete a neutral turn, delivering presentation-only deltas followed by its authoritative response. Deltas never authorize tool execution.
complete_streaming_until
complete_streaming for a caller that may stop wanting the answer: once stop says so (it is asked every STOP_POLL while the turn runs), the gateway is told to stop the provider call, so an abandoned turn is not paid for to its end and no longer holds the process’s one gateway channel.
is_pinned_revision
Whether revision names an immutable model revision: a full lowercase SHA-1 or SHA-256 commit id, never a branch or tag.
is_supervised_loopback
Whether profile is a model runner the gateway supervises on this device: OpenAI-compatible and reachable only on loopback. Work that must stay on the device (its image operations, private history prose) admits nothing else, and apps discovering such a model apply this same rule so they never offer one the gateway would refuse.
read_frame
Read and decode one size-bounded JSON frame from a gateway stream.
request
Send a request over the launcher-provided service fd. The fd is duplicated for each RPC so a short-lived helper cannot close the parent app’s channel.
segment_subject
Find the subject of one bounded picture with the installed on-device segmentation model.
trace
Send a content-free timing mark. Best effort: a gateway that predates the verb refuses it, and that refusal is ignored by callers.
trace_at
trace for a mark that happened at at_unix_ms and was held back while a streamed turn used the channel; the gateway logs that time.
write_frame
Write one size-bounded JSON frame to a gateway stream.