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

Uploaded Python 3macOS 11.0+ x86-64

zest_transfer-0.3.5-py3-none-macosx_11_0_arm64.whl (627.5 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for zest_transfer-0.3.5-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 89454d50888e4beac0ff9020a278087f41704828025566e67460000f366e100d
MD5 c0c5caa4d5601040a2e30bd21874d203
BLAKE2b-256 71cb1b50186c91f4027a128630c17bb4e12d0396129d859da019cc35baf026dd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.5-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 3294dd5fa6765cacde464fad3482389162d61d82e3515d16751a2031bcbfbda5
MD5 37f6cdbab2d7ea8b1eadda42bf119ab5
BLAKE2b-256 92ea82fedeaa248e1dac4a075b599830790beb5eaef2633087e0db4b935aaa61

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.5-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6990055d020106ac63c99bfa6665333b5de7ba01d4cd053463ff339a3ad0bd71
MD5 9dca67432c1eeebec1a4248c9f492164
BLAKE2b-256 26a9255390949b7cc73a787260d2af931998b13ff1fccf5d05c51fd309b3f39e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.3.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b81866e7c16e5cb6b0b3e7cd1587805eda2b89d4826a17f773a8a91be1b96cdf
MD5 d20d2cece6ec02871cb662d8ff07196d
BLAKE2b-256 7578b0d42cc910c5ca58bae72f8c9ae4480c12ddf552b6fefe2398849ac1230d

See more details on using hashes here.

Provenance

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