Install & Compatibility
Where this runs
tested against v2.36.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.12
✕ build_error
✓ 6.2s
py 3.13
✕ build_error
✓ 6.55s
py 3.9
✕ build_error
1/2 runs
226MB installed
● package 226MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
InferenceServerClient
✓ from tritonclient.http import InferenceServerClient
InferenceServerClient
✓ from tritonclient.grpc import InferenceServerClient
InferInput
✓ from tritonclient.http import InferInput
✗ from tritonclient.grpc import InferInput
InferInput is specific to HTTP or gRPC client, depending on which one you're using. Import from the correct submodule (http or grpc).
InferRequestedOutput
✓ from tritonclient.grpc import InferRequestedOutput
✗ from tritonclient.http import InferRequestedOutput
InferRequestedOutput is specific to HTTP or gRPC client, depending on which one you're using. Import from the correct submodule (http or grpc).
InferenceServerException
✓ from tritonclient.utils import InferenceServerException
ProtocolType
✓ from tritonclient.utils import ProtocolType
This quickstart demonstrates how to initialize an HTTP client, check server readiness, prepare input tensors using NumPy, send an inference request to a hypothetical 'simple_model', and process the returned output. Remember to replace `TRITON_SERVER_URL`, `MODEL_NAME`, `MODEL_VERSION`, `INPUT_NAME`, and `OUTPUT_NAME` with your actual server and model details. For gRPC, import `tritonclient.grpc` instead and use `tritonclient.grpc.InferenceServerClient`.
import numpy as np
import tritonclient.http as tritonhttp
import os
TRITON_SERVER_URL = os.environ.get('TRITON_SERVER_URL', 'localhost:8000')
MODEL_NAME = 'simple_model'
MODEL_VERSION = '1'
INPUT_NAME = 'input_0'
OUTPUT_NAME = 'output_0'
def main():
try:
# Create a Triton HTTP client
client = tritonhttp.InferenceServerClient(url=TRITON_SERVER_URL)
# Check server readiness
if not client.is_server_ready():
print(f"Triton server at {TRITON_SERVER_URL} is not ready.")
return
print(f"Triton server at {TRITON_SERVER_URL} is ready.")
# Prepare input data (e.g., a simple numpy array)
input_data = np.random.rand(1, 16).astype(np.float32)
# Create InferInput object
infer_input = tritonhttp.InferInput(INPUT_NAME, input_data.shape, 'FP32')
infer_input.set_data_from_numpy(input_data, binary_data=True)
# Create InferRequestedOutput object
infer_output = tritonhttp.InferRequestedOutput(OUTPUT_NAME, binary_data=True)
# Send inference request
response = client.infer(
model_name=MODEL_NAME,
inputs=[infer_input],
outputs=[infer_output],
model_version=MODEL_VERSION
)
# Get output as numpy array
output_data = response.as_numpy(OUTPUT_NAME)
print(f"Inference successful! Output shape: {output_data.shape}")
print(f"First 5 output values: {output_data.flatten()[:5]}")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == '__main__':
main()
Debug
Known issues
gotchaWhen using `InferInput` or `InferRequestedOutput`, ensure you import them from the correct protocol submodule (`tritonclient.http` or `tritonclient.grpc`) corresponding to the client you are using. Mixing them will lead to errors.fixExplicitly import `InferInput` and `InferRequestedOutput` from `tritonclient.http` or `tritonclient.grpc` as appropriate for your client instance.
affects: All versions
gotchaFor BYTES tensors (variable-length binary data/strings), it is recommended to use `numpy.object_` for the dtype of the NumPy array. While `numpy.bytes_` is supported for backward compatibility, `numpy.object_` is the preferred and more robust type.fixWhen creating NumPy arrays for BYTES tensors, set the dtype to `np.object_`.
affects: All versions, specifically relevant from recent versions onwards
gotchaThe gRPC client (`tritonclient.grpc.InferenceServerClient`) has known limitations where it does not support timeouts for model configuration and model metadata requests. The HTTP client may also not correctly respect timeouts under 1 second.fixBe aware of these limitations. For gRPC, ensure your server is responsive to avoid indefinite waits. For HTTP, consider increasing timeout values if experiencing unexpected delays with short timeouts.
affects: All recent versions
gotchaAvoid using `tritonclient.utils.cuda_shared_memory` APIs in multithreaded environments. There are known issues that can lead to instability until fixed by the underlying CuPy library.fixIf shared memory is required in multithreaded Python clients, consider using system shared memory (`tritonclient.utils.shared_memory`) or investigate alternatives until the CUDA shared memory issue is resolved in CuPy.
affects: All recent versions (e.g., Triton Inference Server 26.01 and earlier)
gotchaWhen communicating with decoupled models (models that can return multiple responses over time), the order of responses received by the streaming gRPC client may not always match the order in which they were sent by the backend for different requests.fixIf your application relies on response order for decoupled models, ensure you handle responses asynchronously and correlate them using request IDs or other unique identifiers.
affects: All recent versions
gotchaTriton Client PIP wheels for ARM SBSA are not available on PyPI. Installing `tritonclient` via `pip` on ARM SBSA systems may result in an incorrect Jetson version of the library being installed, leading to compatibility issues.fixFor ARM SBSA, obtain the correct client wheel file directly from the ARM SBSA SDK image and install it manually, rather than relying on `pip install tritonclient`.
affects: All recent versions
breakingInstalling `tritonclient` or its dependencies (like `numpy`) in minimal Python environments, such as Alpine Linux containers, may fail if essential build tools (e.g., C/C++ compilers) are not present. Even when pre-built wheels are available, metadata generation or specific dependencies might still trigger compilation steps.fixEnsure that necessary build tools are installed in your environment before attempting to install `tritonclient`. For Alpine Linux, this typically involves `apk add build-base`. For Debian/Ubuntu, `apt-get install gcc` or `build-essential` might be required.
affects: All versions, specifically relevant when installing in minimal Linux distributions (e.g., Alpine)
Upgrade
Version history
2.71.0latest on PyPI · released Jul 29, 2026
Audit
Dependencies
numpyrequiredRequired for creating and handling input/output tensors.
grpciooptionalRequired for gRPC client functionality.
grpcio-toolsoptionalRequired for gRPC client functionality (often installed with grpcio).
geventoptionalUsed for asynchronous HTTP client operations.
cupyoptionalRequired for `cuda_shared_memory` utilities.