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§
- Face
Image - One deliberately small photograph reference supplied to the dedicated
local face runtime.
photo_idis an app address, not a pathname; the runtime never receives an identity label or an instruction from Photos. - Frame
- Plan
Trace - Correlates the model turns of one agent decision.
- Response
- Subject
Matte - How much of each pixel of a
Request::SegmentSubjectpicture is its subject, and what found it. - Vision
Image - 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§
- Client
Error - 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.
- Trace
Event - 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>}inResponse::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}inResponse::output. Every delta of a call precedes itstool_call. - FRAMING
- Every gateway request and response: a little-endian
u32length, then JSON. - MAX_
DELTA_ EVENTS - The most
tool_call_deltaframes one streamed turn may carry; bounded separately fromMAX_STREAM_EVENTS. A gateway stops sending deltas at this count (the completedtool_callevents still follow). - MAX_
STREAM_ EVENTS - The most intermediate frames one streamed turn may carry.
- NO_
SEGMENTATION_ MODEL - The message the gateway refuses
Request::SegmentSubjectwith 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_imageon the connectiondescriptor, 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_faceson the connectiondescriptor; seeanalyze_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_streamingfor a caller that may stop wanting the answer: oncestopsays so (it is asked everySTOP_POLLwhile 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
revisionnames an immutable model revision: a full lowercase SHA-1 or SHA-256 commit id, never a branch or tag. - is_
supervised_ loopback - Whether
profileis 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 tracefor a mark that happened atat_unix_msand 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.