A Go implementation of OpenFL - An Open Framework for Federated Learning.
FL-Go provides the same CLI-driven workflow as the original OpenFL but with Go handling the orchestration and coordination while delegating ML operations to Python scripts.
- OpenFL-Compatible CLI: Same commands and workflow as the original OpenFL
- Go Orchestration: Fast, efficient coordination and communication in Go
- Python ML Integration: Seamless delegation of training/evaluation to Python
- gRPC Communication: Secure, efficient communication between components
- Multi-round Federated Learning: Support for multiple training rounds
- Asynchronous Federated Learning: Based on Papaya paper for scalable FL
- Mode Switching: Easy switching between synchronous and asynchronous FL modes
- Staleness-Aware Aggregation: Intelligent handling of stale updates in async mode
- Multiple Aggregation Algorithms: Support for FedAvg, FedOpt, and FedProx algorithms
- Modular Algorithm Framework: Easy to add new aggregation algorithms
- Hyperparameter Configuration: Fine-tune algorithm behavior via YAML configuration
- Comprehensive Monitoring: Real-time web UI with REST API for tracking FL metrics
- Event Streaming: WebSocket-based real-time monitoring of federation progress
- Resource Monitoring: Track system performance and collaborator health
- Security Features: mTLS support for secure communication
- Production Ready: Comprehensive testing, CI/CD, and monitoring
โโโโโโโโโโโโโโโโโโโ gRPC โโโโโโโโโโโโโโโโโโโ
โ Aggregator โโโโโโโโโโโโโโโค Collaborator โ
โ (Go Server) โ โ (Go Client) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ
โ metrics โ metrics
โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Model Averaging โ โ Training Script โ
โ (Go Logic) โ โ (Python ML) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โ monitoring
โผ
โโโโโโโโโโโโโโโโโโโ REST/WS โโโโโโโโโโโโโโโโโโโ
โ Monitoring API โโโโโโโโโโโโโโโโโโโค Web Dashboard โ
โ (Go Server) โ โ (React TypeScript)โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
fl-go/
โโโ ๐ api/ # Protocol definitions
โโโ ๐ cmd/ # Application entry points
โโโ ๐ pkg/ # Core packages
โโโ ๐ web/ # Web UI
โโโ ๐ examples/ # Examples and samples
โ โโโ ๐ plans/ # Federation plan examples
โ โโโ ๐ workspaces/ # Complete workspace examples
โ โโโ ๐ monitoring/ # Monitoring examples
โ โโโ ๐ scripts/ # Example scripts
โโโ ๐ docs/ # Documentation
โโโ ๐ scripts/ # Build and utility scripts
โโโ ๐ configs/ # Configuration files
โโโ ๐ deploy/ # Deployment configurations
โโโ ๐ tests/ # Test files and test data
โโโ ๐ tools/ # Development tools
- Go 1.23 or later
- Git
- Docker (optional)
- Node.js and npm (for web UI development)
-
Clone the repository
git clone https://github.com/fedai-oss/fl-go.git cd fl-go -
Setup development environment
make setup-dev
-
Build the project
make build
-
Run tests to verify installation
make test
-
Create a federation plan
# Use a sample plan cp examples/plans/basic/sync_plan.yaml my_federation.yaml -
Start the aggregator
./bin/fx aggregator start --config my_federation.yaml
-
Start collaborators (in separate terminals)
./bin/fx collaborator start --config my_federation.yaml --name client-1 ./bin/fx collaborator start --config my_federation.yaml --name client-2
-
Monitor progress
./bin/fx monitor start --config configs/monitoring/development.yaml
Then visit
http://localhost:3000in your browser.
# Build all components
make build
# Build specific components
make build-monitor
make build-web
# Build Docker image
make docker-build# Run all tests
make test
# Run specific test types
make test-unit
make test-integration
make test-security
make test-performance
# Run with coverage
make test-coverage# Format code
make format
# Run linting
make lint
# Validate federation flows
make validate# Use the basic example
cd examples/workspaces/basic_fl_workspace
./bin/fx aggregator start --config plan.yaml# Use the secure example
cd examples/workspaces/secure_mtls_workspace
./bin/fx security generate-certs --output-dir certs
./bin/fx aggregator start --config plan.yaml# Use the async example
cd examples/workspaces/async_fl_workspace
./bin/fx aggregator start --config plan.yamlFL-GO includes comprehensive security features and compliance tools:
- mTLS Support: Mutual TLS authentication for secure communication
- Certificate Management: Automated certificate generation and validation
- Secure Communication: Encrypted gRPC communication
- Access Control: Role-based access control for monitoring
- FOSSA Integration: Automated dependency analysis and license compliance
- Security Scanning: Integrated gosec and govulncheck for vulnerability detection
- Code Quality: Automated linting and code quality checks
- Audit Trail: Comprehensive logging and monitoring
# Generate certificates for mTLS
./bin/fx security generate-certs --output-dir certs
# Verify certificates
./bin/fx security verify-certs --cert certs/client.crt --key certs/client.keyWe welcome contributions! Please see our Contributing Guide for details.
# Setup development environment
make setup-dev
# Run tests
make test
# Format code
make format- Fork the repository
- Create a feature branch
- Make your changes
- Add tests and documentation
- Run the test suite
- Submit a pull request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- OpenFL - The original OpenFL framework
- Papaya - Asynchronous federated learning paper
- gRPC - High-performance RPC framework
- React - Web UI framework
- Documentation: docs/
- Examples: examples/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
FL-Go - Empowering Federated Learning with Go
Get Started โข Documentation โข Examples โข Contributing