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.0-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.4.0-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.0-py3-none-macosx_11_0_x86_64.whl (668.2 kB view details)

Uploaded Python 3macOS 11.0+ x86-64

zest_transfer-0.4.0-py3-none-macosx_11_0_arm64.whl (647.0 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for zest_transfer-0.4.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 672dc22ab5e81c4913f0819501ab03fa18d5dd868e2e6d6378461e241cb5acfe
MD5 a1a93adffbc04ed7d6cd996aa9acd99b
BLAKE2b-256 b3c40d6bc2cf846585456b41f13fdb05b19b7fdedc94005325fb4f597fa02520

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.4.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 cfa8dcf4ca0b77c02b2f6438f6db78f485984677229a9f239cd8c83163de41d4
MD5 889ea18341d712cbfc255327d6866bec
BLAKE2b-256 9ac5bf65ec736b88dcbc2fefc5a18e9629ec8194796c46ba6a7ee3cc4d6bbb84

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.4.0-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 813344245933a2b899b45fbebdd2dc3aac8c0b36d313206bb48528492997e8ab
MD5 53a033ecf0f3cfd390d53ae39e731043
BLAKE2b-256 e4925114809ca4a76c8a3d1b0a1fc3b19df2c205776fcf3d07a7a88f08f4273e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for zest_transfer-0.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 efe1e20f3f69bf9908628b6f34c2ab7317fdfb60c7f882c3aac155cfa6115119
MD5 4788a2e418e56f420c161cf0a266cc24
BLAKE2b-256 2968529ebec6075291e14d97bda5629482c805789216bf8fcd9ef002bc6e4f83

See more details on using hashes here.

Provenance

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