Transformers_IPFS
Load models directly from IPFS for Hugging Face Transformers.
Features
- 🌐 Direct integration with local IPFS nodes (preferred method)
- 🔄 Automatic fallback to IPFS gateways when local node isn't available
- 🔍 Simple URI format:
ipfs://CIDfor easy model sharing - ⚡ Zero configuration required - works automatically once installed
- 🧩 Compatible with any version of Transformers
Installation
pip install transformers-ipfs
transformers-ipfs activate
Once installed and activated, the transformers_ipfs integration will be loaded automatically whenever you use Python.
Usage
Use the Transformers library with IPFS model URIs:
from transformers import AutoModel, AutoTokenizer
# Load a model directly from IPFS
tokenizer = AutoTokenizer.from_pretrained("ipfs://bafybeichqdarufyutqc7yd43k77fkxbmeuhhetbihd3g32ghcqvijp6fxi")
# Equivalent HuggingFace model: "riturajpandey739/gpt2-sentiment-analysis-tweets"
model = AutoModel.from_pretrained("ipfs://bafybeichqdarufyutqc7yd43k77fkxbmeuhhetbihd3g32ghcqvijp6fxi")
IPFS Node Connectivity
The transformers_ipfs package prioritizes connectivity in the following order:
-
Local IPFS Node (Recommended): If you have an IPFS daemon running locally (
ipfs daemon), the package will automatically detect and use it. This method:- Is much faster for repeated downloads
- More reliably loads complex model directories with multiple files
- Contributes to the IPFS network by providing content to others
-
IPFS Gateway (Fallback): If a local node isn't available, the package will fall back to public gateways. This method:
- Works without installing IPFS
- May be less reliable for complex model directories
- Downloads can be interrupted more easily
Command Line Interface
# Activate the auto-loading
transformers-ipfs activate
# Check if the integration is active
transformers-ipfs status
# Test the integration
transformers-ipfs test
# Deactivate the integration
transformers-ipfs deactivate
Dependencies
- Python 3.7+
- transformers
License
MIT
Metadata
Release files for transformers-ipfs 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| transformers_ipfs-0.2.0.tar.gz | 18.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| transformers_ipfs-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.8 kB
Release files / transformers_ipfs-0.2.0.tar.gz
| Download URL | transformers_ipfs-0.2.0.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d6f0f6f1d34a436f31efdd9f67b50d55aec26594a7be157ac3e34fc74e13daff
|
|
BLAKE2b-256 checksum How to use checksums |
c3f3d7b911e37d764369e05ab80e8a0b610582685b9e1e1a97cb7a8c82084168
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 25, 2025.
Transparency logRelease files / transformers_ipfs-0.2.0-py3-none-any.whl
| Download URL | transformers_ipfs-0.2.0-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11ee1aca49a6d227b3779efcc29dc39a48a7741a2c558758bf603edc9f27e365
|
|
BLAKE2b-256 checksum How to use checksums |
c624a1ebb708b220466c071e77c5ad99e41aa786132b9afd1d5d1bcf8d0a9d1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 25, 2025.
Transparency log