pixano_inference.client
Client for the Pixano Inference /v1 API.
Two clients share one contract: :class:PixanoInferenceClient (async) and
:class:SyncPixanoInferenceClient (sync). Both hold a pooled httpx transport, send the
optional API key, retry transient failures with backoff, and raise
:class:PixanoInferenceError for every failure: the server's {code, message, requestId}
envelope on an error status, connection_error when the server cannot be reached, and
invalid_response when a successful response does not match its schema.
Requests serialize as camelCase JSON (by_alias=True); media is passed by value as a URL,
base64 data-URI, or media-root path (the server also exposes /binary multipart routes for
callers that prefer raw uploads).
PixanoInferenceClient(url, *, transport=None, **kwargs)
Bases: _ClientBase
Asynchronous client for the Pixano Inference /v1 API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
Base server URL. |
required |
transport
|
AsyncBaseTransport | None
|
Optional httpx transport (e.g. an ASGI transport for in-process tests). |
None
|
**kwargs
|
Any
|
Shared client options (api_key, timeout, retries, ...). |
{}
|
Source code in pixano_inference/client.py
__aenter__()
async
__aexit__(*exc)
async
aclose()
async
cancel_job(job_id)
async
connect(url, *, api_key=None, **kwargs)
classmethod
Construct a client for url (kept for backward compatibility).
deploy_model(request, *, timeout=None)
async
Deploy a model at runtime.
Source code in pixano_inference/client.py
detection(request, *, timeout=None)
async
embedding(request, *, timeout=None)
async
Compute image or text embeddings (CLIP-style shared space).
Source code in pixano_inference/client.py
get_job(job_id)
async
health()
async
info()
async
list_models()
async
List deployed models with their live status.
ner(request, *, timeout=None)
async
ready()
async
Return the readiness report (does not raise on 503).
segmentation(request, *, timeout=None)
async
Run image segmentation.
Source code in pixano_inference/client.py
submit_tracking_job(request, *, timeout=None)
async
Submit a tracking request as an asynchronous job.
Source code in pixano_inference/client.py
tracking(request, *, timeout=None)
async
Run synchronous video tracking (short intervals).
Source code in pixano_inference/client.py
undeploy_model(name)
async
vlm(request, *, timeout=None)
async
wait_for_job(job_id, *, poll_interval=1.0, timeout=None)
async
Poll a job until it reaches a terminal state.
Source code in pixano_inference/client.py
PixanoInferenceError(status_code, code, message, request_id=None)
Bases: Exception
Error raised by the client, carrying the server error envelope.
Attributes:
| Name | Type | Description |
|---|---|---|
status_code |
HTTP status of the response, |
|
code |
The server's error code, or one of the client's own: |
|
message |
What went wrong. |
|
request_id |
The server's request id, when a response carried one. |
Source code in pixano_inference/client.py
SyncPixanoInferenceClient(url, *, transport=None, **kwargs)
Bases: _ClientBase
Synchronous twin of :class:PixanoInferenceClient for callers not on an event loop.
Source code in pixano_inference/client.py
__enter__()
__exit__(*exc)
cancel_job(job_id)
close()
connect(url, *, api_key=None, **kwargs)
classmethod
deploy_model(request, *, timeout=None)
Deploy a model at runtime.
Source code in pixano_inference/client.py
detection(request, *, timeout=None)
embedding(request, *, timeout=None)
Compute image or text embeddings (CLIP-style shared space).
Source code in pixano_inference/client.py
get_job(job_id)
health()
info()
list_models()
ner(request, *, timeout=None)
ready()
segmentation(request, *, timeout=None)
Run image segmentation.
submit_tracking_job(request, *, timeout=None)
Submit a tracking request as an asynchronous job.
Source code in pixano_inference/client.py
tracking(request, *, timeout=None)
Run synchronous video tracking (short intervals).
Source code in pixano_inference/client.py
undeploy_model(name)
vlm(request, *, timeout=None)
wait_for_job(job_id, *, poll_interval=1.0, timeout=None)
Poll a job until it reaches a terminal state.