Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ModelExpress Python Client

Python client for ModelExpress -- high-performance GPU-to-GPU model weight transfers using NVIDIA NIXL over RDMA/InfiniBand.

Instead of each inference engine instance loading model weights from storage, one instance loads the model and transfers weights directly to later instances via GPUDirect RDMA, bypassing the CPU entirely.

Installation

# From PyPI (coming soon)
pip install modelexpress

# Editable install from source
pip install -e .

# With test dependencies
pip install -e ".[dev]"

# Additionally install the pinned protobuf code generator when changing protobuf APIs
pip install -e ".[codegen]"

NIXL is expected to be supplied by the runtime environment (TRT-LLM, SGLang, Dynamo, and NemoRL runtime images all ship nixl-cu12 or nixl-cu13). For a bare-environment install, run pip install nixl-cu12 or pip install nixl-cu13 separately, matching your host CUDA toolkit.

Requirements

  • Python >= 3.10
  • protobuf >= 5.27.2 and < 7
  • NVIDIA GPUs with RDMA/InfiniBand support
  • NIXL (NVIDIA Interconnect eXchange Library)
  • A running ModelExpress server (Rust gRPC service backed by Redis)

Quick Start with vLLM

vLLM 0.23.0 and newer recognize --load-format modelexpress natively. Install the ModelExpress Python package in the vLLM image; no VLLM_PLUGINS setting or manual loader registration is required. For older vLLM versions, set VLLM_PLUGINS=modelexpress or call register_modelexpress_loaders() manually.

export MX_SERVER_ADDRESS="modelexpress-server:8001"

vllm serve deepseek-ai/DeepSeek-V4-Pro \
    --load-format modelexpress \
    --tensor-parallel-size 8 \
    --trust-remote-code

Starting the vLLM engine with the modelexpress load format on the source worker will load the weights from disk and register/publish the NIXL and tensor metadata to the MX server. The mx load format is kept as a backward-compatible alias. On the target worker, it retrieves metadata from the MX server and streams weights over RDMA from GPU to GPU. Set MX_ARTIFACT_TRANSFER=1 to also reuse compatible vLLM JIT caches from a ready source.

Quick Start with SGLang

SGLang integrates through its remote_instance loader with the modelexpress backend. Use an SGLang image that includes upstream sgl-project/sglang#24723, such as the known-good release image lmsysorg/sglang:v0.5.13.post1, and install the ModelExpress package into that image.

export MX_SERVER_ADDRESS="modelexpress-server:8001"

python -m sglang.launch_server \
    --model-path deepseek-ai/DeepSeek-V3 \
    --tp 8 \
    --load-format remote_instance \
    --remote-instance-weight-loader-backend modelexpress \
    --modelexpress-config '{"transport": "nixl"}'

Quick Start with TensorRT-LLM

TensorRT-LLM integrates through its native checkpoint_format="MX" interface. Install ModelExpress in a qualified TensorRT-LLM image, then construct the PyTorch backend with the ModelExpress server configuration:

from tensorrt_llm.llmapi import LLM

llm = LLM(
    model="/model",
    checkpoint_format="MX",
    mx_config={
        "server_url": "modelexpress-server:8001",
    },
    tensor_parallel_size=4,
    backend="pytorch",
)

The first replica falls back to the Hugging Face checkpoint and publishes its post-transform weights; later compatible replicas receive them through ModelExpress. The current qualified scope is the LlamaForCausalLM family. See the TensorRT-LLM P2P example for the qualified-image requirement and production-style Kubernetes deployment.

Programmatic Usage

RL trainer and generator APIs

See the RL package quickstart and support guide for trainer publication, generator initialization, and import examples.

MxClient

MxClient is a lightweight gRPC client for communicating with the ModelExpress server:

from modelexpress import MxClient

client = MxClient(server_url="modelexpress-server:8001")

# Query for a source model
response = client.get_metadata("deepseek-ai/DeepSeek-V4-Pro")
if response.found:
    for worker in response.workers:
        print(f"Worker rank {worker.worker_rank}: {len(worker.tensors)} tensors")

# Wait for source readiness (blocks until ready or timeout)
success, session_id, metadata_hash = client.wait_for_ready(
    model_name="deepseek-ai/DeepSeek-V4-Pro",
    worker_id=0,
    timeout_seconds=7200,
)

client.close()

Registering Loaders Manually

Manual registration is only needed for integrations that construct vLLM loaders outside vLLM 0.23.0's native load-format path.

from modelexpress import register_modelexpress_loaders

register_modelexpress_loaders()
# Now vLLM recognizes --load-format modelexpress and mx

Environment Variables

Shared client settings are registered in modelexpress.envs. RL settings are listed in the RL configuration reference.

Variable Default Description
MX_SERVER_ADDRESS localhost:8001 ModelExpress gRPC server address (recommended)
MODEL_EXPRESS_URL localhost:8001 Deprecated in favor of MX_SERVER_ADDRESS. Still read by all client paths and still takes precedence when both are set, because the TRT-LLM live-transfer integration reads only this name. It is removed once that path reads MX_SERVER_ADDRESS; until then set both to the same value.
MX_DISABLE_PATCHES 0 Emergency escape hatch that skips all runtime compatibility patches. Set to 1, true, yes, or on if a patch is incompatible with the installed engine.
MX_EXPECTED_WORKERS Auto-detected from TP size Number of GPU workers to coordinate
MX_SYNC_PUBLISH 0 Source: wait for all workers before publishing metadata
MX_SYNC_START 1 Target: wait for all source workers before transferring
MX_POOL_REG 0 Allocation-level NIXL registration (registers cudaMalloc blocks instead of individual tensors)
MX_P2P_METADATA 1 Serve tensor and artifact manifests directly from source workers; set to 0 to route full tensor metadata through the central server
MX_ARTIFACT_TRANSFER 0 Transfer compatible vLLM TorchInductor, Triton, DeepGEMM, TileLang, CuTe DSL, and FlashInfer JIT caches, including persistent autotune files when supported by vLLM
MX_ARTIFACT_BUNDLE_ROOT $TMPDIR/modelexpress-artifacts Staging root for tarred cache artifact bundles
MX_ARTIFACT_COMPILE_CONFIG_DIGEST empty Optional compile-configuration compatibility digest for cache discovery
MX_ARTIFACT_READY_URL Framework default Readiness endpoint checked before a source publishes weights or JIT cache artifacts (http://127.0.0.1:8000/health for vLLM; http://127.0.0.1:30000/health for SGLang). On the non-head nodes of a multi-node engine, a loopback host is rewritten onto the head's address (the engine's own distributed-init address, else LWS_LEADER_ADDRESS), preserving the configured port and path. A non-loopback host is used verbatim
MX_ARTIFACT_READY_TIMEOUT_SECS 1800 Maximum time to wait for readiness and successful artifact publication
MX_HEARTBEAT_INTERVAL_SECS 30 Seconds between READY status heartbeats for published sources, including reshard rendezvous sources; keep below the server heartbeat timeout

Canonical S3 Transfer Tuning

Objects below the configured thresholds use one PUT or GET. Larger uploads use multipart parts, and larger downloads use ranged GETs through one persistent s3transfer.TransferManager per S3Client. The receiver's file-level pool and the manager's global request concurrency use the same worker setting, so all whole-object and ranged data GETs share one 16-request budget. HEAD requests use the manager's separate submission executor. Downloads target a seekable BytesIO, so the complete downloaded object remains resident; the I/O settings below bound queued chunks, not the final object size.

Variable Default Description
MX_S3_MULTIPART_THRESHOLD_BYTES 104857600 (100 MiB) Minimum object size for multipart upload
MX_S3_UPLOAD_PART_BYTES 16777216 (16 MiB) Multipart upload part size
MX_S3_UPLOAD_WORKERS 8 Maximum concurrent multipart part uploads
MX_S3_DOWNLOAD_RANGE_THRESHOLD_BYTES 104857600 (100 MiB) Minimum object size for parallel ranged download
MX_S3_DOWNLOAD_RANGE_BYTES 8388608 (8 MiB) Byte-range size for parallel downloads
MX_S3_DOWNLOAD_WORKERS 16 Receiver file-worker limit and shared whole/ranged data GET concurrency budget
MX_S3_DOWNLOAD_IO_CHUNK_BYTES 1048576 (1 MiB) TransferManager I/O queue chunk size
MX_S3_DOWNLOAD_MAX_IN_MEMORY_CHUNKS 16 Sets max_io_queue_size and the non-seekable-output chunk limit. For the seekable BytesIO target, the default bounds queued I/O to about 16 MiB but does not cap the full downloaded object
MX_S3_MAX_POOL_CONNECTIONS 32 Botocore HTTP connection-pool size
MX_S3_MAX_ATTEMPTS 5 Botocore total request attempts and TransferManager post-200 streaming-download attempts
MX_S3_TCP_KEEPALIVE true Enable TCP keepalive for S3 connections

UCX/NIXL Tuning

Variable Recommended Description
UCX_RNDV_SCHEME get_zcopy Zero-copy RDMA reads
UCX_RNDV_THRESH 0 Force rendezvous for all transfers
NIXL_LOG_LEVEL INFO NIXL logging level

Package Structure

Module Description
modelexpress.client MxClient -- gRPC client for the ModelExpress server
modelexpress.metadata Metadata clients, source identity, publishing, and worker manifest serving
modelexpress.engines.vllm.loader MxModelLoader -- vLLM integration
modelexpress.engines.sglang.loader MxModelLoader -- SGLang remote_instance integration
modelexpress.engines.trtllm.loader MxModelLoader -- TensorRT-LLM shared-strategy integration
modelexpress.vllm_loader Compatibility shim for the vLLM loader
modelexpress.nixl_transfer NixlTransferManager -- NIXL agent lifecycle and RDMA transfers
modelexpress.types TensorDescriptor, WorkerMetadata -- core data types
modelexpress.vllm_worker Compatibility worker extension for older manual-registration workflows

The optional RL APIs are installed with this distribution under the modelexpress_rl namespace. See the RL package guide.

How It Works

  1. Source loads weights from disk, registers raw tensors with NIXL before FP8 processing, and publishes metadata to the ModelExpress server.
  2. Target creates dummy weights, waits for the source ready flag, then pulls raw tensors via RDMA read.
  3. Both source and target run process_weights_after_loading() independently, producing identical FP8-transformed weights.
  4. When artifact transfer is enabled, a healthy source publishes its pod-scoped JIT caches and later pods install compatible caches before model initialization.

This pre-processing transfer strategy is critical for FP8 models (e.g., DeepSeek-V4-Pro) where tensors are renamed and transformed during processing.

License

Apache-2.0

Metadata

Release files for modelexpress 0.8.0.dev20261024

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

Built distributions (wheels)

Table of built distributions (wheels) for modelexpress 0.8.0.dev20261024
File Actions
modelexpress-0.8.0.dev20261024-py3-none-any.whl Python 3 none any Details for modelexpress-0.8.0.dev20261024-py3-none-any.whl
modelexpress-0.8.0.dev20261024-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details for modelexpress-0.8.0.dev20261024-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
modelexpress-0.8.0.dev20261024-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details for modelexpress-0.8.0.dev20261024-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
modelexpress-0.8.0.dev20261024-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details for modelexpress-0.8.0.dev20261024-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
modelexpress-0.8.0.dev20261024-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details for modelexpress-0.8.0.dev20261024-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
modelexpress-0.8.0.dev20261024-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details for modelexpress-0.8.0.dev20261024-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
modelexpress-0.8.0.dev20261024-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details for modelexpress-0.8.0.dev20261024-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
modelexpress-0.8.0.dev20261024-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details for modelexpress-0.8.0.dev20261024-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
modelexpress-0.8.0.dev20261024-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details for modelexpress-0.8.0.dev20261024-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Total release size: 5.6 MB

Release files / modelexpress-0.8.0.dev20261024-py3-none-any.whl

Download URL modelexpress-0.8.0.dev20261024-py3-none-any.whl
Size 549.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16482e5440acc417b30cb3483afd3d2b8c5ac712bad61d068bda2b78e9ac4e72
BLAKE2b-256 checksum
How to use checksums
8ab6efe2b4cb4fff6f06b7ef1704de3cb4936363c12f843800a2ed7034b44ab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / modelexpress-0.8.0.dev20261024-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL modelexpress-0.8.0.dev20261024-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 635.0 kB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
ba505e54c56db5612bbc78b813c4ae8ceaa4de0af4533c7908d08758a3c0a0f5
BLAKE2b-256 checksum
How to use checksums
6bfc6c61288b8c0a251cc5080264ab832e6e3fda3e3c7eedb5b5d0556ee77b9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / modelexpress-0.8.0.dev20261024-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL modelexpress-0.8.0.dev20261024-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 635.4 kB
Tags CPython 3.13 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
a91887a839f7e30b9ae8da0f3ae7b7d5f586d333ca5c7057e5cc7a50814847c1
BLAKE2b-256 checksum
How to use checksums
e61012ee56a396023308ce416020c2e4096babcc03b1a141105b95f52ab0534f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / modelexpress-0.8.0.dev20261024-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL modelexpress-0.8.0.dev20261024-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 634.8 kB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
da4c5ab225ef7475f68b4b66f204300645e3121a1352d9f96032d915f345526d
BLAKE2b-256 checksum
How to use checksums
4e9b1de1ea52426d883db799f81b88d6873a7d1e49a7f170bff988364c0d9e85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / modelexpress-0.8.0.dev20261024-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL modelexpress-0.8.0.dev20261024-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 635.3 kB
Tags CPython 3.12 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
0272fb8335d034c0618bd4be3fd240b7180e18f4db3bb787d1da36e6638d016f
BLAKE2b-256 checksum
How to use checksums
4ed1442bf9512be2086722b7cf5bcfd6edd5155c48105fc05c1ae1941dc8adb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / modelexpress-0.8.0.dev20261024-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL modelexpress-0.8.0.dev20261024-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 634.8 kB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
03567125fd1974bb10f120c3d21de0aab9197b8a6d262d4b9b822bfcf119ed6a
BLAKE2b-256 checksum
How to use checksums
816721a91a94440fe52c16346059c621dcda0b3ce28f297fdb25f30de1803b8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / modelexpress-0.8.0.dev20261024-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL modelexpress-0.8.0.dev20261024-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 635.5 kB
Tags CPython 3.11 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
56322f251e5b5b727ccfb894c2a96d5fb096a93a516cefb7bd1f2460976f15ab
BLAKE2b-256 checksum
How to use checksums
8337c990b907e14e610f0e93ba39a39bdbc9e4719941d95c9258de454ea25c1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / modelexpress-0.8.0.dev20261024-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL modelexpress-0.8.0.dev20261024-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 633.9 kB
Tags CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
54f332528f8c928a62dd148fb806a1c9cfce6d0172182b26f60312f746caffb7
BLAKE2b-256 checksum
How to use checksums
4dc27a6253c49c6ae6f9d050cc01ba7e103e1d7265a15e8c6f9568b9728c345c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / modelexpress-0.8.0.dev20261024-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL modelexpress-0.8.0.dev20261024-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 634.5 kB
Tags CPython 3.10 Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
6ea3c634c00e43dc993f8ffc1752a06eb12a1f1fec5b87c8f7fc2394e718d187
BLAKE2b-256 checksum
How to use checksums
31a7613ac80dc879d421c384a22f845e77e157b9a3570717cb889ea754c58325
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for modelexpress 0.8.0.dev20261024

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.

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