Model Endpoints¶
All classes here are returned by the
get_model_endpoint
method and provide a predict
function.
AsyncEndpoint ¶
Bases: Endpoint
An asynchronous model endpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_endpoint |
ModelEndpoint
|
ModelEndpoint object. |
required |
client |
A LaunchClient object |
required |
predict ¶
Runs an asynchronous prediction request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
EndpointRequest
|
The |
required |
Returns:
Name | Type | Description |
---|---|---|
EndpointResponseFuture
|
An |
|
Example |
EndpointResponseFuture
|
|
EndpointResponseFuture
|
.. code-block:: python my_endpoint = AsyncEndpoint(...) f: EndpointResponseFuture = my_endpoint.predict(EndpointRequest(...)) result = f.get() # blocks on completion |
predict_batch ¶
(deprecated) Runs inference on the data items specified by urls. Returns a AsyncEndpointResponse.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
requests |
Sequence[EndpointRequest]
|
List of EndpointRequests. Request_ids must all be distinct. |
required |
Returns:
Type | Description |
---|---|
AsyncEndpointBatchResponse
|
an AsyncEndpointResponse keeping track of the inference requests made |
SyncEndpoint ¶
Bases: Endpoint
A synchronous model endpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_endpoint |
ModelEndpoint
|
ModelEndpoint object. |
required |
client |
A LaunchClient object |
required |
predict ¶
Runs a synchronous prediction request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
EndpointRequest
|
The |
required |
StreamingEndpoint ¶
Bases: Endpoint
A synchronous model endpoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_endpoint |
ModelEndpoint
|
ModelEndpoint object. |
required |
client |
A LaunchClient object |
required |
predict ¶
Runs a streaming prediction request.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
EndpointRequest
|
The |
required |
Returns:
Type | Description |
---|---|
EndpointResponseStream
|
An |