NVFlare
CLAUDE.md979 starsChanged 3 months agoApache-2.0View on GitHub
NVIDIA FLARE (NVFlare) is a domain-agnostic, open-source Python SDK for federated learning. It allows ML/DL workflows to be adapted to a federated paradigm, enabling secure, privacy-preserving distributed multi-party collaboration. Key capabilities: PyTorch/TensorFlow/Scikit-learn/XGBoost support, horizontal and vertical FL, built-in FL algorithms (FedAvg, FedProx, FedOpt, Scaffold, Ditto), privacy preservation (differential privacy, homomorphic encryption, PSI). NVFlare uses a server-client federated architecture: - Server: Runs a Controller that schedules Tasks and aggregates results - Clients: Run Executors that execute tasks on local data -…
- Installs packages
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- research/auto-fl-research/AGENTS.mdAGENTS.md
- research/auto-fl-research/CLAUDE.mdCLAUDE.md
- autofl-nvflare-reportSkill
- autofl-nvflareSkill
- nvflare-autofl-reportSkill
- nvflare-autoflSkill
- nvflare-convert-huggingfaceSkill
- nvflare-convert-lightningSkill
- nvflare-convert-pytorchSkill
- nvflare-diagnose-jobSkill
- nvflare-fed-statsSkill
- nvflare-orientSkill
- nvflare-sharedSkill
- nvflare-example-skillSkill
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 75
Clients: Run Executors that execute tasks on local data
- Distinctive: line 124
All Python files must include Apache 2.0 license header:
- Very specific: line 134
Test files: tests/unit_test/ following [module_name]_test.py pattern
- Very specific: line 148
Create a CLAUDE.local.md file (git-ignored) for personal preferences such as:
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
NVIDIA FLARE (NVFlare) is a domain-agnostic, open-source Python SDK for federated learning. It allows ML/DL workflows to be adapted to a federated paradigm, enabling secure, privacy-preserving distributed multi-party collaboration.
Key capabilities: PyTorch/TensorFlow/Scikit-learn/XGBoost support, horizontal and vertical FL, built-in FL algorithms (FedAvg, FedProx, FedOpt, Scaffold, Ditto), privacy preservation (differential privacy, homomorphic encryption, PSI).
Common Commands
Development Setup
# Install development dependencies (macOS)
python3 -m pip install -e .[dev_mac]
# Install development dependencies (Linux)
python3 -m pip install -e .[dev]Testing
# Run all checks (license, style, tests with coverage)
./runtest.sh
# Run unit tests only
./runtest.sh -u
# Run unit tests with coverage report
./runtest.sh -u -c
# Run a specific test file
python3 -m pytest tests/unit_test/path/to/test_file.py -v
# Run a specific test
python3 -m pytest tests/unit_test/path/to/test_file.py::TestClass::test_method -v
# Run tests in parallel (8 processes)
python3 -m pytest --numprocesses=8 -v tests/unit_testCode Style
# Check code style (flake8, black, isort)
./runtest.sh -s
# Auto-fix code style
./runtest.sh -f
# Check license headers
./runtest.sh -lDocumentation
# Build documentation
./build_doc.sh --html
# Clean documentation
./build_doc.sh --cleanClean Build Artifacts
./runtest.sh --cleanArchitecture Overview
Core Concepts
NVFlare uses a server-client federated architecture:
- Server: Runs a Controller that schedules Tasks and aggregates results
- Clients: Run Executors that execute tasks on local data
- Shareable: The dict-based data structure for communication between server and clients
- FLContext: Context object passing data between FL components (supports private/public and sticky/non-sticky properties)
Key Components (nvflare/apis/)
| Component | Purpose |
Controller | Server-side workflow orchestrator that schedules tasks to clients |
Executor | Client-side task processor that runs on federated client nodes |
Shareable | Data container for server-client communication |
FLContext | Context for passing data between FL components |
Task | Work unit assigned by Controller to client workers |
Filter | Transforms Shareable data in/out of components |
FLComponent | Base class for all FL components |
Controller Task Distribution Methods
broadcast()/broadcast_and_wait(): Send task to multiple clientssend()/send_and_wait(): Send task to a single clientrelay()/relay_and_wait(): Sequential task execution across clients
Package Structure
nvflare/
├── apis/ # Core API specifications and interfaces
├── app_common/ # Common application utilities and FL algorithms
├── app_opt/ # Optional dependencies (HE, PSI, ML frameworks)
├── client/ # Client-side FLARE Client API
├── job_config/ # Job definition and configuration (FedJob API)
├── private/ # Internal implementations
├── fuel/ # Core infrastructure utilities
├── tool/ # CLI tools
├── dashboard/ # Web dashboard
└── lighter/ # Provisioning toolsRunning Modes
- Simulator: Local development (
nvflare simulator) - POC: Proof-of-concept deployment
- Production: Full distributed deployment with provisioning
Code Style Requirements
- Formatter: black (line length: 120)
- Linter: flake8
- Import sorter: isort (black profile)
- Python: 3.10, 3.11, 3.12, 3.13, 3.14
All Python files must include Apache 2.0 license header:
# Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# ...Test Conventions
- Test files:
tests/unit_test/following[module_name]_test.pypattern - Integration tests:
tests/integration_test/ - Framework: pytest with pytest-xdist (parallel) and pytest-cov (coverage)
CLI Entry Point
The nvflare CLI is the main entry point:
nvflare --help
nvflare simulator --helpPersonal Configuration
Create a CLAUDE.local.md file (git-ignored) for personal preferences such as:
- Preferred coding patterns
- Local environment specifics
- Custom shortcuts or workflows
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

