Flock SDK
Welcome to the Flock SDK repository! 🚀 Flock SDK is a powerful software development kit that leverages Federated Learning and Blockchain to enable data and computation resources owners to collaboratively train machine learning models using any source data. With Flock SDK, you can define and start ML training tasks on the Flock platform efficiently. 💪
Key Features
-
🔗 Federated Learning: Flock SDK harnesses the power of Federated Learning, a distributed approach that allows data owners to train machine learning models collaboratively while keeping their data locally.
-
🤝 Collaborative Training: By sharing source data, Flock enables multiple participants to contribute to the training process, resulting in improved model performance and accuracy.
-
💰 Rewards and Smart Contracts: Flock's ML training participants are incentivized with rewards and penalties specified by pre-defined smart contracts, ensuring fair and transparent compensation.
-
🔒 Secure and Privacy-preserving: Flock SDK prioritizes data privacy and security, allowing data owners to retain control over their sensitive information throughout the training process.
-
🧩 Flexible Integration: The SDK is designed to be easily integrated into your existing workflows and systems, making it a perfect fit for a wide range of applications.
Example Usages
-
🌐🤖 Flock Large Language Model: Visit the
flock_llmdirectory for an example usage of Flock SDK with the Flock Large Language Model(LLM). This demonstrates how to finetune a Vicuna-7B using the instruction sets provided by different contributors and train aLoRAadapeter using federated leaning on chain. -
🛡️💳 Credit Card Fraud Detection: Check out the
credit_card_fraud_detectiondirectory for an example usage of Flock SDK to train a fraud detection model using a federated learning approach. -
📸🔎 MobileNet Example: Explore the
mobilenet_exampledirectory for an example implementation of Flock SDK to train a MobileNet model for image classification, leveraging the power of federated learning.
Quick Start
Creating a new model
Prerequisites:
You must have docker and docker compose installed and set up to run as non-root user.
Installing Flock SDK as a package
This step is only required if you want to test invoking the model without the client running it in a docker container.
Installing the SDK as a python package is pretty simple, all you need to do is run pip install flock-sdk.
If you are running a local flock chain
- Choose the appropriate example to build from inside the
examplesfolder and implement the evaluate, train and aggregate functions as required. - Make sure that IPFS is started by running
docker-compose upin the client directory - Run
./upload_image.shinside the chosen example folder to build and upload the model definition to IPFS - Modify the
MODEL_DEFINITION_HASHin theMakefileinside the client repo to match the returned hash - Start the network by running
make chaininside the client repo - Launch the clients using instructions in the client directory's README.
If you are running on the official flock chain
- Choose the appropriate example to build from inside the
examplesfolder and implement the evaluate, train and aggregate functions as required. - Run
./upload_image.shinside the chosen example folder to build and upload the model definition to IPFS - Create a new FlockTask with the returned IPFS hash in the Flock frontend
Metadata
Release files for flock-sdk 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flock-sdk-0.0.3.tar.gz | 4.8 kB | Without provenance | Details for flock-sdk-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flock_sdk-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for flock_sdk-0.0.3-py3-none-any.whl |
Total release size: 9.6 kB
Release files / flock-sdk-0.0.3.tar.gz
| Download URL | flock-sdk-0.0.3.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40054b9c9eb0c24b5d37c55ba0eca2ddf40ade9abb80f3896835d679884a23e2
|
|
BLAKE2b-256 checksum How to use checksums |
353221a52bf41cceaaaa2e9d1e0132207e40b308ba6c1bab5b06ef5c6c9a171b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Release files / flock_sdk-0.0.3-py3-none-any.whl
| Download URL | flock_sdk-0.0.3-py3-none-any.whl |
|---|---|
| Size | 4.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9940739c3cc0bd30f5059f33be62b992f5d9325a8e3956de03b20ce195807242
|
|
BLAKE2b-256 checksum How to use checksums |
7982f84dead859018284c9b3c37b671e3fc2cec6d2f414fe31811d978efd84eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Security for flock-sdk 0.0.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.