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

Uploaded Python 3macOS 11.0+ x86-64

zest_transfer-0.4.2-py3-none-macosx_11_0_arm64.whl (647.9 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for zest_transfer-0.4.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a97ea6f046faa53e82e23243b72a5a72148d2e0d60154d7e1f4debaebe0e891c
MD5 3de48bc7138f8a6465da6bcc856ab150
BLAKE2b-256 a6624ed8dd723e1e1a3b4f610b154ec853b2d7ba89e885bfd64a9c617a0bd038

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.4.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 74c420abe0e00a668a3b7926762c2324af5711f03246de51c656deef635aa340
MD5 3110203f36414ca3a4dd3bf9ebfb2f7c
BLAKE2b-256 188041b5e9751c64b9843e880e3db0180254832788a692a79ad90dda13cf3c50

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.4.2-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 4c787bbbe50f00e2ad0ec57adcc03cf788c769126d657172313601dfd6d57aea
MD5 ad5a7067c2a54d784e0e9d81a58e0a11
BLAKE2b-256 8b4d33b67a154cf8eb8e7093c0046f934ce15f4c12fd8b0419ce8178e7ed7667

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.4.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ddc453bee31726d253b9958d548568a96d4be6ad40c001caba7d7400635aade0
MD5 6d365d08bcacdaa58fb4011a459886ec
BLAKE2b-256 1a23a0a8e604710f4ea82364a344e61c5f5064d741de46527e522f84bb39d65d

See more details on using hashes here.

Provenance

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