Skip to main content

Protobuf contracts

Generated page

This page is generated from the comments in protos/. To change it, edit the .proto files and run make docs-protos.

The protos declare no package, so service names are bare on the wire, for example /ProxyService/RequestExecution. Changes are additive only: new fields use new numbers, and numbers are never reused or renumbered. See Changing protos.

execution.proto​

Service ExecutionService​

Service on the workers to handle execution requests

MethodRequestResponseDescription
RequestExecutionstream WorkerExecutionRequeststream WorkerExecutionResponseBi-directional streaming RPC for streaming code execution input and output

Message WorkerExecutionRequest​

Message used for code execution requests to workers

FieldTypeDescription
request_idstring
session_idstring
worker_idstring
container_idoptional string
checkpoint_idstring
payloadbytes
resourcesrepeated stringImport and artefact hints from the client's static analysis, forwarded by the router so a worker can pick a checkpoint that already has them.
budgetsrepeated ResourceBudgetThe resource budgets (memory, GPU memory, ...) the router placed this request on. The worker sets each at container create and auto-expands up to the budget's max where the runtime can enforce it.
packagesrepeated stringPyPI requirement strings the worker installs in the sandbox before the payload reaches the executor. The router has already deduped them and removed what the base image carries.

Message WorkerExecutionResponse​

Message used for code execution responses from workers

FieldTypeDescription
request_idstring
session_idstring
worker_idstring
container_idstring
checkpoint_idstring
successbool
logsstring
payloadbytes
budgetsrepeated ResourceBudgetThe budgets the container actually ran with (post auto-expand).

proxy.proto​

Service ProxyService​

Service on the router to handle execution requests from external clients

MethodRequestResponseDescription
RequestExecutionstream ClientExecutionRequeststream ClientExecutionResponseBi-directional streaming RPC for streaming code execution input and output

Message ClientExecutionRequest​

Message used for code execution requests from clients

FieldTypeDescription
request_idstring
session_idstring
payloadbytes
configExecutionConfig

Message ClientExecutionResponse​

Message used for code execution responses to clients

FieldTypeDescription
request_idstring
session_idstring
successbool
logsstring
payloadbytes
worker_idstringWhere the execution actually ran. Attribution only: a client cannot ask for a particular worker or container, but it can report which one was slow.
container_idstring

Message ExecutionConfig​

Per-call configuration the client sends as the first message of a stream.

FieldTypeDescription
importsrepeated stringTop-level module names the function refers to, from the client's static analysis. Forwarded to the worker so it can pick a checkpoint that already imported them. Attribution/selection only: not a memory hint.
budgetsrepeated ResourceBudgetResource budgets the user set on the decorator (memory, GPU memory, ...). A budget with alloc == 0 asks the router to apply its default for that kind.
gpuboolWhether the function needs a GPU. The router also treats any GPU-memory budget as a GPU request, so this covers a GPU function that names no size.
disable_optimized_executionboolWhen true, the router skips checkpoint restore for this call and always cold-starts. Session affinity (warm-container reuse) still applies; the router rejects this only when the session's warm container was itself restored from a checkpoint.
packagesrepeated stringPyPI requirement strings (PEP 508) the function needs installed. The router validates and dedupes them, drops any distribution the flavor's base image already carries, and the worker installs the rest before the call runs.
checkpoint_idstringWhen set, the router uses exactly this checkpoint instead of selecting one, and rejects the request if the flavor's catalogue has no such checkpoint. The worker still falls back to a cold start if the restore itself fails. Mutually exclusive with disable_optimized_execution.

registry.proto​

Service RegistryService​

Service on the router to handle status and utilization updates from workers and executors

MethodRequestResponseDescription
PostWorkerStatusWorkerStatusRegistryUpdateResponseUnary RPC for posting worker status
PostExecutorStatusExecutorStatusRegistryUpdateResponseUnary RPC for posting executor status
PostWorkerUtilizationWorkerUtilizationRegistryUpdateResponseUnary RPC for posting worker utilization
PostExecutorUtilizationExecutorUtilizationRegistryUpdateResponseUnary RPC for posting executor utilization

Message ExecutorStatus​

Message used for posting executor status

FieldTypeDescription
container_idstring
worker_idstring
request_idstring
session_idstring
statusStatus

Message ExecutorUtilization​

Message used for posting executor utilization

FieldTypeDescription
container_idstring
worker_idstring
cpu_utilint64
cpu_totalint64
gpu_utilint64
gpu_totalint64

Message RegistryUpdateResponse​

FieldTypeDescription
updatedbool

Message WorkerStatus​

Message used for posting worker status

FieldTypeDescription
worker_idstring
worker_uristring
statusStatus
mem_totalint64Capacity, stamped on every status so a router that restarts relearns it from the next report rather than scheduling blind until the worker happens to re-register. bytes this worker will hand out to executors
max_executorsint32concurrent containers, 0 meaning unbounded
flavorstring"cpu" (CPU-only) or "gpu" (CPU + GPU). The router routes GPU requests only to gpu workers and prefers cpu workers for CPU requests.
gpu_mem_totalint64GPU device memory, in bytes, this worker offers

Message WorkerUtilization​

Message used for posting worker utilization

FieldTypeDescription
worker_idstring
cpu_utilint64
cpu_totalint64
gpu_utilint64
gpu_totalint64
mem_usedint64Memory is what actually bounds how many executors fit on a worker, so the scheduler scores on it. Until these existed the worker sent only executor utilization and worker-level load did not exist at all. bytes reserved by live executors
mem_totalint64bytes available to executors
executor_countint32live containers right now
gpu_mem_usedint64GPU device memory, so the router can place GPU requests on headroom the same way it does system memory.
gpu_mem_totalint64

Enum Status​

NameNumberDescription
STATUS_UNKNOWN0
STATUS_READY2
STATUS_BUSY3
STATUS_ERROR4
STATUS_REMOVED5

resources.proto​

Message ResourceBudget​

A single resource budget: what to start with and how far it may grow.

Both are byte counts. alloc is the initial reservation the router places on and the worker sets at container create; 0 means "unset, apply the default". max is the auto-expand ceiling; 0 means "bounded only by worker capacity".

FieldTypeDescription
kindResourceKind
allocint64
maxint64

Enum ResourceKind​

A resource whose budget a caller can set per function. Kept deliberately generic: a new dimension is one enum value here, one capacity source in the router, and (where the runtime can enforce it) one grower in the worker.

NameNumberDescription
RESOURCE_KIND_UNKNOWN0
RESOURCE_KIND_MEMORY1system RAM, in bytes
RESOURCE_KIND_GPU_MEMORY2GPU device memory, in bytes