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.3.4-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

zest_transfer-0.3.4-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (2.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

zest_transfer-0.3.4-py3-none-macosx_11_0_x86_64.whl (643.5 kB view details)

Uploaded Python 3macOS 11.0+ x86-64

zest_transfer-0.3.4-py3-none-macosx_11_0_arm64.whl (624.1 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for zest_transfer-0.3.4-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 04e148ec65402a5b7ac5d90ee60fe7cc655339e1960fc4a03d7e7baf5fc6ff11
MD5 b5bb2f26b0a2c001b71ab661b2f392ac
BLAKE2b-256 0161fab32c016a99f8eb30ac543583ed1a1fc50ed858d95da0098c5bf3071d91

See more details on using hashes here.

Provenance

The following attestation bundles were made for zest_transfer-0.3.4-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.3.4-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for zest_transfer-0.3.4-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 2e11e1c81bdd6c5b3ea136409f65b81b00495c8432f73f4026381be2a0260179
MD5 802efd98729fb7206c7042a59bc9fd50
BLAKE2b-256 ea37c9ddaf85ff1cec2f8e364d1323301ff382e4e09153cb551184d2c12e595c

See more details on using hashes here.

Provenance

The following attestation bundles were made for zest_transfer-0.3.4-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.3.4-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for zest_transfer-0.3.4-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 77a337b59f2cc85e308eac02390053da201bce5fe69760215891d5e05a8c3d38
MD5 e3c801b188a583cdaf1aae3e464297de
BLAKE2b-256 81b7af9816b9726ce20f1f7a124fd41ba55802cee89098c4166fc0a687b095fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for zest_transfer-0.3.4-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.3.4-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zest_transfer-0.3.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c81aa3fb113eddfeb2cc88ad8fec544bd5780cb4266b75d9490444016012c7dc
MD5 95e3d07998166917cced2f42c29423ac
BLAKE2b-256 d40e5496cae5a26db3f0d789831d431ab80f0754d827a2c47a6b804b086cca24

See more details on using hashes here.

Provenance

The following attestation bundles were made for zest_transfer-0.3.4-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