flock-sdk


Nameflock-sdk JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/FLock-io/v1-sdk
SummaryAn SDK for building applications on top of FLock V1
upload_time2024-01-31 23:42:57
maintainer
docs_urlNone
authorFLock.io
requires_python>=3.7
license
keywords blockchain federated learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flock SDK
<p align="center">
<a href=""><img src="assets/flock_logo.png" alt="logo" width="350px"></a>
</p>
<p align="center">
<img src="https://img.shields.io/badge/python-3.11-blue?style=round-square&logo=Python&color=3776AB" alt="Python" >
<img src="https://img.shields.io/badge/pytorch-latest-orange?style=round-square&logo=PyTorch&color=EE4C2C" alt="Pytorch" >
<a href="https://timothyshen1.gitbook.io/flock.io/"><img src="https://img.shields.io/badge/document-English-blue.svg" alt="EN doc"></a>
<a href="https://discord.gg/ay8MnJCg2W"><img src="https://dcbadge.vercel.app/api/server/ay8MnJCg2W?style=flat&theme=discord-inverted" alt="Discord Follow"></a>
<a href="https://twitter.com/flock_io"><img src="https://img.shields.io/twitter/follow/flock_io?style=social" alt="Twitter Follow"></a>
</p>

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

1. πŸ”— **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.  

2. 🀝 **Collaborative Training**: By sharing source data, Flock enables multiple participants to contribute to the training process, resulting in improved model performance and accuracy.  
3. πŸ’° **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.
4. πŸ”’ **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.
5. 🧩 **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
1. πŸŒπŸ€– **Flock Large Language Model**: Visit the [`flock_llm`](examples/flock_llm) directory 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 a [`LoRA`](https://arxiv.org/abs/2106.09685) adapeter using federated leaning on chain. 

2. πŸ›‘οΈπŸ’³ **Credit Card Fraud Detection**: Check out the [`credit_card_fraud_detection`](examples/credit_card_fraud_detection) directory for an example usage of Flock SDK to train a fraud detection model using a federated learning approach.

3. πŸ“ΈπŸ”Ž **MobileNet Example**: Explore the [`mobilenet_example`](examples/mobilenet_example) directory 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](https://docs.docker.com/engine/install/) and set up to [run as non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-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
1. Choose the appropriate example to build from inside the `examples` folder and implement the evaluate, train and aggregate functions as required.
2. Make sure that IPFS is started by running `docker-compose up` **in the client directory**
2. Run `./upload_image.sh` inside the chosen example folder to build and upload the model definition to IPFS
3. Modify the `MODEL_DEFINITION_HASH` in the `Makefile` **inside the client repo** to match the returned hash
4. Start the network by running `make chain` **inside the client repo**
5. Launch the clients using instructions **in the client directory's** README.

### If you are running on the official flock chain
1. Choose the appropriate example to build from inside the `examples` folder and implement the evaluate, train and aggregate functions as required.
2. Run `./upload_image.sh` inside the chosen example folder to build and upload the model definition to IPFS
3. Create a new FlockTask with the returned IPFS hash in the Flock frontend

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/FLock-io/v1-sdk",
    "name": "flock-sdk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "blockchain,federated learning",
    "author": "FLock.io",
    "author_email": "info@flock.io",
    "download_url": "https://files.pythonhosted.org/packages/35/32/21a52bf41cceaaaa2e9d1e0132207e40b308ba6c1bab5b06ef5c6c9a171b/flock-sdk-0.0.3.tar.gz",
    "platform": null,
    "description": "# Flock SDK\n<p align=\"center\">\n<a href=\"\"><img src=\"assets/flock_logo.png\" alt=\"logo\" width=\"350px\"></a>\n</p>\n<p align=\"center\">\n<img src=\"https://img.shields.io/badge/python-3.11-blue?style=round-square&logo=Python&color=3776AB\" alt=\"Python\" >\n<img src=\"https://img.shields.io/badge/pytorch-latest-orange?style=round-square&logo=PyTorch&color=EE4C2C\" alt=\"Pytorch\" >\n<a href=\"https://timothyshen1.gitbook.io/flock.io/\"><img src=\"https://img.shields.io/badge/document-English-blue.svg\" alt=\"EN doc\"></a>\n<a href=\"https://discord.gg/ay8MnJCg2W\"><img src=\"https://dcbadge.vercel.app/api/server/ay8MnJCg2W?style=flat&theme=discord-inverted\" alt=\"Discord Follow\"></a>\n<a href=\"https://twitter.com/flock_io\"><img src=\"https://img.shields.io/twitter/follow/flock_io?style=social\" alt=\"Twitter Follow\"></a>\n</p>\n\nWelcome to the Flock SDK repository! \ud83d\ude80 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. \ud83d\udcaa\n\n\n## Key Features\n\n1. \ud83d\udd17 **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.  \n\n2. \ud83e\udd1d **Collaborative Training**: By sharing source data, Flock enables multiple participants to contribute to the training process, resulting in improved model performance and accuracy.  \n3. \ud83d\udcb0 **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.\n4. \ud83d\udd12 **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.\n5. \ud83e\udde9 **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.\n\n## Example Usages\n1. \ud83c\udf10\ud83e\udd16 **Flock Large Language Model**: Visit the [`flock_llm`](examples/flock_llm) directory 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 a [`LoRA`](https://arxiv.org/abs/2106.09685) adapeter using federated leaning on chain. \n\n2. \ud83d\udee1\ufe0f\ud83d\udcb3 **Credit Card Fraud Detection**: Check out the [`credit_card_fraud_detection`](examples/credit_card_fraud_detection) directory for an example usage of Flock SDK to train a fraud detection model using a federated learning approach.\n\n3. \ud83d\udcf8\ud83d\udd0e **MobileNet Example**: Explore the [`mobilenet_example`](examples/mobilenet_example) directory for an example implementation of Flock SDK to train a MobileNet model for image classification, leveraging the power of federated learning. \n\n## Quick Start\n### Creating a new model\n\nPrerequisites:\nYou must have `docker` and `docker compose` [installed](https://docs.docker.com/engine/install/) and set up to [run as non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user).\n\n\n### Installing Flock SDK as a package\nThis step is only required if you want to test invoking the model without the client running it in a docker container.\nInstalling the SDK as a python package is pretty simple, all you need to do is run `pip install flock-sdk`.\n\n\n### If you are running a local flock chain\n1. Choose the appropriate example to build from inside the `examples` folder and implement the evaluate, train and aggregate functions as required.\n2. Make sure that IPFS is started by running `docker-compose up` **in the client directory**\n2. Run `./upload_image.sh` inside the chosen example folder to build and upload the model definition to IPFS\n3. Modify the `MODEL_DEFINITION_HASH` in the `Makefile` **inside the client repo** to match the returned hash\n4. Start the network by running `make chain` **inside the client repo**\n5. Launch the clients using instructions **in the client directory's** README.\n\n### If you are running on the official flock chain\n1. Choose the appropriate example to build from inside the `examples` folder and implement the evaluate, train and aggregate functions as required.\n2. Run `./upload_image.sh` inside the chosen example folder to build and upload the model definition to IPFS\n3. Create a new FlockTask with the returned IPFS hash in the Flock frontend\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An SDK for building applications on top of FLock V1",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/FLock-io/v1-sdk"
    },
    "split_keywords": [
        "blockchain",
        "federated learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7982f84dead859018284c9b3c37b671e3fc2cec6d2f414fe31811d978efd84eb",
                "md5": "0c3f869abd10f46af11369fe5f4a8919",
                "sha256": "9940739c3cc0bd30f5059f33be62b992f5d9325a8e3956de03b20ce195807242"
            },
            "downloads": -1,
            "filename": "flock_sdk-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0c3f869abd10f46af11369fe5f4a8919",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 4795,
            "upload_time": "2024-01-31T23:42:55",
            "upload_time_iso_8601": "2024-01-31T23:42:55.927529Z",
            "url": "https://files.pythonhosted.org/packages/79/82/f84dead859018284c9b3c37b671e3fc2cec6d2f414fe31811d978efd84eb/flock_sdk-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "353221a52bf41cceaaaa2e9d1e0132207e40b308ba6c1bab5b06ef5c6c9a171b",
                "md5": "99276396d7934679d08ef4010e2760c8",
                "sha256": "40054b9c9eb0c24b5d37c55ba0eca2ddf40ade9abb80f3896835d679884a23e2"
            },
            "downloads": -1,
            "filename": "flock-sdk-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "99276396d7934679d08ef4010e2760c8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4756,
            "upload_time": "2024-01-31T23:42:57",
            "upload_time_iso_8601": "2024-01-31T23:42:57.604370Z",
            "url": "https://files.pythonhosted.org/packages/35/32/21a52bf41cceaaaa2e9d1e0132207e40b308ba6c1bab5b06ef5c6c9a171b/flock-sdk-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 23:42:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FLock-io",
    "github_project": "v1-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "flock-sdk"
}
        
Elapsed time: 1.04695s