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

Uploaded Python 3macOS 11.0+ x86-64

zest_transfer-0.3.2-py3-none-macosx_11_0_arm64.whl (620.4 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for zest_transfer-0.3.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 59cae85f07978032f1098e0fb39397a5f7c71c180f1c8df74505a8811c131263
MD5 886cdbd3124438fe9b65aced286a0eeb
BLAKE2b-256 554511f4eef31edb6d2eae020f8bc61c97ce91a3fe89fd897dcb4a31f7b5369e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.2-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 ee8fb2031d2aa5a744ee5c607db7727a7647bd519ead8b5197eb47972e638b17
MD5 b2b0070d00e083f59603022708887e7b
BLAKE2b-256 280289ee4e59e0be5136cb8bc787017ec5a81c661fdcd35e56194f98088bbbac

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.2-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 290e8c8f87f698f8657e52c2af506b6ea63b8e3575ac8dfbc90e03b31d86ddbb
MD5 10b136b7367f79d55f81bc38c83e2010
BLAKE2b-256 0ce06e135a217aa989edab79a9eb6dbd2f16770a5f9397b69a0f6ed5e956d56b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f98b259e0374dc0280fd78f5eab493c0786bb6fc9f72417c9751135f3853724
MD5 467f0dbd30c36bdaa3763dad9dfb066b
BLAKE2b-256 b812a8bcdc7a8f0d268de18925c0c5db5511f52439a310889c017039440cb3e8

See more details on using hashes here.

Provenance

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