Machine Learning framework for encrypted data using Fully Homomorphic Encryption.
FHE ML enables training and inference on encrypted data without decryption. Part of the Lux FHE ecosystem.
- Privacy-preserving ML: Train models on encrypted data
- Quantization-aware training: Optimized for FHE computation
- scikit-learn compatible: Familiar API for ML practitioners
- GPU acceleration: Leverages luxfi/fhe-gpu
pip install luxfhe-mlOr from source:
git clone https://github.com/luxfi/fhe-ml
cd fhe-ml
pip install -e .from luxfhe.ml import FHEModelClient, FHEModelServer
from sklearn.datasets import make_classification
# Train a model
X, y = make_classification(n_samples=1000)
model = FHEModelClient()
model.fit(X, y)
# Compile for FHE
model.compile(X)
# Encrypted inference
encrypted_X = model.encrypt(X[:1])
encrypted_pred = model.predict(encrypted_X)
pred = model.decrypt(encrypted_pred)- luxfi/fhe - Core FHE library
- luxfi/fhe-compiler - LLVM compiler
- luxfi/lattice - Lattice primitives
BSD 3-Clause Clear License