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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ax_serving-2.3.2.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ax_serving-2.3.2-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file ax_serving-2.3.2.tar.gz.

File metadata

  • Download URL: ax_serving-2.3.2.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for ax_serving-2.3.2.tar.gz
Algorithm Hash digest
SHA256 1da86125eafdac9adffe376c05d8d0165305c886660c722701d3dd89f303b247
MD5 f9aa22c6cb922cb1b8ab7162bc4df502
BLAKE2b-256 98d7a9a8f10c62e9f3646442aa097be539eb63fe41faf132be9c99fbd4ce0231

See more details on using hashes here.

File details

Details for the file ax_serving-2.3.2-py3-none-any.whl.

File metadata

  • Download URL: ax_serving-2.3.2-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for ax_serving-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2feb69b19064b790bbd70e6106fcb3c5cf83ae1f43f9ed3d4b7cf0c4638671ff
MD5 babb16cf98dd2c0d8b5fec78119de8e7
BLAKE2b-256 3693d0f20e9f03287440f8e84f158c0027924e205a1397639b3d9b7a6a63f64e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.3.2 This release

2 files

2.3.1

2 files

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