{"library":"mooncake-transfer-engine","title":"Mooncake Transfer Engine","description":"Mooncake Transfer Engine is a Python binding (using pybind11) for the core data transfer component of the Mooncake project. Mooncake itself is a KVCache-centric disaggregated architecture designed to optimize Large Language Model (LLM) inference. The Transfer Engine provides a high-performance, unified interface for batched data movement across various storage devices and network links, supporting protocols like TCP, RDMA, CXL/shared-memory, and NVMe over Fabric. It is actively maintained with frequent updates and integrations into LLM serving frameworks like SGLang and vLLM.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install mooncake-transfer-engine","pip install mooncake-transfer-engine-non-cuda"],"cli":null},"imports":["from mooncake.engine import TransferEngine","from mooncake.engine import TransferNotify","from mooncake.engine import TransferOpcode"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import numpy as np\nimport os\n# In a real distributed setup, a metadata server (e.g., etcd) would be used.\n# For a simple local demo, 'P2PHANDSHAKE' can be used.\nMETADATA_SERVER = os.environ.get('MC_METADATA_SERVER', 'P2PHANDSHAKE')\nLOCAL_HOSTNAME = os.environ.get('MC_LOCAL_HOSTNAME', '127.0.0.1:12345')\nPROTOCOL = os.environ.get('MC_PROTOCOL', 'tcp') # Use 'rdma' for RDMA-capable networks\nDEVICE_NAME = os.environ.get('MC_DEVICE_NAME', '') # Auto discovery if empty\n\ntry:\n    from mooncake.engine import TransferEngine\n\n    # Create transfer engine instance\n    engine = TransferEngine()\n\n    # Initialize with basic configuration\n    # In a real scenario, local_hostname would be the actual server IP/port\n    # and metadata_server would point to the etcd cluster or similar.\n    engine.initialize(\n        LOCAL_HOSTNAME,\n        METADATA_SERVER,\n        PROTOCOL,\n        DEVICE_NAME\n    )\n\n    # Allocate and initialize a buffer (e.g., 1MB)\n    # Note: For GPU memory, specific allocation methods/context would be needed.\n    client_buffer = np.zeros(1024 * 1024, dtype=np.uint8)\n    buffer_address = client_buffer.ctypes.data\n    buffer_length = client_buffer.nbytes\n\n    print(f\"TransferEngine initialized on {LOCAL_HOSTNAME} with {PROTOCOL} protocol.\")\n    print(f\"Allocated buffer at address: {buffer_address}, length: {buffer_length} bytes.\")\n\n    # Example: Register memory (optional, depending on protocol/usage)\n    # engine.register_memory(buffer_address, buffer_length)\n\n    # In a full setup, you would then perform transfer operations\n    # e.g., engine.transfer_sync_write(target_hostname, buffer_address, peer_buffer_address, buffer_length)\n\n    print(\"Mooncake Transfer Engine basic setup successful (no actual transfer performed).\")\n\nexcept ImportError:\n    print(\"mooncake-transfer-engine not installed or could not be imported.\")\n    print(\"Please ensure you installed the correct version for your CUDA environment.\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates the basic initialization of the Mooncake Transfer Engine. It creates an instance of `TransferEngine` and initializes it with network configuration, then allocates a NumPy buffer. In a real distributed setting, you would typically run a receiver and a sender, with `METADATA_SERVER` pointing to an actual coordination service like etcd. The `protocol` should be set to 'rdma' for high-performance RDMA-capable networks.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.3.7.post2","pypi_latest":"0.3.10.post2","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":50,"avg_install_s":8.2,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine-non-cuda","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":7.3,"import_time_s":null,"mem_mb":null,"disk_size":"142M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine-non-cuda","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":6.2,"import_time_s":null,"mem_mb":null,"disk_size":"289M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine-non-cuda","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":6.1,"import_time_s":null,"mem_mb":null,"disk_size":"158M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine-non-cuda","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":9.2,"import_time_s":null,"mem_mb":null,"disk_size":"297M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine-non-cuda","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":4.4,"import_time_s":null,"mem_mb":null,"disk_size":"149M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine-non-cuda","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":8.1,"import_time_s":null,"mem_mb":null,"disk_size":"287M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine-non-cuda","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":4.9,"import_time_s":null,"mem_mb":null,"disk_size":"149M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine-non-cuda","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":8.4,"import_time_s":null,"mem_mb":null,"disk_size":"286M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"mooncake-transfer-engine-non-cuda","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":16,"import_time_s":null,"mem_mb":null,"disk_size":"195M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"mooncake-transfer-engine-non-cuda","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":11.5,"import_time_s":null,"mem_mb":null,"disk_size":"274M"}]}}