Skip to main content

AX Serving Python SDK

The ax-serving package is the official Python client for AX Serving, a runtime-neutral gateway for heterogeneous LLM infrastructure.

Use the SDK to call an AX Serving gateway through its OpenAI-compatible REST/SSE API. An optional gRPC transport is available for the embedded macOS compatibility service.

Install

Add the portable REST client with uv:

uv add ax-serving

For the embedded gRPC compatibility client:

uv add "ax-serving[grpc]"

The base package intentionally does not install gRPC. It also does not bundle the AX Serving server or an inference runtime.

Chat completions

from ax_serving import Client

client = Client(
    base_url="http://127.0.0.1:18080",
    api_key="your-api-key",
)

response = client.chat.completions.create(
    model="default",
    messages=[
        {"role": "user", "content": "Explain heterogeneous LLM serving."},
    ],
    max_tokens=128,
)

print(response.choices[0].message.content)

If api_key is omitted, the client reads AXS_API_KEY.

Streaming

for chunk in client.chat.completions.create(
    model="default",
    messages=[{"role": "user", "content": "Count from one to five."}],
    stream=True,
):
    text = chunk.choices[0].delta.content
    if text:
        print(text, end="", flush=True)

List models

for model in client.models_list():
    print(model.id)

Embedded gRPC compatibility

The gRPC transport is for the embedded macOS compatibility service. AX Serving adapters and agents expose dedicated vLLM, SGLang, TensorRT-LLM, TensorRT Edge-LLM, and other runtime domains to the portable gateway; applications continue to use the REST client shown above.

from ax_serving import GrpcClient

with GrpcClient() as client:
    print(client.health())
    for text in client.infer(
        "default",
        messages=[{"role": "user", "content": "Hello"}],
        max_tokens=32,
    ):
        print(text, end="", flush=True)

Documentation

AX Serving is licensed under the Apache License 2.0.

Metadata

Release files for ax-serving 2.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ax-serving 2.3.2
File Size Uploaded Provenance Actions
ax_serving-2.3.2.tar.gz 41.0 kB Without provenance Details for ax_serving-2.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ax-serving 2.3.2
File Interpreter ABI Platform Actions
ax_serving-2.3.2-py3-none-any.whl Python 3 none any Details for ax_serving-2.3.2-py3-none-any.whl

Total release size: 60.7 kB

Release files / ax_serving-2.3.2.tar.gz

Download URL ax_serving-2.3.2.tar.gz
Size 41.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1da86125eafdac9adffe376c05d8d0165305c886660c722701d3dd89f303b247
BLAKE2b-256 checksum
How to use checksums
98d7a9a8f10c62e9f3646442aa097be539eb63fe41faf132be9c99fbd4ce0231
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ax_serving-2.3.2-py3-none-any.whl

Download URL ax_serving-2.3.2-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2feb69b19064b790bbd70e6106fcb3c5cf83ae1f43f9ed3d4b7cf0c4638671ff
BLAKE2b-256 checksum
How to use checksums
3693d0f20e9f03287440f8e84f158c0027924e205a1397639b3d9b7a6a63f64e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.2 {"installer":{"name":"uv","version":"0.12.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for ax-serving 2.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.3.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page