FedModelKit 0.6.8__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. fedmodelkit-0.8.0/.python-version +1 -0
  2. fedmodelkit-0.8.0/LICENSE +131 -0
  3. fedmodelkit-0.8.0/PKG-INFO +120 -0
  4. fedmodelkit-0.8.0/README.md +106 -0
  5. fedmodelkit-0.8.0/pyproject.toml +26 -0
  6. fedmodelkit-0.8.0/src/FedModelKit/README.md +19 -0
  7. fedmodelkit-0.8.0/src/FedModelKit/__init__.py +24 -0
  8. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/aggregator.py +15 -10
  9. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/cli.py +35 -18
  10. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/local_learner.py +15 -10
  11. fedmodelkit-0.8.0/src/FedModelKit/mlflow_service/__init__.py +48 -0
  12. fedmodelkit-0.8.0/src/FedModelKit/mlflow_service/client.py +607 -0
  13. fedmodelkit-0.8.0/src/FedModelKit/mlflow_service/messages.py +261 -0
  14. fedmodelkit-0.8.0/src/FedModelKit/mlflow_service/server.py +458 -0
  15. fedmodelkit-0.6.8/src/FedModelKit/templates/client_app_template.py → fedmodelkit-0.8.0/src/FedModelKit/templates/client_app.py +76 -14
  16. fedmodelkit-0.8.0/src/FedModelKit/templates/do1.ipynb +290 -0
  17. fedmodelkit-0.8.0/src/FedModelKit/templates/do2.ipynb +289 -0
  18. fedmodelkit-0.8.0/src/FedModelKit/templates/ds.ipynb +523 -0
  19. fedmodelkit-0.6.8/src/FedModelKit/templates/extern_pyproject_template.toml → fedmodelkit-0.8.0/src/FedModelKit/templates/extern_pyproject.toml +2 -5
  20. fedmodelkit-0.8.0/src/FedModelKit/templates/images/datasetPartition0.png +0 -0
  21. fedmodelkit-0.8.0/src/FedModelKit/templates/images/datasetPartition1.png +0 -0
  22. fedmodelkit-0.8.0/src/FedModelKit/templates/images/do1CreatesSyftDataset.png +0 -0
  23. fedmodelkit-0.8.0/src/FedModelKit/templates/images/do1LogsInDatasite.png +0 -0
  24. fedmodelkit-0.8.0/src/FedModelKit/templates/images/do1LogsInSyftBoxDatasite.png +0 -0
  25. fedmodelkit-0.8.0/src/FedModelKit/templates/images/do1ReviewsJob.png +0 -0
  26. fedmodelkit-0.8.0/src/FedModelKit/templates/images/do2CreatesSyftADataset.png +0 -0
  27. fedmodelkit-0.8.0/src/FedModelKit/templates/images/do2LogsInDatasite.png +0 -0
  28. fedmodelkit-0.8.0/src/FedModelKit/templates/images/do2LogsInSyftBoxDatasite.png +0 -0
  29. fedmodelkit-0.8.0/src/FedModelKit/templates/images/do2ReviewsJob.png +0 -0
  30. fedmodelkit-0.8.0/src/FedModelKit/templates/images/doWaitsForJobs.png +0 -0
  31. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsAggregatedWeights.png +0 -0
  32. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsBootstrapping.png +0 -0
  33. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsExploresDOsDatasets.png +0 -0
  34. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsLogsInAsGuests.png +0 -0
  35. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsPreparesSyftFlwrProject.png +0 -0
  36. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsRunsSyftFLWRSimulation.png +0 -0
  37. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsSimulationLogs.png +0 -0
  38. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsSubmitsJobs.png +0 -0
  39. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsSyftFlwrProjectArch.png +0 -0
  40. fedmodelkit-0.8.0/src/FedModelKit/templates/images/dsWaitsForJobsToBeApproved.png +0 -0
  41. fedmodelkit-0.8.0/src/FedModelKit/templates/images/fltraining.gif +0 -0
  42. fedmodelkit-0.8.0/src/FedModelKit/templates/images/fltraining.mp4 +0 -0
  43. fedmodelkit-0.8.0/src/FedModelKit/templates/images/localSyftBoxNetwork.png +0 -0
  44. fedmodelkit-0.8.0/src/FedModelKit/templates/init.py +15 -0
  45. fedmodelkit-0.6.8/src/FedModelKit/templates/pyproject_template.toml → fedmodelkit-0.8.0/src/FedModelKit/templates/pyproject.toml +6 -8
  46. fedmodelkit-0.8.0/src/FedModelKit/templates/readme.md +153 -0
  47. fedmodelkit-0.6.8/src/FedModelKit/templates/server_app_template.py → fedmodelkit-0.8.0/src/FedModelKit/templates/server_app.py +56 -7
  48. fedmodelkit-0.6.8/src/FedModelKit/templates/task_template.py → fedmodelkit-0.8.0/src/FedModelKit/templates/task.py +19 -4
  49. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/templates.py +43 -23
  50. fedmodelkit-0.8.0/uv.lock +3063 -0
  51. fedmodelkit-0.6.8/.python-version +0 -1
  52. fedmodelkit-0.6.8/LICENSE +0 -23
  53. fedmodelkit-0.6.8/PKG-INFO +0 -283
  54. fedmodelkit-0.6.8/README.md +0 -263
  55. fedmodelkit-0.6.8/examples/simulation-scikit-model/.gitignore +0 -6
  56. fedmodelkit-0.6.8/examples/simulation-scikit-model/AML_preprocessed_dataset.xlsx +0 -0
  57. fedmodelkit-0.6.8/examples/simulation-scikit-model/README.md +0 -29
  58. fedmodelkit-0.6.8/examples/simulation-scikit-model/simulation_example.ipynb +0 -666
  59. fedmodelkit-0.6.8/pyproject.toml +0 -32
  60. fedmodelkit-0.6.8/src/FedModelKit/README.md +0 -25
  61. fedmodelkit-0.6.8/src/FedModelKit/__init__.py +0 -17
  62. fedmodelkit-0.6.8/src/FedModelKit/default_create_functions.py +0 -114
  63. fedmodelkit-0.6.8/src/FedModelKit/interface.py +0 -130
  64. fedmodelkit-0.6.8/src/FedModelKit/src/utils.py +0 -65
  65. fedmodelkit-0.6.8/src/FedModelKit/templates/__init__template.py +0 -0
  66. fedmodelkit-0.6.8/src/FedModelKit/templates/ds_template.ipynb +0 -332
  67. fedmodelkit-0.6.8/src/FedModelKit/templates/images/doWaitsForJobs.png +0 -0
  68. fedmodelkit-0.6.8/src/FedModelKit/templates/main_template.py +0 -27
  69. fedmodelkit-0.6.8/src/FedModelKit/templates/readme_template.md +0 -48
  70. fedmodelkit-0.6.8/uv.lock +0 -2817
  71. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/.gitignore +0 -0
  72. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/images/aggregator.png +0 -0
  73. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/images/federated_learning_model.png +0 -0
  74. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/images/local_learner.png +0 -0
  75. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/py.typed +0 -0
  76. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/templates/images/doSendModels.png +0 -0
  77. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/templates/images/dsAggregateModels.png +0 -0
  78. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/templates/images/dsDoneSubmittingJobs.png +0 -0
  79. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/templates/images/dsSendsJobs.png +0 -0
  80. {fedmodelkit-0.6.8 → fedmodelkit-0.8.0}/src/FedModelKit/templates/images/overview.png +0 -0
@@ -0,0 +1 @@
1
+ 3.12.7
@@ -0,0 +1,131 @@
1
+ # PolyForm Noncommercial License 1.0.0
2
+
3
+ <https://polyformproject.org/licenses/noncommercial/1.0.0>
4
+
5
+ ## Acceptance
6
+
7
+ In order to get any license under these terms, you must agree
8
+ to them as both strict obligations and conditions to all
9
+ your licenses.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a copyright license for the
14
+ software to do everything you might do with the software
15
+ that would otherwise infringe the licensor's copyright
16
+ in it for any permitted purpose. However, you may
17
+ only distribute the software according to [Distribution
18
+ License](#distribution-license) and make changes or new works
19
+ based on the software according to [Changes and New Works
20
+ License](#changes-and-new-works-license).
21
+
22
+ ## Distribution License
23
+
24
+ The licensor grants you an additional copyright license
25
+ to distribute copies of the software. Your license
26
+ to distribute covers distributing the software with
27
+ changes and new works permitted by [Changes and New Works
28
+ License](#changes-and-new-works-license).
29
+
30
+ ## Notices
31
+
32
+ You must ensure that anyone who gets a copy of any part of
33
+ the software from you also gets a copy of these terms or the
34
+ URL for them above, as well as copies of any plain-text lines
35
+ beginning with `Required Notice:` that the licensor provided
36
+ with the software. For example:
37
+
38
+ > Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
39
+
40
+ ## Changes and New Works License
41
+
42
+ The licensor grants you an additional copyright license to
43
+ make changes and new works based on the software for any
44
+ permitted purpose.
45
+
46
+ ## Patent License
47
+
48
+ The licensor grants you a patent license for the software that
49
+ covers patent claims the licensor can license, or becomes able
50
+ to license, that you would infringe by using the software.
51
+
52
+ ## Noncommercial Purposes
53
+
54
+ Any noncommercial purpose is a permitted purpose.
55
+
56
+ ## Personal Uses
57
+
58
+ Personal use for research, experiment, and testing for
59
+ the benefit of public knowledge, personal study, private
60
+ entertainment, hobby projects, amateur pursuits, or religious
61
+ observance, without any anticipated commercial application,
62
+ is use for a permitted purpose.
63
+
64
+ ## Noncommercial Organizations
65
+
66
+ Use by any charitable organization, educational institution,
67
+ public research organization, public safety or health
68
+ organization, environmental protection organization,
69
+ or government institution is use for a permitted purpose
70
+ regardless of the source of funding or obligations resulting
71
+ from the funding.
72
+
73
+ ## Fair Use
74
+
75
+ You may have "fair use" rights for the software under the
76
+ law. These terms do not limit them.
77
+
78
+ ## No Other Rights
79
+
80
+ These terms do not allow you to sublicense or transfer any of
81
+ your licenses to anyone else, or prevent the licensor from
82
+ granting licenses to anyone else. These terms do not imply
83
+ any other licenses.
84
+
85
+ ## Patent Defense
86
+
87
+ If you make any written claim that the software infringes or
88
+ contributes to infringement of any patent, your patent license
89
+ for the software granted under these terms ends immediately. If
90
+ your company makes such a claim, your patent license ends
91
+ immediately for work on behalf of your company.
92
+
93
+ ## Violations
94
+
95
+ The first time you are notified in writing that you have
96
+ violated any of these terms, or done anything with the software
97
+ not covered by your licenses, your licenses can nonetheless
98
+ continue if you come into full compliance with these terms,
99
+ and take practical steps to correct past violations, within
100
+ 32 days of receiving notice. Otherwise, all your licenses
101
+ end immediately.
102
+
103
+ ## No Liability
104
+
105
+ ***As far as the law allows, the software comes as is, without
106
+ any warranty or condition, and the licensor will not be liable
107
+ to you for any damages arising out of these terms or the use
108
+ or nature of the software, under any kind of legal claim.***
109
+
110
+ ## Definitions
111
+
112
+ The **licensor** is the individual or entity offering these
113
+ terms, and the **software** is the software the licensor makes
114
+ available under these terms.
115
+
116
+ **You** refers to the individual or entity agreeing to these
117
+ terms.
118
+
119
+ **Your company** is any legal entity, sole proprietorship,
120
+ or other kind of organization that you work for, plus all
121
+ organizations that have control over, are under the control of,
122
+ or are under common control with that organization. **Control**
123
+ means ownership of substantially all the assets of an entity,
124
+ or the power to direct its management and policies by vote,
125
+ contract, or otherwise. Control can be direct or indirect.
126
+
127
+ **Your licenses** are all the licenses granted to you for the
128
+ software under these terms.
129
+
130
+ **Use** means anything you do with the software requiring one
131
+ of your licenses.
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: FedModelKit
3
+ Version: 0.8.0
4
+ Summary: Tools to scaffold and run privacy-preserving federated learning experiments across distributed data sites.
5
+ Author-email: ceresale <alessandro.ceresi@upm.es>
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.12
8
+ Requires-Dist: flwr-datasets>=0.5.0
9
+ Requires-Dist: flwr[simulation]>=1.17.0
10
+ Requires-Dist: mlflow>=3.10.1
11
+ Requires-Dist: pandas>=2.3.0
12
+ Provides-Extra: edge
13
+ Description-Content-Type: text/markdown
14
+
15
+ # 🌐 FedModelKit (fmk)
16
+
17
+ **FedModelKit** is a Python library designed to streamline the execution of **federated learning tasks** within a network of collaborating partners.
18
+ It provides a guided workflow that helps users quickly set up experiments, manage dependencies, and follow step-by-step instructions through generated resources.
19
+
20
+ ---
21
+
22
+ ## 📑 Table of Contents
23
+ - [Overview](#-overview)
24
+ - [Features](#-features)
25
+ - [Dependencies](#-Dependencies)
26
+ - [Installation](#-installation)
27
+ - [Quick Start](#-quick-start)
28
+ - [Next Steps](#-next-steps)
29
+ - [License & Commercial Use](#-license--commercial-use)
30
+
31
+ ---
32
+
33
+ ## 🔎 Overview
34
+
35
+ Federated learning enables multiple partners to train machine learning models collaboratively **without sharing raw data**.
36
+ The **FedModelKit** library simplifies this process by:
37
+
38
+ - Automating project initialization
39
+ - Creating a reproducible experiment directory with all required dependencies
40
+ - Offering a clear, step-by-step workflow to run experiments in a federated network
41
+
42
+ ---
43
+
44
+ ## 🧩 Dependencies
45
+
46
+ These are the dependencies of the packages, including the required Python version:
47
+
48
+ | Dependency | Version | Description |
49
+ |-------------------|------------|--------------------------------------------------|
50
+ | **Python** | >=3.12 | Required Python interpreter version |
51
+ | `flwr[simulations]` | ==1.17.0 | Federated learning framework and simulations with Flower |
52
+ | `flwr_datasets` | >=0.5.0 | Datasets compatible with Flower |
53
+ | `mlflow` | >=3.1.1 | For experiment tracking and logging |
54
+ | `pandas` | >=2.3.0 | Data manipulation and analysis |
55
+
56
+
57
+ ---
58
+
59
+ ## ⚙️ Installation
60
+
61
+ It is recommended to install `FedModelKit` inside a virtual environment.
62
+ We suggest using [uv](https://github.com/astral-sh/uv) for fast and reproducible setups:
63
+
64
+
65
+ 1. Create and activate a virtual environment
66
+ ```bash
67
+ uv venv
68
+ source .venv/bin/activate
69
+ ```
70
+ or in case of Windows OS
71
+ ```bash
72
+ uv venv
73
+ .venv\Scripts\activate
74
+ ```
75
+
76
+ 2. Install `FedModelKit`
77
+ ```bash
78
+ uv pip install FedModelKit
79
+
80
+ ```
81
+
82
+ ## 🚀 Quick Start
83
+
84
+ Initialize a new federated learning experiment with:
85
+
86
+ ```bash
87
+ fmk init -n my_experiment
88
+
89
+ ```
90
+ This will generate in the present directory the project for a new FL experiment.
91
+
92
+ ## 📖 Next Steps
93
+
94
+ 👉 Once the experiment directory has been created, open the file `README.md` that has been generated in your directory and follow the guided workflow to set up and run your federated learning tasks.
95
+
96
+ ---
97
+ ---
98
+
99
+ ## ⚖️ License & Commercial Use
100
+
101
+ This software is **Source Available** and distributed under a **Dual Licensing** model.
102
+
103
+ ### 🎓 Non-Commercial Use (Community)
104
+ This project is free for personal use, education, non-profit organizations, and academic research under the **PolyForm Noncommercial License 1.0.0**.
105
+
106
+ * ✅ You can read, modify, and execute the code.
107
+ * ✅ You can use it for personal and research projects.
108
+ * ❌ You may **NOT** use it for commercial purposes or in business environments without a commercial license.
109
+
110
+ Check the [LICENSE](LICENSE) file for full terms.
111
+
112
+ ### 💼 Commercial Use (Businesses)
113
+ If you wish to use this software in a commercial product, a business, or any revenue-generating environment, **you must purchase a Commercial License**.
114
+
115
+ The Commercial License grants you:
116
+ * The right to use the software in commercial production environments.
117
+ * Exemption from the PolyForm license restrictions.
118
+ * Priority support (optional).
119
+
120
+ 📩 **To purchase a license, please contact us at:** federico.alvarez@upm.es
@@ -0,0 +1,106 @@
1
+ # 🌐 FedModelKit (fmk)
2
+
3
+ **FedModelKit** is a Python library designed to streamline the execution of **federated learning tasks** within a network of collaborating partners.
4
+ It provides a guided workflow that helps users quickly set up experiments, manage dependencies, and follow step-by-step instructions through generated resources.
5
+
6
+ ---
7
+
8
+ ## 📑 Table of Contents
9
+ - [Overview](#-overview)
10
+ - [Features](#-features)
11
+ - [Dependencies](#-Dependencies)
12
+ - [Installation](#-installation)
13
+ - [Quick Start](#-quick-start)
14
+ - [Next Steps](#-next-steps)
15
+ - [License & Commercial Use](#-license--commercial-use)
16
+
17
+ ---
18
+
19
+ ## 🔎 Overview
20
+
21
+ Federated learning enables multiple partners to train machine learning models collaboratively **without sharing raw data**.
22
+ The **FedModelKit** library simplifies this process by:
23
+
24
+ - Automating project initialization
25
+ - Creating a reproducible experiment directory with all required dependencies
26
+ - Offering a clear, step-by-step workflow to run experiments in a federated network
27
+
28
+ ---
29
+
30
+ ## 🧩 Dependencies
31
+
32
+ These are the dependencies of the packages, including the required Python version:
33
+
34
+ | Dependency | Version | Description |
35
+ |-------------------|------------|--------------------------------------------------|
36
+ | **Python** | >=3.12 | Required Python interpreter version |
37
+ | `flwr[simulations]` | ==1.17.0 | Federated learning framework and simulations with Flower |
38
+ | `flwr_datasets` | >=0.5.0 | Datasets compatible with Flower |
39
+ | `mlflow` | >=3.1.1 | For experiment tracking and logging |
40
+ | `pandas` | >=2.3.0 | Data manipulation and analysis |
41
+
42
+
43
+ ---
44
+
45
+ ## ⚙️ Installation
46
+
47
+ It is recommended to install `FedModelKit` inside a virtual environment.
48
+ We suggest using [uv](https://github.com/astral-sh/uv) for fast and reproducible setups:
49
+
50
+
51
+ 1. Create and activate a virtual environment
52
+ ```bash
53
+ uv venv
54
+ source .venv/bin/activate
55
+ ```
56
+ or in case of Windows OS
57
+ ```bash
58
+ uv venv
59
+ .venv\Scripts\activate
60
+ ```
61
+
62
+ 2. Install `FedModelKit`
63
+ ```bash
64
+ uv pip install FedModelKit
65
+
66
+ ```
67
+
68
+ ## 🚀 Quick Start
69
+
70
+ Initialize a new federated learning experiment with:
71
+
72
+ ```bash
73
+ fmk init -n my_experiment
74
+
75
+ ```
76
+ This will generate in the present directory the project for a new FL experiment.
77
+
78
+ ## 📖 Next Steps
79
+
80
+ 👉 Once the experiment directory has been created, open the file `README.md` that has been generated in your directory and follow the guided workflow to set up and run your federated learning tasks.
81
+
82
+ ---
83
+ ---
84
+
85
+ ## ⚖️ License & Commercial Use
86
+
87
+ This software is **Source Available** and distributed under a **Dual Licensing** model.
88
+
89
+ ### 🎓 Non-Commercial Use (Community)
90
+ This project is free for personal use, education, non-profit organizations, and academic research under the **PolyForm Noncommercial License 1.0.0**.
91
+
92
+ * ✅ You can read, modify, and execute the code.
93
+ * ✅ You can use it for personal and research projects.
94
+ * ❌ You may **NOT** use it for commercial purposes or in business environments without a commercial license.
95
+
96
+ Check the [LICENSE](LICENSE) file for full terms.
97
+
98
+ ### 💼 Commercial Use (Businesses)
99
+ If you wish to use this software in a commercial product, a business, or any revenue-generating environment, **you must purchase a Commercial License**.
100
+
101
+ The Commercial License grants you:
102
+ * The right to use the software in commercial production environments.
103
+ * Exemption from the PolyForm license restrictions.
104
+ * Priority support (optional).
105
+
106
+ 📩 **To purchase a license, please contact us at:** federico.alvarez@upm.es
@@ -0,0 +1,26 @@
1
+ [project]
2
+ name = "FedModelKit"
3
+ version = "0.8.0"
4
+ description = "Tools to scaffold and run privacy-preserving federated learning experiments across distributed data sites."
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "ceresale", email = "alessandro.ceresi@upm.es" }
8
+ ]
9
+ requires-python = ">=3.12"
10
+ dependencies = [
11
+ "flwr-datasets>=0.5.0",
12
+ "flwr[simulation]>=1.17.0",
13
+ "pandas>=2.3.0",
14
+ "mlflow>=3.10.1",
15
+ ]
16
+
17
+ [build-system]
18
+ requires = ["hatchling"]
19
+ build-backend = "hatchling.build"
20
+
21
+ [project.scripts]
22
+ fmk = "FedModelKit.cli:main"
23
+
24
+ [project.optional-dependencies]
25
+ edge = [
26
+ ]
@@ -0,0 +1,19 @@
1
+ ### **Interface Directory**
2
+
3
+ 1. **`aggregator.py`**
4
+ - This file defines the `AggProtocol` protocols. The `AggProtocol` defines the methods and attributes that an aggregator must implement.
5
+
6
+ 2. **`local_learner.py`**
7
+ - This file defines the `LLProtocol` protocols. The `LLProtocol` defines the methods and attributes that a local learner must implement. This file provides the structure for implementing custom local learners.
8
+
9
+ 3. **`cli.py`**
10
+ - This file contains the `create_structure` function, which sets up the project structure for launching a FL task. It creates necessary directories and files for the workflow.
11
+
12
+ 4. **`__init__.py`**
13
+ - This script exposes the main components of the FedModelKit package for easy import.
14
+
15
+ 5. **`templates/`**
16
+ - This folder contains template scripts for generating the content of the generated directory.
17
+
18
+ 6. **`mlflow_service/`**
19
+ - This folder contains scripts that define services for model and training registry in a Mlflow server.
@@ -0,0 +1,24 @@
1
+ #
2
+ # Copyright (c) 2026 Grupo de Aplicación de Telecomunicaciones Visuales (GATV), Escuela Técnica Superior de Ingenieros de Telecomunicación, Universidad Politécnica de Madrid
3
+ #
4
+ # This file is part of Federated Data Fabric.
5
+ #
6
+ # Federated Data Fabric is licensed under the PolyForm Noncommercial License 1.0.0.
7
+ #
8
+ # Use of this software is permitted exclusively for NON-COMMERCIAL purposes.
9
+ # For commercial use, please contact federico.alvarez@upm.es to obtain a commercial license.
10
+ #
11
+ # SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
12
+ #
13
+ # You can view the full license text at:
14
+ # https://polyformproject.org/licenses/noncommercial/1.0.0/
15
+ #
16
+ from .local_learner import LLProtocol
17
+ from .aggregator import AggProtocol
18
+ from .cli import create_structure
19
+ import flwr
20
+
21
+ __all__ = ["LLProtocol",
22
+ "AggProtocol",
23
+ "create_structure",
24
+ "flwr"]
@@ -1,3 +1,18 @@
1
+ #
2
+ # Copyright (c) 2026 Grupo de Aplicación de Telecomunicaciones Visuales (GATV), Escuela Técnica Superior de Ingenieros de Telecomunicación, Universidad Politécnica de Madrid
3
+ #
4
+ # This file is part of Federated Data Fabric.
5
+ #
6
+ # Federated Data Fabric is licensed under the PolyForm Noncommercial License 1.0.0.
7
+ #
8
+ # Use of this software is permitted exclusively for NON-COMMERCIAL purposes.
9
+ # For commercial use, please contact federico.alvarez@upm.es to obtain a commercial license.
10
+ #
11
+ # SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
12
+ #
13
+ # You can view the full license text at:
14
+ # https://polyformproject.org/licenses/noncommercial/1.0.0/
15
+ #
1
16
  import flwr
2
17
  from typing import Protocol, runtime_checkable
3
18
  from typing import Protocol, Optional
@@ -29,13 +44,3 @@ class AggProtocol(Protocol):
29
44
  """
30
45
  ...
31
46
 
32
- @runtime_checkable
33
- class AggFactoryProtocol(Protocol):
34
- '''
35
- Protocol for the function creating the aggregator instance
36
- '''
37
- def __call__(self) -> AggProtocol:
38
- """
39
- Creates and returns an instance of a class conforming to AggProtocol.
40
- """
41
- ...
@@ -1,16 +1,32 @@
1
+ #
2
+ # Copyright (c) 2026 Grupo de Aplicación de Telecomunicaciones Visuales (GATV), Escuela Técnica Superior de Ingenieros de Telecomunicación, Universidad Politécnica de Madrid
3
+ #
4
+ # This file is part of Federated Data Fabric.
5
+ #
6
+ # Federated Data Fabric is licensed under the PolyForm Noncommercial License 1.0.0.
7
+ #
8
+ # Use of this software is permitted exclusively for NON-COMMERCIAL purposes.
9
+ # For commercial use, please contact federico.alvarez@upm.es to obtain a commercial license.
10
+ #
11
+ # SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
12
+ #
13
+ # You can view the full license text at:
14
+ # https://polyformproject.org/licenses/noncommercial/1.0.0/
15
+ #
1
16
  import os
2
17
  import sys
3
18
  import argparse
4
19
  from .templates import (
5
- get_main_template,
6
- get_task_template,
7
- get_readme_template,
8
- get_server_template,
9
- get_client_template,
10
- get_pyproject_template,
11
- get_extern_pyproject_template,
12
- get_init_template,
13
- get_ds_template,
20
+ get_task,
21
+ get_readme,
22
+ get_server,
23
+ get_client,
24
+ get_pyproject,
25
+ get_extern_pyproject,
26
+ get_init,
27
+ get_ds,
28
+ get_do1,
29
+ get_do2,
14
30
  get_images,
15
31
  )
16
32
 
@@ -19,18 +35,19 @@ def create_structure(exp_name: str = "new_experiment") -> None:
19
35
 
20
36
  structure = {
21
37
  f"{exp_name}": {
22
- "main.py": get_main_template(),
23
- "pyproject.toml": get_pyproject_template(exp_name),
38
+ "pyproject.toml": get_pyproject(exp_name),
24
39
  f"{exp_name}": {
25
- "__init__.py": get_init_template(),
26
- "task.py": get_task_template(),
27
- "server_app.py": get_server_template(exp_name),
28
- "client_app.py": get_client_template(exp_name),
40
+ "__init__.py": get_init(),
41
+ "task.py": get_task(),
42
+ "server_app.py": get_server(exp_name),
43
+ "client_app.py": get_client(exp_name),
29
44
  },
30
45
  },
31
- "pyproject.toml": get_extern_pyproject_template(exp_name),
32
- "README.md": get_readme_template(),
33
- "ds.ipynb": get_ds_template(exp_name),
46
+ "pyproject.toml": get_extern_pyproject(exp_name),
47
+ "README.md": get_readme(),
48
+ "ds.ipynb": get_ds(exp_name),
49
+ "do1.ipynb": get_do1(exp_name),
50
+ "do2.ipynb": get_do2(exp_name),
34
51
  }
35
52
 
36
53
 
@@ -1,3 +1,18 @@
1
+ #
2
+ # Copyright (c) 2026 Grupo de Aplicación de Telecomunicaciones Visuales (GATV), Escuela Técnica Superior de Ingenieros de Telecomunicación, Universidad Politécnica de Madrid
3
+ #
4
+ # This file is part of Federated Data Fabric.
5
+ #
6
+ # Federated Data Fabric is licensed under the PolyForm Noncommercial License 1.0.0.
7
+ #
8
+ # Use of this software is permitted exclusively for NON-COMMERCIAL purposes.
9
+ # For commercial use, please contact federico.alvarez@upm.es to obtain a commercial license.
10
+ #
11
+ # SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
12
+ #
13
+ # You can view the full license text at:
14
+ # https://polyformproject.org/licenses/noncommercial/1.0.0/
15
+ #
1
16
  from typing import Protocol, runtime_checkable
2
17
 
3
18
  import pandas as pd
@@ -49,13 +64,3 @@ class LLProtocol(Protocol):
49
64
  """
50
65
  ...
51
66
 
52
- @runtime_checkable
53
- class LLFactoryProtocol(Protocol):
54
- '''
55
- Protocol for the function creating the local learner instance
56
- '''
57
- def __call__(self) -> LLProtocol:
58
- """
59
- Creates and returns an instance of a class conforming to LLProtocol.
60
- """
61
- ...
@@ -0,0 +1,48 @@
1
+ #
2
+ # Copyright (c) 2026 Grupo de Aplicación de Telecomunicaciones Visuales (GATV), Escuela Técnica Superior de Ingenieros de Telecomunicación, Universidad Politécnica de Madrid
3
+ #
4
+ # This file is part of Federated Data Fabric.
5
+ #
6
+ # Federated Data Fabric is licensed under the PolyForm Noncommercial License 1.0.0.
7
+ #
8
+ # Use of this software is permitted exclusively for NON-COMMERCIAL purposes.
9
+ # For commercial use, please contact federico.alvarez@upm.es to obtain a commercial license.
10
+ #
11
+ # SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
12
+ #
13
+ # You can view the full license text at:
14
+ # https://polyformproject.org/licenses/noncommercial/1.0.0/
15
+ #
16
+ """
17
+ MLflow Coordination Utilities for Federated Learning
18
+
19
+ This package provides clean, consolidated MLflow coordination utilities for federated learning
20
+ with Flower, enabling distributed logging, coordination, and monitoring that can
21
+ be easily integrated into any federated learning project.
22
+ """
23
+
24
+ from .messages import MLflowMessageType, MLflowCoordinationConfig, MLflowMetricsData, MLflowParamsData, MLflowRoundCompleteData, create_mlflow_coordination_message, extract_mlflow_coordination_config
25
+ from .server import MLflowServerCoordinator, create_coordinator_from_environment
26
+ from .client import MLflowClientLogger, MLflowClientIntegration, create_mlflow_client_integration, handle_mlflow_coordination_query, track_in_mlflow
27
+
28
+ __all__ = [
29
+ # Message types and data structures
30
+ "MLflowMessageType",
31
+ "MLflowCoordinationConfig",
32
+ "MLflowMetricsData",
33
+ "MLflowParamsData",
34
+ "MLflowRoundCompleteData",
35
+ "create_mlflow_coordination_message",
36
+ "extract_mlflow_coordination_config",
37
+
38
+ # Server-side coordination
39
+ "MLflowServerCoordinator",
40
+ "create_coordinator_from_environment",
41
+
42
+ # Client-side logging
43
+ "MLflowClientLogger",
44
+ "MLflowClientIntegration",
45
+ "create_mlflow_client_integration",
46
+ "handle_mlflow_coordination_query",
47
+ "track_in_mlflow",
48
+ ]