Skip to main content

HyperCache Python Client & Data Plane (client-py)

The hypercache Python package integrates transparently into AI training and inference pipelines (PyTorch, Hugging Face, Safetensors) to provide zero-copy Direct Block DMA / GPUDirect Storage (GDS) checkpoint loading.


Key Features

  • Transparent hypercache:// Protocol: Seamless fsspec filesystem implementation.
  • Dual Direct / Buffered Handles: Uses O_DIRECT with sector/page-aligned DMA buffers for maximum hardware read throughput (up to ~7 GB/s per PCIe Gen 4 NVMe and ~14 GB/s per PCIe Gen 5 NVMe), with automatic transparent fallback for arbitrary unaligned byte slices.
  • Sub-Millisecond Metadata: Resolves physical drive offsets from the local HyperCache control plane daemon in < 1 ms over Unix Domain Sockets.
  • Zero-Copy GPU Direct: Direct DMA transfers bypassing host CPU and Linux page cache.

Installation

# Install from PyPI (imports as `import hypercache`)
pip install hypercache-io

# Or install in editable mode from the repository
cd client-py
pip install -e .

# Optional GPU Direct Storage acceleration dependencies
pip install "hypercache-io[gpu]" --extra-index-url https://pypi.nvidia.com

Usage Examples

1. PyTorch & Safetensors Loading

import torch
import safetensors.torch
from hypercache.fsspec_fs import register_hypercache_fsspec

# Automatically registers hypercache:// protocol
register_hypercache_fsspec()

# Load tensors directly from striped NVMe storage into VRAM/Host memory
with open("hypercache://models/llama-3/weights.safetensors", "rb") as f:
    tensors = safetensors.torch.load(f.read())

2. Direct Python Client API

from hypercache.client import HyperCacheClient
from hypercache.datapath import get_data_reader

# Connect to local Control Plane Daemon (auto-resolves /run/hypercache/hypercache.sock)
client = HyperCacheClient()

# Check daemon health & discovered drives
devices = client.get_devices()
print(f"Discovered {len(devices)} active striped devices.")

# Locate checkpoint
layout = client.locate("hypercache://models/llama-3/weights.safetensors", auto_ingest=True)
if layout.is_hit:
    reader = get_data_reader()
    data = reader.read_chunks(layout.chunk_layout, layout.object_size)
    print(f"Read {len(data)/(1024*1024):.2f} MiB at hardware line rate!")

LMCache

The LMCache integration isn't part of this package. It's a separate Rust connector, covered in lmcache-connector/README.md. For code that manages its own KV blocks, use HyperCacheKVStore from this package.


Running Unit Tests

pytest tests/

Metadata

Release files for hypercache-io 0.10.1

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

Source distribution (sdist)

Source distribution for hypercache-io 0.10.1
File Size Uploaded Provenance Actions
hypercache_io-0.10.1.tar.gz 40.2 kB Without provenance Details for hypercache_io-0.10.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hypercache-io 0.10.1
File Interpreter ABI Platform Actions
hypercache_io-0.10.1-py3-none-any.whl Python 3 none any Details for hypercache_io-0.10.1-py3-none-any.whl

Total release size: 70.4 kB

Release files / hypercache_io-0.10.1.tar.gz

Download URL hypercache_io-0.10.1.tar.gz
Size 40.2 kB
Tags Source
SHA-256 checksum
How to use checksums
042aae22302fe36e2c854c5aafce1f4c534463c3a8e19cf2f2dd42eda2bcd184
BLAKE2b-256 checksum
How to use checksums
021e070ce80b0c7700f4b9ed21ddd08a9b4e0c204277fc90beb8b2a151583d46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hypercache_io-0.10.1-py3-none-any.whl

Download URL hypercache_io-0.10.1-py3-none-any.whl
Size 30.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdf92d265b7426f4d6d848a106ca154c4763c0694d479bb15ce39b1d61e48eca
BLAKE2b-256 checksum
How to use checksums
02cbe68e5ed2e761ea6a8a0f92542b3d16d05083c37ebcfba77432b401c51add
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for hypercache-io 0.10.1

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