FHE for Python - Machine Learning on Encrypted Data
This SDK uses Lux's independent FHE implementation:
- ✅ Python bindings to
github.com/luxfi/tfhe(our Go TFHE) - ✅ NO Zama Concrete, concrete-ml, or tfhe-rs dependencies
- ✅ Protected by Lux Industries patent portfolio
LuxFHE Python SDK enables:
- FHE operations in Python
- Machine learning on encrypted data
- Integration with NumPy and PyTorch
pip install luxfhe
# or
uv add luxfhefrom luxfhe import LuxFHE, FheUint32
# Initialize
fhe = LuxFHE(network="testnet")
# Encrypt
secret = fhe.encrypt_uint32(42)
# Operations on encrypted data
result = fhe.add(secret, fhe.encrypt_uint32(8))
# Decrypt (requires key)
plaintext = fhe.decrypt_uint32(result)
print(f"42 + 8 = {plaintext}") # 50from luxfhe.ml import EncryptedModel
# Train model on plaintext
model = train_my_model(X_train, y_train)
# Convert to FHE model
encrypted_model = EncryptedModel(model)
# Inference on encrypted input
encrypted_input = fhe.encrypt_array(X_test)
encrypted_prediction = encrypted_model.predict(encrypted_input)
# Decrypt result
prediction = fhe.decrypt_array(encrypted_prediction)| Category | Operations |
|---|---|
| Arithmetic | add, sub, mul, div |
| Comparison | eq, lt, gt, le, ge |
| Bitwise | and, or, xor, not |
| Arrays | encrypt_array, decrypt_array |
| ML | predict, forward |
- Python 3.10+
- Go 1.21+ (for building bindings)
Lux Research License - Free on Lux Network.
© 2020-2025 Lux Industries Inc. All rights reserved.