Skip to main content

P2P acceleration for ML model distribution

Project description

zest — P2P Acceleration for ML Model Distribution

zest accelerates ML model downloads by adding a peer-to-peer layer on top of HuggingFace's Xet storage. Models download from nearby peers first, falling back to HuggingFace CDN — never slower than vanilla hf_xet.

Install

pip install zest-transfer

Authentication

zest needs a HuggingFace token to download models. Set it up once:

# option 1: environment variable
export HF_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxx

# option 2: huggingface-cli (token saved to ~/.cache/huggingface/token)
pip install huggingface_hub
huggingface-cli login

Get your token at huggingface.co/settings/tokens.

Quick Start

CLI

# Pull a model (uses P2P when peers available, CDN fallback)
zest pull meta-llama/Llama-3.1-8B

# Files land in standard HF cache — transformers.from_pretrained() just works
python -c "from transformers import AutoModel; AutoModel.from_pretrained('meta-llama/Llama-3.1-8B')"

Python API

import zest

# One-line activation — monkey-patches huggingface_hub
zest.enable()

# Or pull directly
path = zest.pull("meta-llama/Llama-3.1-8B")

Environment Variable

# Auto-enable on import
ZEST=1 python train.py

How It Works

HuggingFace's Xet protocol breaks files into content-addressed ~64KB chunks grouped into xorbs. zest adds a BitTorrent-compatible peer swarm so these immutable xorbs can be served by anyone who already downloaded them.

For each xorb needed:
  1. Check local cache
  2. Ask peers (BitTorrent protocol)
  3. Fall back to CDN (presigned S3 URLs)

Every download makes the network faster for the next person.

P2P Testing

# Server A: pull a model and seed it
zest pull gpt2
zest serve

# Server B: pull from Server A
zest pull gpt2 --peer <server-a-ip>:6881

Links

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

zest_transfer-0.4.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

zest_transfer-0.4.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (2.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

zest_transfer-0.4.1-py3-none-macosx_11_0_x86_64.whl (668.7 kB view details)

Uploaded Python 3macOS 11.0+ x86-64

zest_transfer-0.4.1-py3-none-macosx_11_0_arm64.whl (647.2 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file zest_transfer-0.4.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for zest_transfer-0.4.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6eefeb632b2c91fb45e1bd2ae1029d3eae53c5b43e2f57cb5e91445279fa337b
MD5 a55d2863ec7454c3e306022d8dc7504f
BLAKE2b-256 bf30b35a7144cc45a2ba4e5d00412c14a9e52df65a5647d984801a2ca2a6b561

See more details on using hashes here.

Provenance

The following attestation bundles were made for zest_transfer-0.4.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl:

Publisher: release.yml on praveer13/zest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zest_transfer-0.4.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for zest_transfer-0.4.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 8fec8b399884bd609cc4a3380ac9ff6b67016ed099abbca87272a080e805192e
MD5 1191eeec437f500d3a6bea0ea55e5688
BLAKE2b-256 22b232b209b1018c03e64fbc411f55ea7393f1f7af415dc2b52b100c9d6bdd49

See more details on using hashes here.

Provenance

The following attestation bundles were made for zest_transfer-0.4.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl:

Publisher: release.yml on praveer13/zest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zest_transfer-0.4.1-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for zest_transfer-0.4.1-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 cc41f82537b49ff0c3397d63464151ca054a037e3dcbfd4b8bf5c6af382468ad
MD5 ea79f95a2fdcc3f7efdf01de15b24a47
BLAKE2b-256 c407ad9469dc171cfad09af84356b351ea4bacbc7c50195648b26630482c7f7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for zest_transfer-0.4.1-py3-none-macosx_11_0_x86_64.whl:

Publisher: release.yml on praveer13/zest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zest_transfer-0.4.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zest_transfer-0.4.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53656eda716638f405a538fb7186c512f0e586becbc2844b5b20976372ad462c
MD5 21fb88b1d7d416cff1081c6fadd3761f
BLAKE2b-256 38f22ea0ee51697df9577571f2193fb674db229dc75a06b2be56299ab07fd4e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for zest_transfer-0.4.1-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on praveer13/zest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page