agentleFS
NVIDIAKnown publisherNVIDIA/NVFlare/CLAUDE.md

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

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
  1. Distinctive:

    Clients: Run Executors that execute tasks on local data

    line 75
  2. Distinctive:

    All Python files must include Apache 2.0 license header:

    line 124
  3. Very specific:

    Test files: tests/unit_test/ following [module_name]_test.py pattern

    line 134
  4. Very specific:

    Create a CLAUDE.local.md file (git-ignored) for personal preferences such as:

    line 148

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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_test

Code Style

# Check code style (flake8, black, isort)
./runtest.sh -s

# Auto-fix code style
./runtest.sh -f

# Check license headers
./runtest.sh -l

Documentation

# Build documentation
./build_doc.sh --html

# Clean documentation
./build_doc.sh --clean

Clean Build Artifacts

./runtest.sh --clean

Architecture 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/)

ComponentPurpose
ControllerServer-side workflow orchestrator that schedules tasks to clients
ExecutorClient-side task processor that runs on federated client nodes
ShareableData container for server-client communication
FLContextContext for passing data between FL components
TaskWork unit assigned by Controller to client workers
FilterTransforms Shareable data in/out of components
FLComponentBase class for all FL components

Controller Task Distribution Methods

  • broadcast() / broadcast_and_wait(): Send task to multiple clients
  • send() / send_and_wait(): Send task to a single client
  • relay() / 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 tools

Running 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.py pattern
  • 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 --help

Personal Configuration

Create a CLAUDE.local.md file (git-ignored) for personal preferences such as:

  • Preferred coding patterns
  • Local environment specifics
  • Custom shortcuts or workflows

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.