requests (synchronous) and aiohttp (asynchronous).
is_transient
The exception raised while dispatching a request.
True if the failure is transient and should be retried.
tile_retry_logger
on_retry callback that logs a per-tile dispatch retry.
Returns the callback expected by retry_sync / retry_async, emitting a structured tile_dispatch_retry warning. Shared by every per-tile dispatch path so the retry log event and fields stay identical.
The logger to emit on.
Index of the tile being retried, recorded in the event.
Retry budget, used to report the total attempt count.
(attempt, exc, delay) that logs the retry.
retry_sync
retry_async for threaded (non-async) callers, such as the TorchModel thread-pool dispatch. Shares the same backoff policy, defaults, and on_retry contract so both paths behave identically.
Zero-argument callable that performs one attempt.
Number of retries after the initial attempt (so the total number of attempts is
max_retries + 1).Seed for the exponential backoff (
base_delay * 2**n).Predicate deciding whether a raised exception is transient and worth retrying.
Blocking sleep function; injectable so tests can skip real waits.
Optional callback invoked before each retry with the zero-based attempt number, the exception, and the delay.
BaseException- Re-raises the last exception when the retry budget is exhausted or the exception is not retryable.
retry_async
Zero-argument coroutine factory that performs one attempt.
Number of retries after the initial attempt (so the total number of attempts is
max_retries + 1).Seed for the exponential backoff (
base_delay * 2**n).Predicate deciding whether a raised exception is transient and worth retrying.
Async sleep function; injectable so tests can skip real waits.
Optional callback invoked before each retry with the zero-based attempt number, the exception, and the delay.
BaseException- Re-raises the last exception when the retry budget is exhausted or the exception is not retryable.
HTTPClient
predict / embed only need the serialized body.
Root URL of the model server, e.g.
"http://localhost:8080".Mapping of endpoint type to path. At least one key must be present; see the example below.
HTTP request timeout in seconds.
close
predict
Serialized JSON request payload.
embed
Serialized JSON request payload.
predict_with_embedding
NotImplementedError.
Serialized JSON request payload.
embedding populated
alongside output.
metadata
predict_async
Serialized JSON request payload.
An
aiohttp.ClientSession for connection pooling.embed_async
Serialized JSON request payload.
An
aiohttp.ClientSession for connection pooling.predict_with_embedding_async
Serialized JSON request payload.
An
aiohttp.ClientSession for connection pooling.embedding populated
alongside output.
