Skip to content

response

response

The status message a remote job sends back to the client.

Each update NDIF pushes for a job — whether streamed over a blocking websocket or saved to the object store and polled — arrives as a ResponseModel. Its Status names where the job is in its lifecycle; on COMPLETED the returned values ride in data and what the run cost the server rides in meta.

RESULT module-attribute

RESULT = Dict[str, Any]

Status

Bases: str, Enum

Where a remote job is in its lifecycle (or a transient log message).

RECEIVED class-attribute instance-attribute

RECEIVED = 'RECEIVED'

QUEUED class-attribute instance-attribute

QUEUED = 'QUEUED'

PROVISIONING class-attribute instance-attribute

PROVISIONING = 'PROVISIONING'

DEPLOYING class-attribute instance-attribute

DEPLOYING = 'DEPLOYING'

DISPATCHED class-attribute instance-attribute

DISPATCHED = 'DISPATCHED'

RUNNING class-attribute instance-attribute

RUNNING = 'RUNNING'

COMPLETED class-attribute instance-attribute

COMPLETED = 'COMPLETED'

ERROR class-attribute instance-attribute

ERROR = 'ERROR'

LOG class-attribute instance-attribute

LOG = 'LOG'

ResponseModel

Bases: BaseModel

One status update for a remote job, optionally carrying its result.

Streamed over the websocket for a blocking job, or saved to the object store and fetched by the client for a non-blocking one. data holds the saved values only on a COMPLETED response, and meta what the run cost on the server -- on COMPLETED and on a failure alike, since a job that ran out of memory or timed out is exactly when its cost is worth reading.

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True, protected_namespaces=())

id instance-attribute

id: str

status instance-attribute

status: Status

description class-attribute instance-attribute

description: str = ''

data class-attribute instance-attribute

data: Optional[Any] = None

meta class-attribute instance-attribute

meta: Optional[dict] = None

__str__

__str__() -> str

pickle

pickle() -> bytes

Serialize to bytes via torch.save (carries tensors in data).

Pickle protocol 4: torch.save's default protocol 2 has no bytes opcode and writes a bytes value in data through a latin-1 str, 1.5x the size and several times slower to save and load.

unpickle classmethod

unpickle(data: bytes) -> ResponseModel

Rebuild a ResponseModel from pickle bytes (onto CPU).