{"categories":[{"label":"Scientific/Engineering","url":"https://skillfed.io/packages/category/scientific-engineering/6"}],"enrichment":{"capability":"Opacus enables training PyTorch models with differential privacy using DP-SGD, requiring minimal code changes to add privacy guarantees while tracking privacy budget consumption.","skillfed_tags":["differential-privacy","pytorch-extension","privacy-preserving-ml"],"use_cases":["Train models on sensitive data (medical records, financial data) with formal privacy guarantees for regulatory compliance","Federated learning scenarios where model updates must not leak information about individual training samples","Research into differential privacy algorithms and DP-SGD variants with minimal boilerplate","Building text classifiers on BERT with privacy (as shown in updated tutorials with LoRA/peft integration)","Image classification tasks where privacy budget must be tracked and controlled throughout training"],"what_it_does":"Opacus is a PyTorch library that adds differential privacy to model training through DP-SGD (Differentially Private Stochastic Gradient Descent). It wraps your existing model, optimizer, and data loader with privacy-aware counterparts via a PrivacyEngine, allowing you to train with formal privacy guarantees while monitoring privacy budget expenditure in real time.\n\nThe library targets both ML practitioners seeking an accessible introduction to privacy-preserving training and differential privacy researchers needing flexibility for experimentation. It depends on numpy, torch, scipy, and opt-einsum, and recent updates have introduced Fast Gradient Clipping and Ghost Clipping to reduce memory overhead during training.","worth_installing":"Yes, if you need to train PyTorch models with formal differential privacy guarantees. The library is actively maintained, has low installation friction, carries a permissive license, and integrates cleanly into existing PyTorch workflows. Install if privacy-preserving training is a requirement; skip if you have no privacy constraints."},"id":"opacus","links":{"html":"https://skillfed.io/packages/opacus","md":"https://skillfed.io/packages/opacus.md","pypi":"https://pypi.org/project/opacus/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-05","license_spdx":null,"license_treatment":"permissive","name":"opacus","python_support":"supports_current","summary":"Train PyTorch models with Differential Privacy"},"popularity":{"monthly_downloads":170543,"position":10391,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.6.0"}
