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.3-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.3-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.3-py3-none-macosx_11_0_x86_64.whl (643.4 kB view details)

Uploaded Python 3macOS 11.0+ x86-64

zest_transfer-0.3.3-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.3-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for zest_transfer-0.3.3-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8b802ee5fbca87d70eead69a7314deac464aa89632e5322490e3060b6b81240e
MD5 c9493bc529732f3539cfaf43609c5e79
BLAKE2b-256 b724458ba07e4ed50af393a27ab310cc233fd04f3293cebdadd121efc3ac0dfc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.3-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 13603d9544ea08f9ad2134c33b37bc823880dd55a1e454557d6d36a49d3d66b5
MD5 3e4dbb15e06a9efc463da94d4edcee00
BLAKE2b-256 63e66864ed470ea67eb98b239c45fa9c679fd0cfafe143d5335a1913d2123061

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.3-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7c1f0f297f1f2fe1b140cbb12aa87ef61af1efb84da35cb83e7d6d413ae4dcf2
MD5 df4152b927cb15b6902b7805f2c2b232
BLAKE2b-256 3ef39cddb6322bb16894cc538b047e9b66ed94a351f0cafa76ba45f990a35279

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.3-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd09ad27ebcb7eb93aa109ece09a4f24bf417c5dcdbba4ae624ad13097873fda
MD5 ceec16afe52d7562064972d23f666940
BLAKE2b-256 511076e0feaaf8625763d85e5300cd340893bdf8de3be216112d4dc38b50da77

See more details on using hashes here.

Provenance

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