requests (synchronous) and aiohttp (asynchronous).
HTTPClient
predict / embed only need the serialized body.
base_url
Root URL of the model server, e.g.
"http://localhost:8080".endpoints
Mapping of endpoint type to path, e.g.
{"prediction": "/api/predict/m-optimus", "embedding": "/api/embed/m-optimus"}. At least one key must be present.timeout
HTTP request timeout in seconds.
close
predict
Serialized JSON request payload.
Response body as a JSON string.
embed
Serialized JSON request payload.
Response body as a JSON string.
metadata
Response body as a JSON string.
predict_async
Serialized JSON request payload.
An
ClientSession for connection pooling.Response body as a JSON string.
embed_async
Serialized JSON request payload.
An
ClientSession for connection pooling.Response body as a JSON string.

