mstar.api_server.request_types#
Classes
|
Envelope for messages received by the API server. |
|
One append to a running request's client streams, queued behind the request's own |
|
The conductor's periodic status, sent only while metrics are on: one snapshot per family in |
|
Profiling reported by the API-server data worker at preprocess finish (or failure): the timestamp at which the request was handed to the conductor and the per-modality sizes of the raw inputs. |
|
|
|
Signals that a request has finished processing. |
|
Signals that a request died in the engine and will produce no result. |
|
One chunk of generated output for a request. |
|
|
|
One step's client-facing scalars (sampled tokens), every request in one frame. |
- class mstar.api_server.request_types.APIServerMessage(message_type, body=None)[source]#
Bases:
objectEnvelope for messages received by the API server.
- Parameters:
message_type (str)
body (ResultTensors | ResultTokens | RequestComplete | RequestFailed | ConductorStatus | None)
- body: ResultTensors | ResultTokens | RequestComplete | RequestFailed | ConductorStatus | None = None#
- class mstar.api_server.request_types.ClientAppend(request_id, file_paths=None, ends=frozenset({}), text=None, file_streams=None, model_kwargs=None, on_late=None)[source]#
Bases:
objectOne append to a running request’s client streams, queued behind the request’s own
PreprocessInputso its chunks stay in order. The streams inendsend after this chunk. Stays inside the API server process.- Parameters:
- class mstar.api_server.request_types.ConductorStatus(metrics)[source]#
Bases:
objectThe conductor’s periodic status, sent only while metrics are on: one snapshot per family in
catalog.STATUS_FAMILIES, current or cumulative values only, never per-request data.- Parameters:
metrics (list[MetricSnapshot])
- metrics: list[MetricSnapshot]#
- class mstar.api_server.request_types.DataWorkerProfile(request_id, preprocess_finish_time=None, inputs=<factory>, dequeue_time=None, input_modalities=<factory>, upload_sizes=<factory>, failed=False)[source]#
Bases:
objectProfiling reported by the API-server data worker at preprocess finish (or failure): the timestamp at which the request was handed to the conductor and the per-modality sizes of the raw inputs. (The data worker’s tx/rx are read directly from its tensor manager at request completion, not via this.)
- Parameters:
- class mstar.api_server.request_types.PreprocessInput(request_id: str, text: str | None, file_paths: dict[str, list[str]] | None, input_modalities: list[str], output_modalities: list[str], model_kwargs: dict, prompt_parts: list[mstar.model.multimodal.PromptPart] | None = None, client_request_id: str | None = None, ends: frozenset[str] = frozenset())[source]#
Bases:
object- Parameters:
- prompt_parts: list[PromptPart] | None = None#
- class mstar.api_server.request_types.RequestComplete(request_id, output_chunk_counts, conductor_ingest_time, conductor_finish_time, graph_timings=<factory>, rx_info=<factory>, tx_info=<factory>, conductor_arrival_time=None)[source]#
Bases:
objectSignals that a request has finished processing.
- Parameters:
- class mstar.api_server.request_types.RequestFailed(request_id, error_message, status=500)[source]#
Bases:
objectSignals that a request died in the engine and will produce no result.
One message per request, so it routes through the API server’s result loop exactly like
RequestCompletedoes.
- class mstar.api_server.request_types.ResultChunk(request_id, modality, data, metadata=<factory>)[source]#
Bases:
objectOne chunk of generated output for a request.
- class mstar.api_server.request_types.ResultTensors(request_id: str, modality: str, graph_edge: mstar.graph.base.GraphEdge, loop_indices: mstar.graph.loop_indices.NestedLoopIndices, metadata: dict = <factory>)[source]#
Bases:
object- Parameters:
request_id (str)
modality (str)
graph_edge (GraphEdge)
loop_indices (NestedLoopIndices)
metadata (dict)
- loop_indices: NestedLoopIndices#
- class mstar.api_server.request_types.ResultTokens(request_ids, values, loop_indices, signal, modality, metadata=<factory>)[source]#
Bases:
objectOne step’s client-facing scalars (sampled tokens), every request in one frame. Replaces one ResultTensors per request for an output whose value the worker already holds on the host: no transport tensor, no ack.
- Parameters:
- loop_indices: list[NestedLoopIndices | None]#